Commit b64aa8e8 authored by Mike Conley's avatar Mike Conley
Browse files

Bug 1533955 - Move the current message manager actors to a legacy list, and...

Bug 1533955 - Move the current message manager actors to a legacy list, and create a new list of JS Window Actors. r=NeilDeakin

Differential Revision: https://phabricator.services.mozilla.com/D29237

--HG--
extra : moz-landing-system : lando
parent a51a8650
......@@ -16,6 +16,9 @@ ChromeUtils.defineModuleGetter(this, "ActorManagerParent",
const PREF_PDFJS_ENABLED_CACHE_STATE = "pdfjs.enabledCache.state";
let ACTORS = {
};
let LEGACY_ACTORS = {
AboutReader: {
child: {
module: "resource:///actors/AboutReaderChild.jsm",
......@@ -942,6 +945,7 @@ BrowserGlue.prototype = {
os.addObserver(this, "shield-init-complete");
ActorManagerParent.addActors(ACTORS);
ActorManagerParent.addLegacyActors(LEGACY_ACTORS);
ActorManagerParent.flush();
this._flashHangCount = 0;
......
......@@ -24,8 +24,8 @@
* Child and Parent variants, but only Child variants are currently implemented.
* The parent and child variants live in separate JSMs, and have separate class
* names, each of which have Child or Parent appended to their names, as
* appropriate. For instance, the Browser actor has a child instance named
* BrowserChild which lives in BrowserChild.jsm.
* appropriate. For instance, the AudioPlayback actor has a child instance named
* AudioPlaybackChild which lives in AudioPlaybackChild.jsm.
*
*
* Actors are defined by calling ActorManagerParent.addActors, with an object
......@@ -41,8 +41,8 @@
* - "module": The URI from which the modules is loaded. This should be a
* resource: URI, ideally beginning with "resource://gre/actors/" or
* "resource:///actors/", with a filename matching the name of the actor for
* the given side. So, the child side of the Browser actor should live at
* "resource://gre/actors/BrowserChild.jsm".
* the given side. So, the child side of the AudioPlayback actor should live at
* "resource://gre/actors/AudioPlaybackChild.jsm".
*
* - "group": A group name which restricts the message managers to which this
* actor may be attached. This should match the "messagemanagergroup"
......@@ -101,6 +101,9 @@ const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
const {DefaultMap} = ExtensionUtils;
let ACTORS = {
};
let LEGACY_ACTORS = {
AudioPlayback: {
child: {
module: "resource://gre/actors/AudioPlaybackChild.jsm",
......@@ -417,6 +420,12 @@ var ActorManagerParent = {
singletons: new DefaultMap(() => new ActorSet(null, "Child")),
addActors(actors) {
for (let [actorName, actor] of Object.entries(actors)) {
ChromeUtils.registerWindowActor(actorName, actor);
}
},
addLegacyActors(actors) {
for (let [actorName, actor] of Object.entries(actors)) {
let {child} = actor;
{
......@@ -455,3 +464,4 @@ var ActorManagerParent = {
};
ActorManagerParent.addActors(ACTORS);
ActorManagerParent.addLegacyActors(LEGACY_ACTORS);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment