Embedding/IPCLiteAPI: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 29: Line 29:
== Build instructions: ==
== Build instructions: ==
<pre>
<pre>
hg clone http://hg.mozilla.org/users/romaxa_gmail.com/mozilla_ipcembed
hg clone http://hg.mozilla.org/mozilla-central
cd mozilla_ipcembed
cd mozilla-central
cd .hg
hg clone http://hg.mozilla.org/users/romaxa_gmail.com/embedipc_queue .hg/patches
hg clone http://hg.mozilla.org/users/romaxa_gmail.com/embedipc_queue patches
hg update `cat .hg/patches/changeset`
cd ..
hg update -C embedipc
hg qpush -a
hg qpush -a
cp .hg/patches/mozconfig.gtkdesktop  mozconfig
cp .hg/patches/mozconfig.gtkdesktop  mozconfig
# or
# or

Revision as of 08:07, 11 February 2012

Lite-weight Embedding IPC API for Mozilla based applications with native UI.

Basic architecture is very close to WebKit2, and MicroB

Benefits of new architecture comparing to default mozilla embedding:

* No XUL/XPCOM heavy content in UI process (Best memory footprint, fast startup)
* IPC use current Mozilla Chromium/IPDL implementation (mostly tested with current FF/Mobile)
* Rendering based on Shadow/Shadowable layers tree (same as content rendering in XUL Mobile FF)
* IPC provide ability to load memory greedy content in child process and kill it without increasing memory usage for Main UI application process

New embedding expected initialization sequence

1. Native UI startup (android UI thread view or Gtk/Qt event loop)
2. Create XRE_InitIPCEmbedding
3. Chromium message loop started
  a) Child process created and IPDL channel established
4. Create embed view using embedding API
  a) TabParent/Child, DOMWindow initialization
  b) PLayers protocol created
6. Render data from UI process LayerManager (SW/HW rendering) to Native UI GC.
7. Load content in remote view (HTML, XUL)

Communication between UI and content process

* Load remote content JS (privileged script with full access) and interact using MessageMessenger (send/receive JSON messages)
* Use embed messaging API (observe broadcast messages)
* Build Application specific IPC serialization library, load XPCOM component in child process linked with this IPC library.

Source code path queue

BMO Bug 713681

Build instructions:

hg clone http://hg.mozilla.org/mozilla-central
cd mozilla-central
hg clone http://hg.mozilla.org/users/romaxa_gmail.com/embedipc_queue .hg/patches
hg update `cat .hg/patches/changeset`
hg qpush -a

cp .hg/patches/mozconfig.gtkdesktop  mozconfig
# or
# cp .hg/patches/mozconfig.qtdesktop mozconfig
MOZCONFIG=$(pwd)/mozconfig make -f client.mk build_all

Pre compiled binaries:

Builds: Qt-Desktop, N9, and BeagleBoard ubuntu available here: http://romaxa.info/fennec/IPCEmbedding

Run test examples:

cd obj-build/dist/bin
./testCoreEmbedXul
or GRE_HOME=xul-distpath ./testCoreEmbedXul
 this works for GTK and Qt port.

Qt only, qml based UI with scrolling and zooming (no clicks):
MOZ_QT_GRAPHICSSYSTEM=raster ./qtMozQmlEmbed -graphicssystem raster -url slashdot.org

raster is needed in order to optimize rendering and avoid X usage.
on egl system like Maemo/Beagleboard export MOZ_ACCELERATED=1 and (also require setViewport(new QGLWidget()))

On desktop GLX accelerated rendering does not work, need to teach GLX backend use Qt GL context

Basic view of new architecture:

EmbedIPC-basic.png