Bug 795939 - Cancel FX_PAGE_LOAD_MS when the request is aborted; r=felipe

This commit is contained in:
Tim Taubert 2013-02-18 19:23:50 +01:00
parent e68d5f3063
commit efbe81a3b8

View File

@ -4733,12 +4733,16 @@ var TabsProgressListener = {
#endif
// Collect telemetry data about tab load times.
if (aWebProgress.DOMWindow == aWebProgress.DOMWindow.top &&
aStateFlags & Ci.nsIWebProgressListener.STATE_IS_WINDOW) {
if (aStateFlags & Ci.nsIWebProgressListener.STATE_START)
TelemetryStopwatch.start("FX_PAGE_LOAD_MS", aBrowser);
else if (aStateFlags & Ci.nsIWebProgressListener.STATE_STOP)
TelemetryStopwatch.finish("FX_PAGE_LOAD_MS", aBrowser);
if (aWebProgress.DOMWindow == aWebProgress.DOMWindow.top) {
if (aStateFlags & Ci.nsIWebProgressListener.STATE_IS_WINDOW) {
if (aStateFlags & Ci.nsIWebProgressListener.STATE_START)
TelemetryStopwatch.start("FX_PAGE_LOAD_MS", aBrowser);
else if (aStateFlags & Ci.nsIWebProgressListener.STATE_STOP)
TelemetryStopwatch.finish("FX_PAGE_LOAD_MS", aBrowser);
} else if (aStateFlags & Ci.nsIWebProgressListener.STATE_STOP &&
aStatus == Cr.NS_BINDING_ABORTED) {
TelemetryStopwatch.cancel("FX_PAGE_LOAD_MS", aBrowser);
}
}
// Attach a listener to watch for "click" events bubbling up from error