Bug 1275039 - Block e10s from being activated for release users on Windows XP. r=jimm draft
authorFelipe Gomes <felipc@gmail.com>
Mon, 23 May 2016 19:40:51 -0300
changeset 369851 d03bfe2ac5b37269da02af3e9c03adbc35897a17
parent 369317 16663eb3dcfa759f25b5e27b101bc79270c156f2
child 369852 aca93bcab934ccaf19e434b3499343d22d2b1d86
child 369853 c453e2f094ca402219bdb2c8137474d2b8526908
push id18936
push userfelipc@gmail.com
push dateMon, 23 May 2016 22:41:58 +0000
reviewersjimm
bugs1275039
milestone49.0a1
Bug 1275039 - Block e10s from being activated for release users on Windows XP. r=jimm There's some reorganization of the code in aboutSupport to support displaying Windows XP as a string without needing to be localized, as this will require an uplift to Aurora. MozReview-Commit-ID: 7SArswDOffH
toolkit/content/aboutSupport.js
toolkit/xre/nsAppRunner.cpp
--- a/toolkit/content/aboutSupport.js
+++ b/toolkit/content/aboutSupport.js
@@ -44,33 +44,36 @@ var snapshotFormatters = {
     let version = AppConstants.MOZ_APP_VERSION_DISPLAY;
     if (data.vendor)
       version += " (" + data.vendor + ")";
     $("version-box").textContent = version;
     $("buildid-box").textContent = data.buildID;
     if (data.updateChannel)
       $("updatechannel-box").textContent = data.updateChannel;
 
-    let statusStrName = ".unknown";
+    let statusText = stringBundle().GetStringFromName("multiProcessStatus.unknown");
 
     // Whitelist of known values with string descriptions:
     switch (data.autoStartStatus) {
       case 0:
       case 1:
       case 2:
       case 4:
-      case 5:
       case 6:
       case 7:
       case 8:
       case 9:
-        statusStrName = "." + data.autoStartStatus;
+        statusText = stringBundle().GetStringFromName("multiProcessStatus." + data.autoStartStatus);
+        break;
+
+      case 10:
+        statusText = "Windows XP";
+        break;
     }
 
-    let statusText = stringBundle().GetStringFromName("multiProcessStatus" + statusStrName);
     $("multiprocess-box").textContent = stringBundle().formatStringFromName("multiProcessWindows",
       [data.numRemoteWindows, data.numTotalWindows, statusText], 3);
 
     $("safemode-box").textContent = data.safeMode;
   },
 
   crashes: function crashes(data) {
     if (!AppConstants.MOZ_CRASHREPORTER)
--- a/toolkit/xre/nsAppRunner.cpp
+++ b/toolkit/xre/nsAppRunner.cpp
@@ -4693,16 +4693,17 @@ enum {
   kE10sDisabledByUser = 2,
   // kE10sDisabledInSafeMode = 3, was removed in bug 1172491.
   kE10sDisabledForAccessibility = 4,
   // kE10sDisabledForMacGfx = 5, was removed in bug 1068674.
   kE10sDisabledForBidi = 6,
   kE10sDisabledForAddons = 7,
   kE10sForceDisabled = 8,
   kE10sDisabledForXPAcceleration = 9,
+  kE10sDisabledForOperatingSystem = 10,
 };
 
 #if defined(XP_WIN) || defined(XP_MACOSX)
 const char* kAccessibilityLastRunDatePref = "accessibility.lastLoadDate";
 const char* kAccessibilityLoadedLastSessionPref = "accessibility.loadedInLastSession";
 
 static inline uint32_t
 PRTimeToSeconds(PRTime t_usec)
@@ -4765,35 +4766,46 @@ MultiprocessBlockPolicy() {
     if (difference > ONE_WEEK_IN_SECONDS || !a11yRunDate) {
       Preferences::ClearUser(kAccessibilityLastRunDatePref);
     } else {
       disabledForA11y = true;
     }
   }
 #endif // XP_WIN || XP_MACOSX
 
+  if (disabledForA11y) {
+    gMultiprocessBlockPolicy = kE10sDisabledForAccessibility;
+    return gMultiprocessBlockPolicy;
+  }
+
+  /**
+   * Avoids enabling e10s for Windows XP users on the release channel.
+   */
+#if defined(XP_WIN)
+  if (Preferences::GetDefaultCString("app.update.channel").EqualsLiteral("release") &&
+      !IsVistaOrLater()) {
+    gMultiprocessBlockPolicy = kE10sDisabledForOperatingSystem;
+    return gMultiprocessBlockPolicy;
+  }
+#endif
+
 #if defined(XP_WIN)
   /**
    * We block on Windows XP if layers acceleration is requested. This is due to
    * bug 1237769 where D3D9 and e10s behave badly together on XP.
    */
   bool layersAccelerationRequested = !Preferences::GetBool("layers.acceleration.disabled") ||
                                       Preferences::GetBool("layers.acceleration.force-enabled");
 
   if (layersAccelerationRequested && !IsVistaOrLater()) {
     gMultiprocessBlockPolicy = kE10sDisabledForXPAcceleration;
     return gMultiprocessBlockPolicy;
   }
 #endif // XP_WIN
 
-  if (disabledForA11y) {
-    gMultiprocessBlockPolicy = kE10sDisabledForAccessibility;
-    return gMultiprocessBlockPolicy;
-  }
-
   /**
    * Avoids enabling e10s for certain locales that require bidi selection,
    * which currently doesn't work well with e10s.
    */
   bool disabledForBidi = false;
 
   nsCOMPtr<nsIXULChromeRegistry> registry =
    mozilla::services::GetXULChromeRegistryService();
@@ -4801,18 +4813,16 @@ MultiprocessBlockPolicy() {
      registry->IsLocaleRTL(NS_LITERAL_CSTRING("global"), &disabledForBidi);
   }
 
   if (disabledForBidi) {
     gMultiprocessBlockPolicy = kE10sDisabledForBidi;
     return gMultiprocessBlockPolicy;
   }
 
-
-
   /*
    * None of the blocking policies matched, so e10s is allowed to run.
    * Cache the information and return 0, indicating success.
    */
   gMultiprocessBlockPolicy = 0;
   return 0;
 }