Changes

Jump to: navigation, search

Gecko:Overview

208 bytes added, 02:48, 15 September 2017
Update IPC description
To be written (and maybe rewritten if we get an IPC embedding API).
 
[[File:WebNavigationE10S.png|thumb|500px|<xul:remote-browser>, frameloader and docshell in multiprocess configuration. The horizontal dash-lines represent inter-process communication]]
=== Multi-process and IPC ===
 
[[File:WebNavigationE10S.png|thumb|500px|<xul:remote-browser>, frameloader and docshell in multiprocess configuration. The horizontal dash-lines represent inter-process communication]]
In a multi-process desktop Firefox, a tab is managed by <code>[https://dxr.mozilla.org/mozilla-central/source/toolkit/content/widgets/remote-browser.xml <xul:remote-browser>]</code>. It still operates on nsIWebNavigation, but in this case the docshell is in a remote process and can not be accessed directly. The encapsulation of remote nsIWebNavigation is done by the javascript-implemented <code>[https://dxr.mozilla.org/mozilla-central/source/toolkit/components/remotebrowserutils/RemoteWebNavigation.js RemoteWebNavigation]</code>.
In this configuration, the frameloader of a root docshell lives in parent process, so it can not access docshell directly either. Instead, it holds a <code>[https://dxr.mozilla.org/mozilla-central/source/dom/ipc/TabParent.h TabParent]</code> instance to interact with <code>[https://dxr.mozilla.org/mozilla-central/source/dom/ipc/TabChild.h TabChild]</code> in child-process. At C/C++ level, the communication across processes for a single tab is through the '''PBrowser''' IPC protocol implemented by TabParent and TabChild, while at the javascript level it's done by '''message manager''' (which is ontop of PBrowser). RemoteWebNavigation, for example, sends messages to <code>[https://dxr.mozilla.org/mozilla-central/source/toolkit/content/browser-child.js browser-child.js]</code> in content process through message manager.
== Networking ==
61
edits

Navigation menu