61
edits
Freesamael (talk | contribs) (Move image to right) |
Freesamael (talk | contribs) (Update IPC description) |
||
| Line 61: | Line 61: | ||
To be written (and maybe rewritten if we get an IPC embedding API). | 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 === | === Multi-process and IPC === | ||
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 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). | 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 == | == Networking == | ||
edits