Bug 1301346 - Add telemetry to collect how much time was spent in handling beforeunload and unload event. r=bsmedberg,smaug

MozReview-Commit-ID: 3jCsBcDncGC
This commit is contained in:
Kan-Ru Chen
2016-09-09 12:06:36 +08:00
parent c996f27601
commit 3ee25b0923
2 changed files with 27 additions and 3 deletions

View File

@@ -1141,8 +1141,11 @@ nsDocumentViewer::PermitUnloadInternal(bool *aShouldPrompt,
nsIDocument::PageUnloadingEventTimeStamp timestamp(mDocument);
mInPermitUnload = true;
EventDispatcher::DispatchDOMEvent(window, nullptr, event, mPresContext,
nullptr);
{
Telemetry::AutoTimer<Telemetry::HANDLE_BEFOREUNLOAD_MS> telemetryTimer;
EventDispatcher::DispatchDOMEvent(window, nullptr, event, mPresContext,
nullptr);
}
mInPermitUnload = false;
}
@@ -1325,7 +1328,10 @@ nsDocumentViewer::PageHide(bool aIsUnload)
nsIDocument::PageUnloadingEventTimeStamp timestamp(mDocument);
EventDispatcher::Dispatch(window, mPresContext, &event, nullptr, &status);
{
Telemetry::AutoTimer<Telemetry::HANDLE_UNLOAD_MS> telemetryTimer;
EventDispatcher::Dispatch(window, mPresContext, &event, nullptr, &status);
}
}
#ifdef MOZ_XUL