зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1543098 - Implement Runtime.executionContextDestroyed. r=ato
Differential Revision: https://phabricator.services.mozilla.com/D27524 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
d19d0f5a17
Коммит
518602fb41
|
@ -27,6 +27,8 @@ class Runtime extends ContentProcessDomain {
|
|||
this.chromeEventHandler.addEventListener("DOMWindowCreated", this,
|
||||
{mozSystemGroup: true});
|
||||
|
||||
Services.obs.addObserver(this, "inner-window-destroyed");
|
||||
|
||||
// Spin the event loop in order to send the `executionContextCreated` event right
|
||||
// after we replied to `enable` request.
|
||||
Services.tm.dispatchToMainThread(() => {
|
||||
|
@ -50,6 +52,7 @@ class Runtime extends ContentProcessDomain {
|
|||
this.enabled = false;
|
||||
this.chromeEventHandler.removeEventListener("DOMWindowCreated", this,
|
||||
{mozSystemGroup: true});
|
||||
Services.obs.removeObserver(this, "inner-window-destroyed");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -70,4 +73,11 @@ class Runtime extends ContentProcessDomain {
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
observe(subject, topic, data) {
|
||||
const innerWindowID = subject.QueryInterface(Ci.nsISupportsPRUint64).data;
|
||||
this.emit("Runtime.executionContextDestroyed", {
|
||||
executionContextId: innerWindowID,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче