Hello guys
Related with this bug [1] in Bugzilla, I was trying to understand how
function references are shared between processes.
[1] https://bugzilla.mozilla.org/show_bug.cgi?id=801351#c65
Imagine this situation, I have MyApp process and System process running
on the device. Then I use the notification API:
MyApp:
function makeNotification() {
var closureVar = 42;
var notification =
navigator.mozNotification.createNotification("Hello there!", "Nothing to
say...");
notification.onclick = function () {
console.log('the answer to life, the universe and everything: ' +
closureVar)
};
notification.show();
}
So when calling makeNotification, an event is dispatched to Gaia system
with the notification's details. System actually creates the
notification visual element and put it on the notification area. This is
happening in the context of the system which is different from the
context of MyApp but when the user taps on the notification, the onclick
callback is called and executed... where? in MyApp context? I think so,
because if you close the application the callback is lost.
So, at low level, what is a reference to an object? Does the reference
include information about the process which the object pointed belongs
to? How an object is dereferenced?
Thanks for the info
________________________________
Este mensaje se dirige exclusivamente a su destinatario. Puede consultar
nuestra política de envío y recepción de correo electrónico en el enlace
situado más abajo.
This message is intended exclusively for its addressee. We only send and
receive email on the basis of the terms set out at:
http://www.tid.es/ES/PAGINAS/disclaimer.aspx
_______________________________________________
dev-b2g mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-b2g