diff options
author | Gaming4JC <g4jc@bulletmail.org> | 2018-08-19 18:18:36 -0400 |
---|---|---|
committer | Gaming4JC <g4jc@bulletmail.org> | 2018-08-19 18:18:36 -0400 |
commit | f3ea4b9d7ac88193b0669e12a31a20685c89691b (patch) | |
tree | 36c3c1770d3a2e636e34259975401014e923ddf1 /application/basilisk/base/content/sanitize.js | |
parent | f36ad080c6f2f13012180dc0ac566893be9020ad (diff) | |
download | UXP-f3ea4b9d7ac88193b0669e12a31a20685c89691b.tar UXP-f3ea4b9d7ac88193b0669e12a31a20685c89691b.tar.gz UXP-f3ea4b9d7ac88193b0669e12a31a20685c89691b.tar.lz UXP-f3ea4b9d7ac88193b0669e12a31a20685c89691b.tar.xz UXP-f3ea4b9d7ac88193b0669e12a31a20685c89691b.zip |
Basilisk: Remove TelemetryStopwatch
Diffstat (limited to 'application/basilisk/base/content/sanitize.js')
-rw-r--r-- | application/basilisk/base/content/sanitize.js | 55 |
1 files changed, 5 insertions, 50 deletions
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(); } } |