Bug 1198459 - Update telemetry data based on the use of the forced enable pref. r=felipe
authorJim Mathies <jmathies@mozilla.com>
Thu, 10 Dec 2015 17:11:03 -0500
changeset 310331 42740b8ac38002d9aa41c4baf71485b4687e45c9
parent 310330 dd880f72d4709bb75d99f0d2af0c2365e507a8c5
child 310332 00f88afb10ac4cdb0b75b0dc3d5e13180df09751
push id5513
push userraliiev@mozilla.com
push dateMon, 25 Jan 2016 13:55:34 +0000
treeherdermozilla-beta@5ee97dd05b5c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfelipe
bugs1198459
milestone45.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1198459 - Update telemetry data based on the use of the forced enable pref. r=felipe
toolkit/xre/nsAppRunner.cpp
widget/nsBaseWidget.cpp
--- a/toolkit/xre/nsAppRunner.cpp
+++ b/toolkit/xre/nsAppRunner.cpp
@@ -4590,26 +4590,30 @@ enum {
   kE10sEnabledByUser = 0,
   kE10sEnabledByDefault = 1,
   kE10sDisabledByUser = 2,
   // kE10sDisabledInSafeMode = 3, was removed in bug 1172491.
   kE10sDisabledForAccessibility = 4,
   kE10sDisabledForMacGfx = 5,
 };
 
+#ifdef XP_WIN
 const char* kAccessibilityLastRunDatePref = "accessibility.lastLoadDate";
 const char* kAccessibilityLoadedLastSessionPref = "accessibility.loadedInLastSession";
+#endif // XP_WIN
 const char* kForceEnableE10sPref = "browser.tabs.remote.force-enable";
 
+#ifdef XP_WIN
 static inline uint32_t
 PRTimeToSeconds(PRTime t_usec)
 {
   PRTime usec_per_sec = PR_USEC_PER_SEC;
   return uint32_t(t_usec /= usec_per_sec);
 }
+#endif // XP_WIN
 
 bool
 mozilla::BrowserTabsRemoteAutostart()
 {
   if (gBrowserTabsRemoteAutostartInitialized) {
     return gBrowserTabsRemoteAutostart;
   }
   gBrowserTabsRemoteAutostartInitialized = true;
@@ -4637,17 +4641,17 @@ mozilla::BrowserTabsRemoteAutostart()
     uint32_t now = PRTimeToSeconds(PR_Now());
     uint32_t difference = now - a11yRunDate;
     if (difference > ONE_WEEK_IN_SECONDS || !a11yRunDate) {
       Preferences::ClearUser(kAccessibilityLastRunDatePref);
     } else {
       disabledForA11y = true;
     }
   }
-#endif
+#endif // XP_WIN
 
   bool optInPref = Preferences::GetBool("browser.tabs.remote.autostart", false);
   bool trialPref = Preferences::GetBool("browser.tabs.remote.autostart.2", false);
   bool prefEnabled = optInPref || trialPref;
   int status;
   if (optInPref) {
     status = kE10sEnabledByUser;
   } else if (trialPref) {
@@ -4717,16 +4721,18 @@ mozilla::BrowserTabsRemoteAutostart()
       LogE10sBlockedReason("Hardware acceleration is disabled");
     }
   }
 #endif // defined(XP_MACOSX)
 
   // Uber override pref for manual testing purposes
   if (Preferences::GetBool(kForceEnableE10sPref, false)) {
     gBrowserTabsRemoteAutostart = true;
+    prefEnabled = true;
+    status = kE10sEnabledByUser;
   }
 
   mozilla::Telemetry::Accumulate(mozilla::Telemetry::E10S_AUTOSTART, gBrowserTabsRemoteAutostart);
   mozilla::Telemetry::Accumulate(mozilla::Telemetry::E10S_AUTOSTART_STATUS, status);
   if (Preferences::GetBool("browser.enabledE10SFromPrompt", false)) {
     mozilla::Telemetry::Accumulate(mozilla::Telemetry::E10S_STILL_ACCEPTED_FROM_PROMPT,
                                     gBrowserTabsRemoteAutostart);
   }
--- a/widget/nsBaseWidget.cpp
+++ b/widget/nsBaseWidget.cpp
@@ -1765,25 +1765,27 @@ nsBaseWidget::GetTextEventDispatcher()
   if (!mTextEventDispatcher) {
     mTextEventDispatcher = new TextEventDispatcher(this);
   }
   return mTextEventDispatcher;
 }
 
 #ifdef ACCESSIBILITY
 
+#ifdef XP_WIN
 // defined in nsAppRunner.cpp
 extern const char* kAccessibilityLastRunDatePref;
 
 static inline uint32_t
 PRTimeToSeconds(PRTime t_usec)
 {
   PRTime usec_per_sec = PR_USEC_PER_SEC;
   return uint32_t(t_usec /= usec_per_sec);
 }
+#endif
 
 a11y::Accessible*
 nsBaseWidget::GetRootAccessible()
 {
   NS_ENSURE_TRUE(mWidgetListener, nullptr);
 
   nsIPresShell* presShell = mWidgetListener->GetPresShell();
   NS_ENSURE_TRUE(presShell, nullptr);
@@ -1793,18 +1795,20 @@ nsBaseWidget::GetRootAccessible()
   nsPresContext* presContext = presShell->GetPresContext();
   NS_ENSURE_TRUE(presContext->GetContainerWeak(), nullptr);
 
   // Accessible creation might be not safe so use IsSafeToRunScript to
   // make sure it's not created at unsafe times.
   nsCOMPtr<nsIAccessibilityService> accService =
     services::GetAccessibilityService();
   if (accService) {
+#ifdef XP_WIN
     uint32_t now = PRTimeToSeconds(PR_Now());
     Preferences::SetInt(kAccessibilityLastRunDatePref, now);
+#endif
     return accService->GetRootDocumentAccessible(presShell, nsContentUtils::IsSafeToRunScript());
   }
 
   return nullptr;
 }
 
 #endif // ACCESSIBILITY