On 11/17/2012 03:25 PM, Salvador de la Puente González wrote:
>
> It sounds like the system app somehow invokes the callback(s) which live
> in the child process.
>
> So it is possible. But how? Can someone clarify this, please?
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. This parent object then uses the
implementation of nsIAlertsService to show the notification. On b2g,
nsIAlertsService is implemented in b2g/components/AlertsService.js,
which relies on mozChromeEvent and mozContentEvent to communicate with
gaia. So when gaia notifies that you clicked on the notification,
shell.js gets the message, calls the matching notification observer in
the parent process, which is actually set up by the nsDektopNotification
parent implementation. Lastly, an IPC message is sent from the parent to
the matching child notification object to trigger the original JS callback.
So if the content process dies, we tear down all the matching
child/parent notification objects, and everything stops at the shell.js
level.
Hope this helps,
Fabrice
--
Fabrice Desré
b2g team
Mozilla Corporation
_______________________________________________
dev-b2g mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-b2g