Bug 1406212 - Remove multiprocessBlockPolicy. r=Felipe draft
authorBlake Kaplan <mrbkap@gmail.com>
Thu, 12 Oct 2017 11:16:46 -0700
changeset 682786 54da187ad8b1df8474ecd9ffdaf86a527ac2fad3
parent 682785 3e714e0f619cc24fe840cc2c7e1d25b3f7a12083
child 682787 a5bf4207a0ec5ebaf3af24df800bb26cc6e063a9
push id85144
push userbmo:mrbkap@mozilla.com
push dateWed, 18 Oct 2017 18:39:48 +0000
reviewersFelipe
bugs1406212
milestone58.0a1
Bug 1406212 - Remove multiprocessBlockPolicy. r=Felipe MozReview-Commit-ID: F6P5fUPSc7L
toolkit/xre/nsAppRunner.cpp
toolkit/xre/nsAppRunner.h
xpcom/system/nsIXULRuntime.idl
--- a/toolkit/xre/nsAppRunner.cpp
+++ b/toolkit/xre/nsAppRunner.cpp
@@ -980,23 +980,16 @@ nsXULAppInfo::GetBrowserTabsRemoteAutost
 NS_IMETHODIMP
 nsXULAppInfo::GetMaxWebProcessCount(uint32_t* aResult)
 {
   *aResult = mozilla::GetMaxWebProcessCount();
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsXULAppInfo::GetMultiprocessBlockPolicy(uint32_t* aResult)
-{
-  *aResult = MultiprocessBlockPolicy();
-  return NS_OK;
-}
-
-NS_IMETHODIMP
 nsXULAppInfo::GetAccessibilityEnabled(bool* aResult)
 {
 #ifdef ACCESSIBILITY
   *aResult = GetAccService() != nullptr;
 #else
   *aResult = false;
 #endif
   return NS_OK;
@@ -5102,47 +5095,16 @@ enum {
   kE10sForceDisabled = 8,
   // kE10sDisabledForXPAcceleration = 9, removed in bug 1296353
   // kE10sDisabledForOperatingSystem = 10, removed due to xp-eol
 };
 
 const char* kForceEnableE10sPref = "browser.tabs.remote.force-enable";
 const char* kForceDisableE10sPref = "browser.tabs.remote.force-disable";
 
-uint32_t
-MultiprocessBlockPolicy()
-{
-  if (XRE_IsContentProcess()) {
-    // If we're in a content process, we're not blocked.
-    return 0;
-  }
-
-  /**
-   * Avoids enabling e10s if there are add-ons installed.
-   */
-  bool addonsCanDisable = Preferences::GetBool("extensions.e10sBlocksEnabling", false);
-  bool disabledByAddons = Preferences::GetBool("extensions.e10sBlockedByAddons", false);
-
-#ifdef MOZ_CRASHREPORTER
-  CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("AddonsShouldHaveBlockedE10s"),
-                                     disabledByAddons ? NS_LITERAL_CSTRING("1")
-                                                      : NS_LITERAL_CSTRING("0"));
-#endif
-
-  if (addonsCanDisable && disabledByAddons) {
-    return kE10sDisabledForAddons;
-  }
-
-  /*
-   * None of the blocking policies matched, so e10s is allowed to run. Return
-   * 0, indicating success.
-   */
-  return 0;
-}
-
 namespace mozilla {
 
 bool
 BrowserTabsRemoteAutostart()
 {
   if (gBrowserTabsRemoteAutostartInitialized) {
     return gBrowserTabsRemoteAutostart;
   }
@@ -5153,22 +5115,17 @@ BrowserTabsRemoteAutostart()
     gBrowserTabsRemoteAutostart = true;
     return gBrowserTabsRemoteAutostart;
   }
 
   bool optInPref = Preferences::GetBool("browser.tabs.remote.autostart", true);
   int status = kE10sEnabledByDefault;
 
   if (optInPref) {
-    uint32_t blockPolicy = MultiprocessBlockPolicy();
-    if (blockPolicy != 0) {
-      status = blockPolicy;
-    } else {
-      gBrowserTabsRemoteAutostart = true;
-    }
+    gBrowserTabsRemoteAutostart = true;
   } else {
     status = kE10sDisabledByUser;
   }
 
   // Uber override pref for manual testing purposes
   if (Preferences::GetBool(kForceEnableE10sPref, false)) {
     gBrowserTabsRemoteAutostart = true;
     status = kE10sEnabledByUser;
--- a/toolkit/xre/nsAppRunner.h
+++ b/toolkit/xre/nsAppRunner.h
@@ -124,20 +124,13 @@ const char* PlatformBuildID();
 } // namespace mozilla
 
 /**
  * Set up platform specific error handling such as suppressing DLL load dialog
  * and the JIT debugger on Windows, and install unix signal handlers.
  */
 void SetupErrorHandling(const char* progname);
 
-/**
- * A numeric value indicating whether multiprocess might be blocked.
- * Possible values can be found at nsAppRunner.cpp. A value of 0
- * represents not blocking.
- */
-uint32_t MultiprocessBlockPolicy();
-
 #ifdef MOZ_WIDGET_GTK
 const char* DetectDisplay();
 #endif
 
 #endif // nsAppRunner_h__
--- a/xpcom/system/nsIXULRuntime.idl
+++ b/xpcom/system/nsIXULRuntime.idl
@@ -115,23 +115,16 @@ interface nsIXULRuntime : nsISupports
 
   /**
    * The current e10s-multi experiment number. Set dom.ipc.multiOptOut to (at
    * least) this to disable it until the next experiment.
    */
   const uint32_t E10S_MULTI_EXPERIMENT = 1;
 
   /**
-   * A numeric value indicating whether multiprocess might be blocked.
-   * Possible values can be found at nsAppRunner.cpp. A value of 0
-   * represents not blocking.
-   */
-   readonly attribute unsigned long multiprocessBlockPolicy;
-
-  /**
    * If true, the accessibility service is running.
    */
   readonly attribute boolean accessibilityEnabled;
 
   /**
    * If true, the AccessibleHandler dll is used.
    */
   readonly attribute boolean accessibleHandlerUsed;