Embedding/IPCLiteAPI: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
Line 1: Line 1:
== Lite-weight Embedding IPC API for Mozilla based applications with native UI. ==
== Lite-weight Embedding API for Mozilla based applications with native UI. ==
<p>Basic architecture is very close to [http://trac.webkit.org/wiki/WebKit2 WebKit2], and [http://browser.garage.maemo.org/docs/browser_paper.html MicroB]
<p>Basic architecture is very close to [http://trac.webkit.org/wiki/WebKit2 WebKit2], and [http://browser.garage.maemo.org/docs/browser_paper.html MicroB]
</p><p>Benefits of new architecture comparing to default [https://wiki.mozilla.org/Embedding/NewApi mozilla embedding]:</p>
</p><p>Benefits of new architecture comparing to default [https://wiki.mozilla.org/Embedding/NewApi mozilla embedding]:</p>
<pre class="_fck_mw_lspace">* No XUL/XPCOM heavy content in UI process (Best memory footprint, fast startup)
<pre class="_fck_mw_lspace">* No XUL/XPCOM heavy content in UI process/Thread (Best memory footprint (process case), fast startup)
* IPC use current Mozilla Chromium/IPDL implementation (mostly tested with current FF/Mobile)
* Process/Thread communication between UI and Content(Gecko/XPCOM) Thread/Process - built on current Mozilla Chromium/IPDL implementation ([https://developer.mozilla.org/en-US/docs/IPDL/Tutorial IPDL Tutorial])
* Rendering based on Shadow/Shadowable layers tree (same as content rendering in XUL Mobile FF)
* Rendering based on Shadow/Shadowable layers tree which provide MultiThread/Process responsive rendering (same as content rendering in XUL Mobile FF/OMTC Android Firefox/Firefox OS)
* IPC provide ability to load memory greedy content in child process and kill it without increasing memory usage for Main UI application process
* Multi process model provide ability to load memory greedy content in child process and kill it without increasing memory usage for Main UI application process
</pre>
</pre>



Revision as of 01:03, 16 January 2013

Lite-weight Embedding 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/Thread (Best memory footprint (process case), fast startup)
* Process/Thread communication between UI and Content(Gecko/XPCOM) Thread/Process - built on current Mozilla Chromium/IPDL implementation ([https://developer.mozilla.org/en-US/docs/IPDL/Tutorial IPDL Tutorial])
* Rendering based on Shadow/Shadowable layers tree which provide MultiThread/Process responsive rendering (same as content rendering in XUL Mobile FF/OMTC Android Firefox/Firefox OS)
* Multi process model 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:

git clone git://github.com/romaxa/mozilla-central.git
cd mozilla-central
git checkout embedlite

cp embedding/embedlite/config/mozconfig.gtkdesktop  mozconfig
# or
# for harmattan
# cp embedding/embedlite/config/mozconfig.qtN9-qt mozconfig
MOZCONFIG=$(pwd)/mozconfig make -f client.mk build_all

Pre compiled binaries:

Mer (ARMv7 hardfp)

http://romaxa.info/mer/mozbuild.tar.gz

Harmattan

http://romaxa.info/mer/mozbuildhm.tar.gz

Qt-Desktop and BeagleBoard Ubuntu

http://romaxa.info/fennec/IPCEmbedding/

Run test examples:

cd obj-*/dist/bin

Basic core test
./embedLiteCoreInitTest

EmbedLiteAPI wrapped into qt/qml widget
Qt only, qml based UI with scrolling and zooming (no clicks):
./qmlMozEmbedTest -url linux.org.ru

Basic view of new architecture:

EmbedIPC-basic.png