Closed Bug 1579440 Opened 5 years ago Closed 4 years ago

Geckoview confuses libxul / gecko about whether multiprocess mode is on/available [browser.tabs.remote.autostart]

Categories

(GeckoView :: General, defect, P2)

Unspecified
All

Tracking

(firefox74 fixed)

RESOLVED FIXED
mozilla74
Tracking Status
firefox74 --- fixed

People

(Reporter: Gijs, Assigned: agi)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Broadly, libxul/gecko code uses 3 things to determine whether multiprocess/e10s is available and/or in use:

  1. are we in a non-parent/default process? If so, excellent, obviously we're in multiprocess mode
  2. does BrowserTabsRemoteAutostart() return true?
  3. does XRE_IsE10sParentProcess() return true?

Both 2 and 3 (so basically, any determination about multiprocessing made in the parent/default process) are primarily informed by the browser.tabs.remote.autostart pref, which is set to false in all.js, and set to true in desktop's firefox.js and then meddled with by a bunch of tests etc.

As best I can tell, this pref is always false in geckoview, and as a result, callers of either BrowserTabsRemoteAutostart() or XRE_IsE10sParentProcess() will believe we're in non-e10s mode.

In geckoview's androidtest, whether we're using multiprocess mode is stored in https://searchfox.org/mozilla-central/source/mobile/android/geckoview/src/androidTest/java/org/mozilla/geckoview/test/util/Environment.java#41-45
Geckoview's example code has https://searchfox.org/mozilla-central/source/mobile/android/geckoview_example/src/main/java/org/mozilla/geckoview_example/GeckoViewActivity.java#147 . It's not clear to me if/how the two relate, and what the role of https://searchfox.org/mozilla-central/source/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoSessionSettings.java#290 is. From what I've seen in presentations, geckoview does not materially support not running in multiprocess mode.

None of the geckoview settings are used for any of the decisions made by libxul.

It's not 100% clear to me what the full list of consequences are. When changing just XRE_IsE10sParentProcess() to return true on non-fennec android both generated a bunch of unexpected passes in web-platform tests, and crashes in geckoview-junit tests (apparently because we then try and start the networking socket process, which somehow makes the test unhappy - unsure why). I expect "fixing" BrowserTabsRemoteAutostart would generate even more improvements/challenges. :-)

I suspect addressing this will become more and more important and more and more gnarly as time goes on and geckoview's featureset expands. I think this needs the attention of someone who knows geckoview a lot better than me and can straighten out the relationship between geckoview's concept of multiprocess mode, and gecko's. I expect some of the callsites for the 2 utility functions may need auditing to ensure that we don't erroneously make assumptions that won't hold for geckoview/android.

(Apologies, meant to CC folks as I filed but I accidentally lost the CC field - please see comment #0. )

GeckoView supports e10s, and it is the default configuration. It is enabled (or disabled) on a per-session (tab) basis via GeckoSessionSettings. This setting is used here[0] to determine remoteness and remote type of the <browser>.

It does look like we want XRE_IsE10sParentProcess() to return true under GV. We probably just need to clean up the fallout from that (disable the socket process or fix it, etc).

https://searchfox.org/mozilla-central/rev/05db7b82d5a4adaa8b36ec6f4fd1715f6fd7885b/mobile/android/chrome/geckoview/geckoview.js#123

James says we should probably fix this before e10s-multi.

Assignee: nobody → snorp
Rank: 33
Priority: -- → P2
Summary: Geckoview confuses libxul / gecko about whether multiprocess mode is on/available → Geckoview confuses libxul / gecko about whether multiprocess mode is on/available [browser.tabs.remote.autostart]
Assignee: snorp → agi
Pushed by asferro@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/5261ea86fa26
Set browser.tabs.remote.autostart to true everywhere. r=snorp
Attachment #9121674 - Attachment description: Bug 1579440 - Set browser.tabs.remote.autostart to true everywhere. → Bug 1579440 - Set browser.tabs.remote.autostart to true for geckoview.
Pushed by asferro@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/5ed6fc2b4997
Set browser.tabs.remote.autostart to true for geckoview. r=snorp
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla74
Flags: needinfo?(agi)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: