On 11/17/2012 05:38 PM, Salvador de la Puente González wrote:
> Hello Fabrice
>
> First, thank you very much for the explanation.
>
> Now...
>
> On 18/11/12 02:10, Fabrice Desre wrote:
>> Here's how the mozNotification API works : when you call
>> mozNotifications.createNotification(), an object is created in the
>> content process. This objects sends an IPC message to create a "dual"
>> object in the parent (chrome) process.
> So what kind of IPC are you using? Binder?
We're reusing chromium IPC layer. This has no android dependencies, any
gecko-based project can use that.
> And, another question, is the dual object a replication of the original
> object or some kind of proxy object? Or maybe the object is put on
> shared memory? I suppose it is some of the latter options because deeply
> cloning the complete object would lead to a huge memory waste on the
> parent process, more if the callback is a very nested closure with a lot
> of references to other content process' objects.
There's no rule, but usually we don't need to copy all of the object
state. For instance there's no value cloning js callbacks from the child
to the parent. What's important is to have a way for child side and
parent side to exchange messages. We have an IDL language (called IPDL)
to describe these messages when implementing in c++.
> It is great to see there is already a way to communicate data between
> Gonk processes. I though this was technically impossible (for Gonk) at
> present time.
All this was build a few years ago and first used in the XUL version of
Fennec.
Fabrice
--
Fabrice Desré
b2g team
Mozilla Corporation
_______________________________________________
dev-b2g mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-b2g