diff options
Diffstat (limited to 'application/basilisk/base/content')
9 files changed, 28 insertions, 373 deletions
diff --git a/application/basilisk/base/content/aboutNetError.xhtml b/application/basilisk/base/content/aboutNetError.xhtml index 609725c9e..3296600c8 100644 --- a/application/basilisk/base/content/aboutNetError.xhtml +++ b/application/basilisk/base/content/aboutNetError.xhtml @@ -123,13 +123,6 @@ document.getElementById("advancedButton") .addEventListener("click", function togglePanelVisibility() { toggleDisplay(panel); - if (gIsCertError) { - // Toggling the advanced panel must ensure that the debugging - // information panel is hidden as well, since it's opened by the - // error code link in the advanced panel. - var div = document.getElementById("certificateErrorDebugInformation"); - div.style.display = "none"; - } if (panel.style.display == "block") { // send event to trigger telemetry ping @@ -149,11 +142,6 @@ if (getCSSClass() == "expertBadCert") { toggleDisplay(document.getElementById("badCertAdvancedPanel")); - // Toggling the advanced panel must ensure that the debugging - // information panel is hidden as well, since it's opened by the - // error code link in the advanced panel. - var div = document.getElementById("certificateErrorDebugInformation"); - div.style.display = "none"; } disallowCertOverridesIfNeeded(); @@ -224,9 +212,6 @@ } if (err == "sslv3Used") { - document.getElementById("learnMoreContainer").style.display = "block"; - var learnMoreLink = document.getElementById("learnMoreLink"); - learnMoreLink.href = "https://support.mozilla.org/kb/how-resolve-sslv3-error-messages-firefox"; document.body.className = "certerror"; } @@ -270,17 +255,6 @@ window.addEventListener("AboutNetErrorOptions", function(evt) { // Pinning errors are of type nssFailure2 if (getErrorCode() == "nssFailure2" || getErrorCode() == "weakCryptoUsed") { - document.getElementById("learnMoreContainer").style.display = "block"; - var learnMoreLink = document.getElementById("learnMoreLink"); - // nssFailure2 also gets us other non-overrideable errors. Choose - // a "learn more" link based on description: - if (getDescription().includes("mozilla_pkix_error_key_pinning_failure")) { - learnMoreLink.href = "https://support.mozilla.org/kb/certificate-pinning-reports"; - } - if (getErrorCode() == "weakCryptoUsed") { - learnMoreLink.href = "https://support.mozilla.org/kb/how-resolve-weak-crypto-error-messages-firefox"; - } - const hasPrefStyleError = [ "interrupted", // This happens with subresources that are above the max tls "SSL_ERROR_PROTOCOL_VERSION_ALERT", @@ -312,7 +286,7 @@ } } - addDomainErrorLinks(); + addDomainErrorLink(); } function initPageCaptivePortal() @@ -329,7 +303,7 @@ addAutofocus("openPortalLoginPageButton"); setupAdvancedButton(true); - addDomainErrorLinks(); + addDomainErrorLink(); // When the portal is freed, an event is generated by the frame script // that we can pick up and attempt to reload the original page. @@ -348,12 +322,10 @@ addAutofocus("returnButton"); setupAdvancedButton(true); - document.getElementById("learnMoreContainer").style.display = "block"; - let event = new CustomEvent("AboutNetErrorLoad", {bubbles:true}); document.getElementById("advancedButton").dispatchEvent(event); - addDomainErrorLinks(); + addDomainErrorLink(); } /* Only do autofocus if we're the toplevel frame; otherwise we @@ -372,16 +344,13 @@ } } - /* Try to preserve the links contained in the error description, like - the error code. - - Also, in the case of SSL error pages about domain mismatch, see if + /* In the case of SSL error pages about domain mismatch, see if we can hyperlink the user to the correct site. We don't want to do this generically since it allows MitM attacks to redirect users to a site under attacker control, but in certain cases it is safe (and helpful!) to do so. Bug 402210 */ - function addDomainErrorLinks() { + function addDomainErrorLink() { // Rather than textContent, we need to treat description as HTML var sdid = gIsCertError ? "badCertTechnicalInfo" : "errorShortDescText"; var sd = document.getElementById(sdid); @@ -390,50 +359,28 @@ // sanitize description text - see bug 441169 - // First, find the index of the <a> tags we care about, being + // First, find the index of the <a> tag we care about, being // careful not to use an over-greedy regex. - var codeRe = /<a id="errorCode" title="([^"]+)">/; - var codeResult = codeRe.exec(desc); - var domainRe = /<a id="cert_domain_link" title="([^"]+)">/; - var domainResult = domainRe.exec(desc); - - // The order of these links in the description is fixed in - // TransportSecurityInfo.cpp:formatOverridableCertErrorMessage. - var firstResult = domainResult; - if (!domainResult) - firstResult = codeResult; - if (!firstResult) + var re = /<a id="cert_domain_link" title="([^"]+)">/; + var result = domainRe.exec(desc); + + if (!result) return; // Remove sd's existing children sd.textContent = ""; - // Everything up to the first link should be text content. - sd.appendChild(document.createTextNode(desc.slice(0, firstResult.index))); + // Everything up to the link should be text content. + sd.appendChild(document.createTextNode(desc.slice(0, result.index))); - // Now create the actual links. - if (domainResult) { - createLink(sd, "cert_domain_link", domainResult[1]) - // Append text for anything between the two links. - sd.appendChild(document.createTextNode(desc.slice(desc.indexOf("</a>") + "</a>".length, codeResult.index))); - } - createLink(sd, "errorCode", codeResult[1]) + // Now create the link itself. + var anchorEl = document.createElement("a"); + anchorEl.setAttribute("id", "cert_domain_link"); + anchorEl.setAttribute("title", result[1]); + anchorEl.appendChild(document.createTextNode(result[1])); + sd.appendChild(anchorEl); - // Finally, append text for anything after the last closing </a>. - sd.appendChild(document.createTextNode(desc.slice(desc.lastIndexOf("</a>") + "</a>".length))); - } - - if (gIsCertError) { - // Initialize the error code link embedded in the error message to - // display debug information about the cert error. - var errorCode = document.getElementById("errorCode"); - if (errorCode) { - errorCode.href = "javascript:void(0)"; - errorCode.addEventListener("click", () => { - let debugInfo = document.getElementById("certificateErrorDebugInformation"); - debugInfo.style.display = "block"; - debugInfo.scrollIntoView({block: "start", behavior: "smooth"}); - }, false); - } + // Finally, append text for anything after the closing </a>. + sd.appendChild(document.createTextNode(desc.slice(desc.indexOf("</a>") + "</a>".length))); } // Initialize the cert domain link. @@ -479,23 +426,8 @@ if (link.href && getCSSClass() != "expertBadCert") { var panelId = gIsCertError ? "badCertAdvancedPanel" : "weakCryptoAdvancedPanel" toggleDisplay(document.getElementById(panelId)); - if (gIsCertError) { - // Toggling the advanced panel must ensure that the debugging - // information panel is hidden as well, since it's opened by the - // error code link in the advanced panel. - var div = document.getElementById("certificateErrorDebugInformation"); - div.style.display = "none"; - } } } - - function createLink(el, id, text) { - var anchorEl = document.createElement("a"); - anchorEl.setAttribute("id", id); - anchorEl.setAttribute("title", text); - anchorEl.appendChild(document.createTextNode(text)); - el.appendChild(anchorEl); - } ]]></script> </head> @@ -628,12 +560,6 @@ </div> - <div id="certificateErrorDebugInformation"> - <button id="copyToClipboard">&certerror.copyToClipboard.label;</button> - <div id="certificateErrorText"/> - <button id="copyToClipboard">&certerror.copyToClipboard.label;</button> - </div> - <!-- - Note: It is important to run the script this way, instead of using - an onload handler. This is because error pages are loaded as diff --git a/application/basilisk/base/content/browser-fullScreenAndPointerLock.js b/application/basilisk/base/content/browser-fullScreenAndPointerLock.js index dbc9478c1..ebe55377f 100644 --- a/application/basilisk/base/content/browser-fullScreenAndPointerLock.js +++ b/application/basilisk/base/content/browser-fullScreenAndPointerLock.js @@ -379,12 +379,10 @@ var FullScreen = { let topWin = event.target.ownerGlobal.top; browser = gBrowser.getBrowserForContentWindow(topWin); } - TelemetryStopwatch.start("FULLSCREEN_CHANGE_MS"); this.enterDomFullscreen(browser); break; } case "MozDOMFullscreen:Exited": - TelemetryStopwatch.start("FULLSCREEN_CHANGE_MS"); this.cleanupDomFullscreen(); break; } @@ -410,7 +408,6 @@ var FullScreen = { } case "DOMFullscreen:Painted": { Services.obs.notifyObservers(window, "fullscreen-painted", ""); - TelemetryStopwatch.finish("FULLSCREEN_CHANGE_MS"); break; } } diff --git a/application/basilisk/base/content/browser-fxaccounts.js b/application/basilisk/base/content/browser-fxaccounts.js index 0bbce3e26..94a591f1e 100644 --- a/application/basilisk/base/content/browser-fxaccounts.js +++ b/application/basilisk/base/content/browser-fxaccounts.js @@ -4,8 +4,6 @@ var gFxAccounts = { - SYNC_MIGRATION_NOTIFICATION_TITLE: "fxa-migration", - _initialized: false, _inCustomizationMode: false, _cachedProfile: null, @@ -26,7 +24,6 @@ var gFxAccounts = { "weave:service:setup-complete", "weave:service:sync:error", "weave:ui:login:error", - "fxa-migration:state-changed", this.FxAccountsCommon.ONLOGIN_NOTIFICATION, this.FxAccountsCommon.ONLOGOUT_NOTIFICATION, this.FxAccountsCommon.ON_PROFILE_CHANGE_NOTIFICATION, @@ -122,9 +119,6 @@ var gFxAccounts = { observe: function (subject, topic, data) { switch (topic) { - case "fxa-migration:state-changed": - this.onMigrationStateChanged(data, subject); - break; case this.FxAccountsCommon.ON_PROFILE_CHANGE_NOTIFICATION: this._cachedProfile = null; // Fallthrough intended @@ -134,48 +128,6 @@ var gFxAccounts = { } }, - onMigrationStateChanged: function () { - // Since we nuked most of the migration code, this notification will fire - // once after legacy Sync has been disconnected (and should never fire - // again) - let nb = window.document.getElementById("global-notificationbox"); - - let msg = this.strings.GetStringFromName("autoDisconnectDescription") - let signInLabel = this.strings.GetStringFromName("autoDisconnectSignIn.label"); - let signInAccessKey = this.strings.GetStringFromName("autoDisconnectSignIn.accessKey"); - let learnMoreLink = this.fxaMigrator.learnMoreLink; - - let buttons = [ - { - label: signInLabel, - accessKey: signInAccessKey, - callback: () => { - this.openPreferences(); - } - } - ]; - - let fragment = document.createDocumentFragment(); - let msgNode = document.createTextNode(msg); - fragment.appendChild(msgNode); - if (learnMoreLink) { - let link = document.createElement("label"); - link.className = "text-link"; - link.setAttribute("value", learnMoreLink.text); - link.href = learnMoreLink.href; - fragment.appendChild(link); - } - - nb.appendNotification(fragment, - this.SYNC_MIGRATION_NOTIFICATION_TITLE, - undefined, - nb.PRIORITY_WARNING_LOW, - buttons); - - // ensure the hamburger menu reflects the newly disconnected state. - this.updateAppMenuItem(); - }, - handleEvent: function (event) { this._inCustomizationMode = event.type == "customizationstarting"; this.updateAppMenuItem(); diff --git a/application/basilisk/base/content/browser-gestureSupport.js b/application/basilisk/base/content/browser-gestureSupport.js index f472e5c9a..6c21a6ad5 100644 --- a/application/basilisk/base/content/browser-gestureSupport.js +++ b/application/basilisk/base/content/browser-gestureSupport.js @@ -1001,13 +1001,10 @@ var gHistorySwipeAnimation = { ctx.DRAWWINDOW_ASYNC_DECODE_IMAGES | ctx.DRAWWINDOW_USE_WIDGET_LAYERS); - TelemetryStopwatch.start("FX_GESTURE_INSTALL_SNAPSHOT_OF_PAGE"); try { this._installCurrentPageSnapshot(canvas); this._assignSnapshotToCurrentBrowser(canvas); - } finally { - TelemetryStopwatch.finish("FX_GESTURE_INSTALL_SNAPSHOT_OF_PAGE"); - } + } catch (e) {} }, /** @@ -1058,7 +1055,6 @@ var gHistorySwipeAnimation = { return; } - TelemetryStopwatch.start("FX_GESTURE_COMPRESS_SNAPSHOT_OF_PAGE"); try { let browser = gBrowser.selectedBrowser; let snapshots = browser.snapshots; @@ -1072,9 +1068,7 @@ var gHistorySwipeAnimation = { } }, "image/png" ); - } finally { - TelemetryStopwatch.finish("FX_GESTURE_COMPRESS_SNAPSHOT_OF_PAGE"); - } + } catch (e) {} }, /** diff --git a/application/basilisk/base/content/browser.js b/application/basilisk/base/content/browser.js index 9ec7715fa..4f4ebb08f 100644 --- a/application/basilisk/base/content/browser.js +++ b/application/basilisk/base/content/browser.js @@ -45,7 +45,6 @@ Cu.import("resource://gre/modules/NotificationDB.jsm"); ["SitePermissions", "resource:///modules/SitePermissions.jsm"], ["TabCrashHandler", "resource:///modules/ContentCrashHandlers.jsm"], ["Task", "resource://gre/modules/Task.jsm"], - ["TelemetryStopwatch", "resource://gre/modules/TelemetryStopwatch.jsm"], ["Translation", "resource:///modules/translation/Translation.jsm"], ["UpdateUtils", "resource://gre/modules/UpdateUtils.jsm"], ["Weave", "resource://services-sync/main.js"], @@ -2888,24 +2887,7 @@ var BrowserOnClick = { secHistogram.add(Ci.nsISecurityUITelemetry.WARNING_BAD_CERT_TOP_UNDERSTAND_RISKS); } - securityInfo = getSecurityInfo(securityInfoAsString); - let errorInfo = getDetailedCertErrorInfo(location, - securityInfo); - browser.messageManager.sendAsyncMessage( "CertErrorDetails", { - code: securityInfo.errorCode, - info: errorInfo - }); - break; - - case "copyToClipboard": - const gClipboardHelper = Cc["@mozilla.org/widget/clipboardhelper;1"] - .getService(Ci.nsIClipboardHelper); - securityInfo = getSecurityInfo(securityInfoAsString); - let detailedInfo = getDetailedCertErrorInfo(location, - securityInfo); - gClipboardHelper.copyString(detailedInfo); break; - } }, @@ -3145,81 +3127,6 @@ function getSecurityInfo(securityInfoAsString) { return securityInfo; } -/** - * Returns a string with detailed information about the certificate validation - * failure from the specified URI that can be used to send a report. - */ -function getDetailedCertErrorInfo(location, securityInfo) { - if (!securityInfo) - return ""; - - let certErrorDetails = location; - let code = securityInfo.errorCode; - let errors = Cc["@mozilla.org/nss_errors_service;1"] - .getService(Ci.nsINSSErrorsService); - - certErrorDetails += "\r\n\r\n" + errors.getErrorMessage(errors.getXPCOMFromNSSError(code)); - - const sss = Cc["@mozilla.org/ssservice;1"] - .getService(Ci.nsISiteSecurityService); - // SiteSecurityService uses different storage if the channel is - // private. Thus we must give isSecureHost correct flags or we - // might get incorrect results. - let flags = PrivateBrowsingUtils.isWindowPrivate(window) ? - Ci.nsISocketProvider.NO_PERMANENT_STORAGE : 0; - - let uri = Services.io.newURI(location, null, null); - - let hasHSTS = sss.isSecureHost(sss.HEADER_HSTS, uri.host, flags); - let hasHPKP = sss.isSecureHost(sss.HEADER_HPKP, uri.host, flags); - certErrorDetails += "\r\n\r\n" + - gNavigatorBundle.getFormattedString("certErrorDetailsHSTS.label", - [hasHSTS]); - certErrorDetails += "\r\n" + - gNavigatorBundle.getFormattedString("certErrorDetailsKeyPinning.label", - [hasHPKP]); - - let certChain = ""; - if (securityInfo.failedCertChain) { - let certs = securityInfo.failedCertChain.getEnumerator(); - while (certs.hasMoreElements()) { - let cert = certs.getNext(); - cert.QueryInterface(Ci.nsIX509Cert); - certChain += getPEMString(cert); - } - } - - certErrorDetails += "\r\n\r\n" + - gNavigatorBundle.getString("certErrorDetailsCertChain.label") + - "\r\n\r\n" + certChain; - - return certErrorDetails; -} - -// TODO: can we pull getDERString and getPEMString in from pippki.js instead of -// duplicating them here? -function getDERString(cert) -{ - var length = {}; - var derArray = cert.getRawDER(length); - var derString = ''; - for (var i = 0; i < derArray.length; i++) { - derString += String.fromCharCode(derArray[i]); - } - return derString; -} - -function getPEMString(cert) -{ - var derb64 = btoa(getDERString(cert)); - // Wrap the Base64 string into lines of 64 characters, - // with CRLF line breaks (as specified in RFC 1421). - var wrapped = derb64.replace(/(\S{64}(?!$))/g, "$1\r\n"); - return "-----BEGIN CERTIFICATE-----\r\n" - + wrapped - + "\r\n-----END CERTIFICATE-----\r\n"; -} - var PrintPreviewListener = { _printPreviewTab: null, _tabBeforePrintPreview: null, @@ -3910,8 +3817,6 @@ function toOpenWindowByType(inType, uri, features) function OpenBrowserWindow(options) { - var telemetryObj = {}; - TelemetryStopwatch.start("FX_NEW_WINDOW_MS", telemetryObj); function newDocumentShown(doc, topic, data) { if (topic == "document-shown" && @@ -3919,7 +3824,6 @@ function OpenBrowserWindow(options) doc.defaultView == win) { Services.obs.removeObserver(newDocumentShown, "document-shown"); Services.obs.removeObserver(windowClosed, "domwindowclosed"); - TelemetryStopwatch.finish("FX_NEW_WINDOW_MS", telemetryObj); } } @@ -4715,25 +4619,6 @@ var TabsProgressListener = { _startedLoadTimer: new WeakSet(), onStateChange: function (aBrowser, aWebProgress, aRequest, aStateFlags, aStatus) { - // Collect telemetry data about tab load times. - if (aWebProgress.isTopLevel && (!aRequest.originalURI || aRequest.originalURI.spec.scheme != "about")) { - if (aStateFlags & Ci.nsIWebProgressListener.STATE_IS_WINDOW) { - if (aStateFlags & Ci.nsIWebProgressListener.STATE_START) { - this._startedLoadTimer.add(aBrowser); - TelemetryStopwatch.start("FX_PAGE_LOAD_MS", aBrowser); - Services.telemetry.getHistogramById("FX_TOTAL_TOP_VISITS").add(true); - } else if (aStateFlags & Ci.nsIWebProgressListener.STATE_STOP && - this._startedLoadTimer.has(aBrowser)) { - this._startedLoadTimer.delete(aBrowser); - TelemetryStopwatch.finish("FX_PAGE_LOAD_MS", aBrowser); - } - } else if (aStateFlags & Ci.nsIWebProgressListener.STATE_STOP && - aStatus == Cr.NS_BINDING_ABORTED && - this._startedLoadTimer.has(aBrowser)) { - this._startedLoadTimer.delete(aBrowser); - TelemetryStopwatch.cancel("FX_PAGE_LOAD_MS", aBrowser); - } - } // We used to listen for clicks in the browser here, but when that // became unnecessary, removing the code below caused focus issues. diff --git a/application/basilisk/base/content/browser.xul b/application/basilisk/base/content/browser.xul index 982edfcd9..74a90f5e0 100644 --- a/application/basilisk/base/content/browser.xul +++ b/application/basilisk/base/content/browser.xul @@ -521,8 +521,7 @@ tabbrowser="content" flex="1" setfocus="false" - tooltip="tabbrowser-tab-tooltip" - stopwatchid="FX_TAB_CLICK_MS"> + tooltip="tabbrowser-tab-tooltip"> <tab class="tabbrowser-tab" selected="true" visuallyselected="true" fadein="true"/> </tabs> diff --git a/application/basilisk/base/content/content.js b/application/basilisk/base/content/content.js index 88e58b501..5accbdf7b 100644 --- a/application/basilisk/base/content/content.js +++ b/application/basilisk/base/content/content.js @@ -298,12 +298,10 @@ var AboutNetAndCertErrorListener = { onCertErrorDetails(msg) { let div = content.document.getElementById("certificateErrorText"); div.textContent = msg.data.info; - let learnMoreLink = content.document.getElementById("learnMoreLink"); let baseURL = Services.urlFormatter.formatURLPref("app.support.baseURL"); switch (msg.data.code) { case SEC_ERROR_UNKNOWN_ISSUER: - learnMoreLink.href = baseURL + "security-error"; break; // in case the certificate expired we make sure the system clock @@ -336,7 +334,6 @@ var AboutNetAndCertErrorListener = { content.document.getElementById("wrongSystemTimePanel") .style.display = "block"; } - learnMoreLink.href = baseURL + "time-errors"; break; } }, diff --git a/application/basilisk/base/content/sanitize.js b/application/basilisk/base/content/sanitize.js index 841376580..0a00defa4 100644 --- a/application/basilisk/base/content/sanitize.js +++ b/application/basilisk/base/content/sanitize.js @@ -19,8 +19,6 @@ XPCOMUtils.defineLazyModuleGetter(this, "Task", "resource://gre/modules/Task.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "DownloadsCommon", "resource:///modules/DownloadsCommon.jsm"); -XPCOMUtils.defineLazyModuleGetter(this, "TelemetryStopwatch", - "resource://gre/modules/TelemetryStopwatch.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "console", "resource://gre/modules/Console.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "Preferences", @@ -154,8 +152,6 @@ Sanitizer.prototype = { // we catch and store them, but continue to sanitize as much as possible. // Callers should check returned errors and give user feedback // about items that could not be sanitized - let refObj = {}; - TelemetryStopwatch.start("FX_SANITIZE_TOTAL", refObj); let annotateError = (name, ex) => { progress[name] = "failed"; @@ -188,7 +184,7 @@ Sanitizer.prototype = { } // Sanitization is complete. - TelemetryStopwatch.finish("FX_SANITIZE_TOTAL", refObj); + // Reset the inProgress preference since we were not killed during // sanitization. Preferences.reset(Sanitizer.PREF_SANITIZE_IN_PROGRESS); @@ -210,8 +206,6 @@ Sanitizer.prototype = { cache: { clear: Task.async(function* (range) { let seenException; - let refObj = {}; - TelemetryStopwatch.start("FX_SANITIZE_CACHE", refObj); try { // Cache doesn't consult timespan, nor does it have the @@ -232,7 +226,6 @@ Sanitizer.prototype = { seenException = ex; } - TelemetryStopwatch.finish("FX_SANITIZE_CACHE", refObj); if (seenException) { throw seenException; } @@ -243,10 +236,8 @@ Sanitizer.prototype = { clear: Task.async(function* (range) { let seenException; let yieldCounter = 0; - let refObj = {}; // Clear cookies. - TelemetryStopwatch.start("FX_SANITIZE_COOKIES_2", refObj); try { let cookieMgr = Components.classes["@mozilla.org/cookiemanager;1"] .getService(Ci.nsICookieManager); @@ -274,8 +265,6 @@ Sanitizer.prototype = { } } catch (ex) { seenException = ex; - } finally { - TelemetryStopwatch.finish("FX_SANITIZE_COOKIES_2", refObj); } // Clear deviceIds. Done asynchronously (returns before complete). @@ -332,13 +321,6 @@ Sanitizer.prototype = { if (!range || age >= 0) { let tags = ph.getPluginTags(); for (let tag of tags) { - let refObj = {}; - let probe = ""; - if (/\bFlash\b/.test(tag.name)) { - probe = tag.loaded ? "FX_SANITIZE_LOADED_FLASH" - : "FX_SANITIZE_UNLOADED_FLASH"; - TelemetryStopwatch.start(probe, refObj); - } try { let rv = yield new Promise(resolve => ph.clearSiteData(tag, null, FLAG_CLEAR_ALL, age, resolve) @@ -349,14 +331,8 @@ Sanitizer.prototype = { ph.clearSiteData(tag, null, FLAG_CLEAR_ALL, -1, resolve) ); } - if (probe) { - TelemetryStopwatch.finish(probe, refObj); - } } catch (ex) { // Ignore errors from plug-ins - if (probe) { - TelemetryStopwatch.cancel(probe, refObj); - } } } } @@ -413,8 +389,6 @@ Sanitizer.prototype = { history: { clear: Task.async(function* (range) { let seenException; - let refObj = {}; - TelemetryStopwatch.start("FX_SANITIZE_HISTORY", refObj); try { if (range) { yield PlacesUtils.history.removeVisitsByFilter({ @@ -427,8 +401,6 @@ Sanitizer.prototype = { } } catch (ex) { seenException = ex; - } finally { - TelemetryStopwatch.finish("FX_SANITIZE_HISTORY", refObj); } try { @@ -455,8 +427,6 @@ Sanitizer.prototype = { formdata: { clear: Task.async(function* (range) { let seenException; - let refObj = {}; - TelemetryStopwatch.start("FX_SANITIZE_FORMDATA", refObj); try { // Clear undo history of all searchBars let windows = Services.wm.getEnumerator("navigator:browser"); @@ -504,7 +474,6 @@ Sanitizer.prototype = { seenException = ex; } - TelemetryStopwatch.finish("FX_SANITIZE_FORMDATA", refObj); if (seenException) { throw seenException; } @@ -513,8 +482,6 @@ Sanitizer.prototype = { downloads: { clear: Task.async(function* (range) { - let refObj = {}; - TelemetryStopwatch.start("FX_SANITIZE_DOWNLOADS", refObj); try { let filterByTime = null; if (range) { @@ -528,16 +495,13 @@ Sanitizer.prototype = { // Clear all completed/cancelled downloads let list = yield Downloads.getList(Downloads.ALL); list.removeFinished(filterByTime); - } finally { - TelemetryStopwatch.finish("FX_SANITIZE_DOWNLOADS", refObj); - } + } catch (ex) { + } }) }, sessions: { clear: Task.async(function* (range) { - let refObj = {}; - TelemetryStopwatch.start("FX_SANITIZE_SESSIONS", refObj); try { // clear all auth tokens @@ -547,17 +511,14 @@ Sanitizer.prototype = { // clear FTP and plain HTTP auth sessions Services.obs.notifyObservers(null, "net:clear-active-logins", null); - } finally { - TelemetryStopwatch.finish("FX_SANITIZE_SESSIONS", refObj); - } + } catch (ex) { + } }) }, siteSettings: { clear: Task.async(function* (range) { let seenException; - let refObj = {}; - TelemetryStopwatch.start("FX_SANITIZE_SITESETTINGS", refObj); let startDateMS = range ? range[0] / 1000 : null; @@ -615,7 +576,6 @@ Sanitizer.prototype = { seenException = ex; } - TelemetryStopwatch.finish("FX_SANITIZE_SITESETTINGS", refObj); if (seenException) { throw seenException; } @@ -672,9 +632,6 @@ Sanitizer.prototype = { // If/once we get here, we should actually be able to close all windows. - let refObj = {}; - TelemetryStopwatch.start("FX_SANITIZE_OPENWINDOWS", refObj); - // First create a new window. We do this first so that on non-mac, we don't // accidentally close the app by closing all the windows. let handler = Cc["@mozilla.org/browser/clh;1"].getService(Ci.nsIBrowserHandler); @@ -719,7 +676,6 @@ Sanitizer.prototype = { newWindowOpened = true; // If we're the last thing to happen, invoke callback. if (numWindowsClosing == 0) { - TelemetryStopwatch.finish("FX_SANITIZE_OPENWINDOWS", refObj); resolve(); } } @@ -731,7 +687,6 @@ Sanitizer.prototype = { Services.obs.removeObserver(onWindowClosed, "xul-window-destroyed"); // If we're the last thing to happen, invoke callback. if (newWindowOpened) { - TelemetryStopwatch.finish("FX_SANITIZE_OPENWINDOWS", refObj); resolve(); } } diff --git a/application/basilisk/base/content/tabbrowser.xml b/application/basilisk/base/content/tabbrowser.xml index f8dbcf364..76ea5d167 100644 --- a/application/basilisk/base/content/tabbrowser.xml +++ b/application/basilisk/base/content/tabbrowser.xml @@ -1042,11 +1042,6 @@ </body> </method> - <!-- Holds a unique ID for the tab change that's currently being timed. - Used to make sure that multiple, rapid tab switches do not try to - create overlapping timers. --> - <field name="_tabSwitchID">null</field> - <method name="updateCurrentBrowser"> <parameter name="aForceUpdate"/> <body> @@ -1055,33 +1050,6 @@ if (this.mCurrentBrowser == newBrowser && !aForceUpdate) return; - if (!aForceUpdate) { - TelemetryStopwatch.start("FX_TAB_SWITCH_UPDATE_MS"); - if (!gMultiProcessBrowser) { - // old way of measuring tab paint which is not valid with e10s. - // Waiting until the next MozAfterPaint ensures that we capture - // the time it takes to paint, upload the textures to the compositor, - // and then composite. - if (this._tabSwitchID) { - TelemetryStopwatch.cancel("FX_TAB_SWITCH_TOTAL_MS"); - } - - let tabSwitchID = Symbol(); - - TelemetryStopwatch.start("FX_TAB_SWITCH_TOTAL_MS"); - this._tabSwitchID = tabSwitchID; - - let onMozAfterPaint = () => { - if (this._tabSwitchID === tabSwitchID) { - TelemetryStopwatch.finish("FX_TAB_SWITCH_TOTAL_MS"); - this._tabSwitchID = null; - } - window.removeEventListener("MozAfterPaint", onMozAfterPaint); - } - window.addEventListener("MozAfterPaint", onMozAfterPaint); - } - } - var oldTab = this.mCurrentTab; // Preview mode should not reset the owner @@ -1274,9 +1242,6 @@ }); this.dispatchEvent(event); } - - if (!aForceUpdate) - TelemetryStopwatch.finish("FX_TAB_SWITCH_UPDATE_MS"); ]]> </body> </method> @@ -4145,8 +4110,6 @@ */ startTabSwitch: function () { - TelemetryStopwatch.cancel("FX_TAB_SWITCH_TOTAL_E10S_MS", window); - TelemetryStopwatch.start("FX_TAB_SWITCH_TOTAL_E10S_MS", window); this.addMarker("AsyncTabSwitch:Start"); this.switchInProgress = true; }, @@ -4162,31 +4125,18 @@ this.getTabState(this.requestedTab) == this.STATE_LOADED) { // After this point the tab has switched from the content thread's point of view. // The changes will be visible after the next refresh driver tick + composite. - let time = TelemetryStopwatch.timeElapsed("FX_TAB_SWITCH_TOTAL_E10S_MS", window); - if (time != -1) { - TelemetryStopwatch.finish("FX_TAB_SWITCH_TOTAL_E10S_MS", window); - this.log("DEBUG: tab switch time = " + time); this.addMarker("AsyncTabSwitch:Finish"); - } this.switchInProgress = false; } }, spinnerDisplayed: function () { this.assert(!this.spinnerTab); - TelemetryStopwatch.start("FX_TAB_SWITCH_SPINNER_VISIBLE_MS", window); - // We have a second, similar probe for capturing recordings of - // when the spinner is displayed for very long periods. - TelemetryStopwatch.start("FX_TAB_SWITCH_SPINNER_VISIBLE_LONG_MS", window); this.addMarker("AsyncTabSwitch:SpinnerShown"); }, spinnerHidden: function () { this.assert(this.spinnerTab); - this.log("DEBUG: spinner time = " + - TelemetryStopwatch.timeElapsed("FX_TAB_SWITCH_SPINNER_VISIBLE_MS", window)); - TelemetryStopwatch.finish("FX_TAB_SWITCH_SPINNER_VISIBLE_MS", window); - TelemetryStopwatch.finish("FX_TAB_SWITCH_SPINNER_VISIBLE_LONG_MS", window); this.addMarker("AsyncTabSwitch:SpinnerHidden"); // we do not get a onPaint after displaying the spinner this.maybeFinishTabSwitch(); |