[tbb-commits] [Git][tpo/applications/tor-browser][tor-browser-102.7.0esr-12.5-1] Bug 41565: Gate Telemetry Tasks behind MOZ_TELEMETRY_REPORTING

Pier Angelo Vendrame (@pierov) git at gitlab.torproject.org
Thu Jan 26 08:52:36 UTC 2023



Pier Angelo Vendrame pushed to branch tor-browser-102.7.0esr-12.5-1 at The Tor Project / Applications / Tor Browser


Commits:
47eb7d30 by cypherpunks1 at 2023-01-26T08:51:50+00:00
Bug 41565: Gate Telemetry Tasks behind MOZ_TELEMETRY_REPORTING

- - - - -


4 changed files:

- browser/base/content/browser.js
- browser/components/BrowserGlue.jsm
- toolkit/components/telemetry/app/TelemetryEnvironment.jsm
- toolkit/xre/nsAppRunner.cpp


Changes:

=====================================
browser/base/content/browser.js
=====================================
@@ -6053,6 +6053,7 @@ var TabsProgressListener = {
 
     // Collect telemetry data about tab load times.
     if (
+      AppConstants.MOZ_TELEMETRY_REPORTING &&
       aWebProgress.isTopLevel &&
       (!aRequest.originalURI || aRequest.originalURI.scheme != "about")
     ) {


=====================================
browser/components/BrowserGlue.jsm
=====================================
@@ -1721,7 +1721,9 @@ BrowserGlue.prototype = {
     this._firstWindowTelemetry(aWindow);
     this._firstWindowLoaded();
 
-    this._collectStartupConditionsTelemetry();
+    if (AppConstants.MOZ_TELEMETRY_REPORTING) {
+      this._collectStartupConditionsTelemetry();
+    }
 
     // Set the default favicon size for UI views that use the page-icon protocol.
     PlacesUtils.favicons.setDefaultIconURIPreferredSize(
@@ -2920,13 +2922,21 @@ BrowserGlue.prototype = {
         }
       },
 
-      () => BrowserUsageTelemetry.reportProfileCount(),
+      () => {
+        if (AppConstants.MOZ_TELEMETRY_REPORTING) {
+          BrowserUsageTelemetry.reportProfileCount();
+        }
+      },
 
       () => OsEnvironment.reportAllowedAppSources(),
 
       () => Services.search.runBackgroundChecks(),
 
-      () => BrowserUsageTelemetry.reportInstallationTelemetry(),
+      () => {
+        if (AppConstants.MOZ_TELEMETRY_REPORTING) {
+          BrowserUsageTelemetry.reportInstallationTelemetry();
+        }
+      },
     ];
 
     for (let task of idleTasks) {


=====================================
toolkit/components/telemetry/app/TelemetryEnvironment.jsm
=====================================
@@ -973,7 +973,9 @@ function EnvironmentCache() {
   p.push(this._addonBuilder.init());
 
   this._currentEnvironment.profile = {};
-  p.push(this._updateProfile());
+  if (AppConstants.MOZ_TELEMETRY_REPORTING) {
+    p.push(this._updateProfile());
+  }
   if (AppConstants.MOZ_BUILD_APP == "browser") {
     p.push(this._loadAttributionAsync());
   }


=====================================
toolkit/xre/nsAppRunner.cpp
=====================================
@@ -2886,7 +2886,9 @@ static ReturnAbortOnError ProfileErrorDialog(nsIFile* aProfileDir,
   rv = xpcom.Initialize();
   NS_ENSURE_SUCCESS(rv, rv);
 
+#if defined(MOZ_TELEMETRY_REPORTING)
   if (aProfileDir) mozilla::Telemetry::WriteFailedProfileLock(aProfileDir);
+#endif
 
   rv = xpcom.SetWindowCreator(aNative);
   NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE);



View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/47eb7d305746bd1a9e328b1fb7fef40d56769d5b

-- 
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/47eb7d305746bd1a9e328b1fb7fef40d56769d5b
You're receiving this email because of your account on gitlab.torproject.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.torproject.org/pipermail/tbb-commits/attachments/20230126/bf53eb07/attachment-0001.htm>


More information about the tbb-commits mailing list