Closed Bug 862078 Opened 11 years ago Closed 11 years ago

Use an about:config preference to control multiprocess browsing

Categories

(Firefox :: Tabbed Browser, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 23

People

(Reporter: billm, Assigned: billm)

References

(Blocks 1 open bug)

Details

Attachments

(3 files, 2 obsolete files)

The purpose of this bug is to convert all the uses of MOZ_E10S_COMPAT from a preprocessor conditional to a regular preference. This way, people can test out multiprocess browsing using normal Firefox builds.
This patch adds a new global variable, gMultiProcessBrowser. It gets initialized at startup. This means you'll have to restart the browser after changing the preference. However, that's still much better than having to recompile.

In the two places where MOZ_E10S_COMPAT is used in all.js, I just used the normal defaults for non-e10s builds. People will have to change those prefs along with browser.tabs.remote if need be (although in fact, I think the situation with graphics and e10s is very much in flux, so this may not be an issue anymore).
Attachment #737702 - Flags: review?(felipc)
This patch adds checks for gMultiProcessBrowser in more places that are broken in e10s builds. I considered filing bugs for each hunk here, but it doesn't really seem worth it. It's easy to find these by grepping for gMultiProcessBrowser.
Attachment #737706 - Flags: review?(felipc)
Attached patch a few extra checks (obsolete) — Splinter Review
This patch is similar to the last one. It disables session restore for multiprocess browsing, and it also returns null for the securityUI.
Attachment #737707 - Flags: review?(felipc)
Comment on attachment 737706 [details] [diff] [review]
add more gMultiProcessBrowser checks

I don't like how this adds to the blame history for many critical code pieces.

In some cases this can be mitigated very easily, for instance:

>     // Replace initial page URIs with an empty string
>     // only if there's no opener (bug 370555).
>-    if (gInitialPages.indexOf(uri.spec) != -1)
>-      value = content.opener ? uri.spec : "";
>-    else
>+    if (gInitialPages.indexOf(uri.spec) != -1) {
>+      if (!gMultiProcessBrowser)
>+        value = content.opener ? uri.spec : "";
>+      else
>+        value = "";

value = !gMultiProcessBrowser && content.opener ? uri.spec : "";

>             _shouldShowProgress: function (aRequest) {
>               if (this.mBlank)
>                 return false;
> 
>               // Don't show progress indicators in tabs for about: URIs
>               // pointing to local resources.
>-              try {
>-                let channel = aRequest.QueryInterface(Ci.nsIChannel);
>-                if (channel.originalURI.schemeIs("about") &&
>-                    (channel.URI.schemeIs("jar") || channel.URI.schemeIs("file")))
>-                  return false;
>-              } catch (e) {}
>+              if (!gMultiProcessBrowser) {
>+                try {
>+                  let channel = aRequest.QueryInterface(Ci.nsIChannel);
>+                  if (channel.originalURI.schemeIs("about") &&
>+                      (channel.URI.schemeIs("jar") || channel.URI.schemeIs("file")))
>+                    return false;
>+                } catch (e) {}
>+              }
> 
>               return true;
>             },

if (gMultiProcessBrowser)
  return true;
OS: Linux → All
Hardware: x86_64 → All
Blocks: fxe10s
I took Dão's advice and tried to minimize the patch churn. Also, at Felipe's suggestion, I filed bugs on some of the bigger pieces that need to be fixed and commented about them.
Attachment #737706 - Attachment is obsolete: true
Attachment #737706 - Flags: review?(felipc)
Attachment #739364 - Flags: review?(felipc)
Felipe wanted me to rename _disabled to something that suggested it was disabled because of electrolysis.
Attachment #737707 - Attachment is obsolete: true
Attachment #737707 - Flags: review?(felipc)
Attachment #739365 - Flags: review?(felipc)
Comment on attachment 737702 [details] [diff] [review]
convert MOZ_E10S_COMPAT to gMultiProcessBrowser

Review of attachment 737702 [details] [diff] [review]:
-----------------------------------------------------------------

::: browser/base/content/browser.js
@@ +3995,5 @@
> +      // _hostChanged, otherwise onSecurityChange will short circuit.
> +      var securityUI = gBrowser.securityUI;
> +      this._hostChanged = true;
> +      this.onSecurityChange(null, null, securityUI.state);
> +    }

I guess you could also do a

if (gMultiProcessBrowser)
  return;

here
Attachment #737702 - Flags: review?(felipc) → review+
Comment on attachment 739364 [details] [diff] [review]
add more gMultiProcessBrowser checks, v2

Review of attachment 739364 [details] [diff] [review]:
-----------------------------------------------------------------

::: browser/base/content/browser.js
@@ +4167,5 @@
>  
>          this.status = "";
>          this.setDefaultStatus(msg);
>  
> +        if (!gMultiProcessBrowser) {

probably best to leave this item disabled for multiprocess, so you can add the !gMultiProcessBrowser condition in the if below instead of wrapping this block of code.
Same for the next block below

@@ +4406,5 @@
>        if (gURLBar)
>          gURLBar.removeAttribute("level");
>      }
>  
> +    if (!gMultiProcessBrowser) {

and I suppose a `if (gMultiProcessBrowser) return` will also avoid some churn here
Attachment #739364 - Flags: review?(felipc) → review+
Attachment #739365 - Flags: review?(felipc) → review+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: