2018-08-12 01:27:12 +03:00
|
|
|
/* vim: set ts=2 sw=2 sts=2 et tw=80: */
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
|
|
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This module implements logic for managing JavaScript actor instances bound to
|
|
|
|
* message managers. It handles lazily instantiating those actors based on
|
|
|
|
* DOM events, IPC messages, or observer notifications, and is meant to entirely
|
|
|
|
* replace the existing concept of frame scripts.
|
|
|
|
*
|
|
|
|
* All actors must be registered in the parent process, before the first child
|
|
|
|
* process starts. Once all actors have been registered, the actor data is
|
|
|
|
* mangled into a form which can be handled efficiently during content process
|
|
|
|
* startup, and shared with all content processes. Frame scripts in those
|
|
|
|
* content processes attach that data to frame message managers via
|
|
|
|
* ActorManagerChild, which handles instantiating and dispatching to those
|
|
|
|
* actors as necessary.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* Each actor is a class which lives in a JSM, and has a constructor which takes
|
|
|
|
* a single message manager argument. Each actor may conceptually have both
|
|
|
|
* 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
|
2019-05-01 23:05:06 +03:00
|
|
|
* appropriate. For instance, the AudioPlayback actor has a child instance named
|
|
|
|
* AudioPlaybackChild which lives in AudioPlaybackChild.jsm.
|
2018-08-12 01:27:12 +03:00
|
|
|
*
|
|
|
|
*
|
|
|
|
* Actors are defined by calling ActorManagerParent.addActors, with an object
|
|
|
|
* containing a property for each actor being defined, whose value is an object
|
|
|
|
* describing how the actor should be loaded. That object may have the following
|
|
|
|
* properties:
|
|
|
|
*
|
|
|
|
* - "child": The actor definition for the child side of the actor.
|
|
|
|
*
|
|
|
|
* Each "child" (or "parent", when it is implemented) actor definition may
|
|
|
|
* contain the following properties:
|
|
|
|
*
|
|
|
|
* - "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
|
2019-05-01 23:05:06 +03:00
|
|
|
* the given side. So, the child side of the AudioPlayback actor should live at
|
|
|
|
* "resource://gre/actors/AudioPlaybackChild.jsm".
|
2018-08-12 01:27:12 +03:00
|
|
|
*
|
|
|
|
* - "group": A group name which restricts the message managers to which this
|
|
|
|
* actor may be attached. This should match the "messagemanagergroup"
|
|
|
|
* attribute of a <browser> element. Frame scripts are responsible for
|
|
|
|
* attaching the appropriate actors to the appropriate browsers using
|
|
|
|
* ActorManagerChild.attach().
|
|
|
|
*
|
|
|
|
* - "events": An object containing a property for each event the actor will
|
|
|
|
* listen for, with an options object, as accepted by addEventListener, as its
|
|
|
|
* value. For each such property, an event listener will be added to the
|
|
|
|
* message manager[1] for the given event name, which delegates to the actor's
|
|
|
|
* handleEvent method.
|
|
|
|
*
|
|
|
|
* - "messages": An array of message manager message names. For each message
|
|
|
|
* name in the list, a message listener will be added to the frame message
|
|
|
|
* manager, and the messages it receives will be delegated to the actor's
|
|
|
|
* receiveMessage method.
|
|
|
|
*
|
|
|
|
* - "observers": An array of observer topics. A global observer will be added
|
|
|
|
* for each topic in the list, and observer notifications for it will be
|
|
|
|
* delegated to the actor's observe method. Note that observers are global in
|
|
|
|
* nature, and these notifications may therefore have nothing to do with the
|
|
|
|
* message manager the actor is bound to. The actor itself is responsible for
|
|
|
|
* filtering the notifications that apply to it.
|
|
|
|
*
|
|
|
|
* These observers are automatically unregistered when the message manager is
|
|
|
|
* destroyed.
|
|
|
|
*
|
|
|
|
* - "matches": An array of URL match patterns (as accepted by the MatchPattern
|
|
|
|
* class in MatchPattern.webidl) which restrict which pages the actor may be
|
|
|
|
* instantiated for. If this is defined, the actor will only receive DOM
|
|
|
|
* events sent to windows which match this pattern, and will only receive
|
|
|
|
* message manager messages for frame message managers which are currently
|
|
|
|
* hosting a matching DOM window.
|
|
|
|
*
|
2018-09-27 00:46:18 +03:00
|
|
|
* - "allFrames": this modifies its behavior to allow it to match sub-frames
|
|
|
|
* as well as top-level frames. If "allFrames" is not specified, it will
|
|
|
|
* match only top-level frames.
|
2018-08-12 01:27:12 +03:00
|
|
|
*
|
|
|
|
* - "matchAboutBlank": If "matches" is specified, this modifies its behavior to
|
2018-09-27 00:46:18 +03:00
|
|
|
* allow it to match about:blank pages. See MozDocumentMatcher.webidl for more
|
2018-08-12 01:27:12 +03:00
|
|
|
* information.
|
|
|
|
*
|
2018-09-27 00:46:18 +03:00
|
|
|
* [1]: For actors which specify "matches" or "allFrames", the listener will be
|
|
|
|
* added to the DOM window rather than the frame message manager.
|
|
|
|
*
|
|
|
|
* If Fission is being simulated, and an actor needs to receive events from
|
|
|
|
* sub-frames, it must use "allFrames".
|
2018-08-12 01:27:12 +03:00
|
|
|
*/
|
|
|
|
|
|
|
|
var EXPORTED_SYMBOLS = ["ActorManagerParent"];
|
|
|
|
|
2019-01-17 21:18:31 +03:00
|
|
|
const { ExtensionUtils } = ChromeUtils.import(
|
|
|
|
"resource://gre/modules/ExtensionUtils.jsm"
|
|
|
|
);
|
|
|
|
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
2018-08-12 01:27:12 +03:00
|
|
|
|
|
|
|
const { DefaultMap } = ExtensionUtils;
|
|
|
|
|
|
|
|
let ACTORS = {
|
2019-08-20 00:17:21 +03:00
|
|
|
AudioPlayback: {
|
|
|
|
parent: {
|
|
|
|
moduleURI: "resource://gre/actors/AudioPlaybackParent.jsm",
|
|
|
|
},
|
|
|
|
|
|
|
|
child: {
|
|
|
|
moduleURI: "resource://gre/actors/AudioPlaybackChild.jsm",
|
|
|
|
observers: ["audio-playback"],
|
|
|
|
},
|
|
|
|
|
|
|
|
allFrames: true,
|
|
|
|
},
|
|
|
|
|
2019-06-25 23:29:19 +03:00
|
|
|
Autoplay: {
|
|
|
|
parent: {
|
|
|
|
moduleURI: "resource://gre/actors/AutoplayParent.jsm",
|
|
|
|
},
|
|
|
|
|
|
|
|
child: {
|
|
|
|
moduleURI: "resource://gre/actors/AutoplayChild.jsm",
|
|
|
|
events: {
|
|
|
|
GloballyAutoplayBlocked: {},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
allFrames: true,
|
|
|
|
},
|
|
|
|
|
2019-05-30 22:01:29 +03:00
|
|
|
BrowserElement: {
|
|
|
|
parent: {
|
|
|
|
moduleURI: "resource://gre/actors/BrowserElementParent.jsm",
|
|
|
|
},
|
|
|
|
|
|
|
|
child: {
|
|
|
|
moduleURI: "resource://gre/actors/BrowserElementChild.jsm",
|
|
|
|
events: {
|
|
|
|
DOMWindowClose: {},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
allFrames: true,
|
|
|
|
},
|
2019-06-08 04:09:46 +03:00
|
|
|
|
2019-07-04 13:14:41 +03:00
|
|
|
DateTimePicker: {
|
|
|
|
parent: {
|
|
|
|
moduleURI: "resource://gre/actors/DateTimePickerParent.jsm",
|
|
|
|
},
|
|
|
|
|
|
|
|
child: {
|
|
|
|
moduleURI: "resource://gre/actors/DateTimePickerChild.jsm",
|
|
|
|
events: {
|
|
|
|
MozOpenDateTimePicker: {},
|
|
|
|
MozUpdateDateTimePicker: {},
|
|
|
|
MozCloseDateTimePicker: {},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
allFrames: true,
|
|
|
|
},
|
|
|
|
|
2019-06-08 04:09:46 +03:00
|
|
|
InlineSpellChecker: {
|
|
|
|
parent: {
|
|
|
|
moduleURI: "resource://gre/actors/InlineSpellCheckerParent.jsm",
|
|
|
|
},
|
|
|
|
|
|
|
|
child: {
|
|
|
|
moduleURI: "resource://gre/actors/InlineSpellCheckerChild.jsm",
|
|
|
|
},
|
|
|
|
|
|
|
|
allFrames: true,
|
|
|
|
},
|
2019-06-14 19:23:29 +03:00
|
|
|
|
|
|
|
Select: {
|
|
|
|
parent: {
|
|
|
|
moduleURI: "resource://gre/actors/SelectParent.jsm",
|
|
|
|
},
|
|
|
|
|
|
|
|
child: {
|
|
|
|
moduleURI: "resource://gre/actors/SelectChild.jsm",
|
|
|
|
events: {
|
|
|
|
mozshowdropdown: {},
|
|
|
|
"mozshowdropdown-sourcetouch": {},
|
|
|
|
mozhidedropdown: { mozSystemGroup: true },
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
allFrames: true,
|
|
|
|
},
|
2019-06-26 21:16:42 +03:00
|
|
|
|
|
|
|
Zoom: {
|
|
|
|
parent: {
|
|
|
|
moduleURI: "resource://gre/actors/ZoomParent.jsm",
|
|
|
|
},
|
|
|
|
child: {
|
|
|
|
moduleURI: "resource://gre/actors/ZoomChild.jsm",
|
|
|
|
events: {
|
|
|
|
FullZoomChange: {},
|
|
|
|
TextZoomChange: {},
|
|
|
|
ZoomChangeUsingMouseWheel: {},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
allFrames: true,
|
|
|
|
},
|
2019-07-04 13:14:41 +03:00
|
|
|
|
2019-07-31 18:09:59 +03:00
|
|
|
UAWidgets: {
|
2019-07-04 13:14:41 +03:00
|
|
|
child: {
|
2019-07-31 18:09:59 +03:00
|
|
|
moduleURI: "resource://gre/actors/UAWidgetsChild.jsm",
|
2019-07-04 13:14:41 +03:00
|
|
|
events: {
|
|
|
|
UAWidgetSetupOrChange: {},
|
|
|
|
UAWidgetTeardown: {},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
allFrames: true,
|
|
|
|
},
|
2019-05-01 23:05:06 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
let LEGACY_ACTORS = {
|
2018-07-30 20:52:29 +03:00
|
|
|
Controllers: {
|
|
|
|
child: {
|
|
|
|
module: "resource://gre/actors/ControllersChild.jsm",
|
|
|
|
messages: ["ControllerCommands:Do", "ControllerCommands:DoWithParams"],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
2018-07-30 07:44:48 +03:00
|
|
|
ExtFind: {
|
|
|
|
child: {
|
|
|
|
module: "resource://gre/actors/ExtFindChild.jsm",
|
|
|
|
messages: [
|
|
|
|
"ext-Finder:CollectResults",
|
|
|
|
"ext-Finder:HighlightResults",
|
|
|
|
"ext-Finder:clearHighlighting",
|
2018-08-31 08:59:17 +03:00
|
|
|
],
|
2018-07-30 07:44:48 +03:00
|
|
|
},
|
|
|
|
},
|
|
|
|
|
2018-07-30 07:38:21 +03:00
|
|
|
FindBar: {
|
|
|
|
child: {
|
|
|
|
module: "resource://gre/actors/FindBarChild.jsm",
|
|
|
|
events: {
|
|
|
|
keypress: { mozSystemGroup: true },
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2018-07-30 07:59:16 +03:00
|
|
|
|
2018-07-30 22:25:58 +03:00
|
|
|
Finder: {
|
|
|
|
child: {
|
|
|
|
module: "resource://gre/actors/FinderChild.jsm",
|
|
|
|
messages: ["Finder:Initialize"],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
2019-02-23 03:24:52 +03:00
|
|
|
FormSubmit: {
|
|
|
|
child: {
|
|
|
|
module: "resource://gre/actors/FormSubmitChild.jsm",
|
|
|
|
allFrames: true,
|
|
|
|
events: {
|
|
|
|
DOMFormBeforeSubmit: {},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
Bug 1514940 - part 1: Forcibly disable new keyCode/charCode value of keypress events if the document is Confluence r=smaug,Ehsan,kmag
Old Confluence does not aware of conflated model keypress event (see UI Events
spec, https://w3c.github.io/uievents/#determine-keypress-keyCode).
Additionally, Confluence can be hosted with any domains. Therefore, we cannot
use blacklist to disable the conflated model keypress event only on it.
This patch checks whether current or parent document is Confluence with JS
module, called KeyPressEventModelCheckerChild. For kicking this module,
nsHTMLDocument dispatches an custom event, CheckKeyPressEventModel, when it
becomes editable only first time. Finally, if it's a Confluence instance, the
module let PresShell know that we need to use split model keypress event in it.
Differential Revision: https://phabricator.services.mozilla.com/D17907
--HG--
extra : moz-landing-system : lando
2019-02-05 14:35:43 +03:00
|
|
|
KeyPressEventModelChecker: {
|
|
|
|
child: {
|
|
|
|
module: "resource://gre/actors/KeyPressEventModelCheckerChild.jsm",
|
|
|
|
events: {
|
|
|
|
CheckKeyPressEventModel: { capture: true, mozSystemGroup: true },
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
2018-07-30 21:39:52 +03:00
|
|
|
ManifestMessages: {
|
|
|
|
child: {
|
|
|
|
module: "resource://gre/modules/ManifestMessagesChild.jsm",
|
|
|
|
messages: [
|
|
|
|
"DOM:Manifest:FireAppInstalledEvent",
|
|
|
|
"DOM:ManifestObtainer:Obtain",
|
|
|
|
"DOM:WebManifest:fetchIcon",
|
|
|
|
"DOM:WebManifest:hasManifestLink",
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
2019-03-21 16:58:17 +03:00
|
|
|
PictureInPicture: {
|
|
|
|
child: {
|
|
|
|
module: "resource://gre/actors/PictureInPictureChild.jsm",
|
|
|
|
events: {
|
|
|
|
MozTogglePictureInPicture: { capture: true },
|
|
|
|
},
|
|
|
|
|
|
|
|
messages: [
|
|
|
|
"PictureInPicture:SetupPlayer",
|
2019-04-04 22:04:47 +03:00
|
|
|
"PictureInPicture:Play",
|
|
|
|
"PictureInPicture:Pause",
|
2019-09-05 20:40:02 +03:00
|
|
|
"PictureInPicture:KeyToggle",
|
2019-03-21 16:58:17 +03:00
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
2019-04-05 18:51:58 +03:00
|
|
|
PictureInPictureToggle: {
|
|
|
|
child: {
|
|
|
|
allFrames: true,
|
|
|
|
module: "resource://gre/actors/PictureInPictureChild.jsm",
|
|
|
|
events: {
|
2019-09-05 00:06:26 +03:00
|
|
|
UAWidgetSetupOrChange: {},
|
2019-08-13 21:29:29 +03:00
|
|
|
contextmenu: { capture: true },
|
2019-04-05 18:51:58 +03:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
2018-07-30 09:31:39 +03:00
|
|
|
PopupBlocking: {
|
|
|
|
child: {
|
|
|
|
module: "resource://gre/actors/PopupBlockingChild.jsm",
|
|
|
|
events: {
|
|
|
|
DOMPopupBlocked: { capture: true },
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
2018-07-30 08:05:14 +03:00
|
|
|
Printing: {
|
|
|
|
child: {
|
|
|
|
module: "resource://gre/actors/PrintingChild.jsm",
|
|
|
|
events: {
|
|
|
|
PrintingError: { capture: true },
|
|
|
|
printPreviewUpdate: { capture: true },
|
|
|
|
},
|
|
|
|
messages: [
|
|
|
|
"Printing:Preview:Enter",
|
|
|
|
"Printing:Preview:Exit",
|
|
|
|
"Printing:Preview:Navigate",
|
|
|
|
"Printing:Preview:ParseDocument",
|
|
|
|
"Printing:Print",
|
2018-07-30 20:14:12 +03:00
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
PurgeSessionHistory: {
|
|
|
|
child: {
|
|
|
|
module: "resource://gre/actors/PurgeSessionHistoryChild.jsm",
|
|
|
|
messages: ["Browser:PurgeSessionHistory"],
|
2018-07-30 08:05:14 +03:00
|
|
|
},
|
|
|
|
},
|
|
|
|
|
2018-07-30 09:28:10 +03:00
|
|
|
SelectionSource: {
|
|
|
|
child: {
|
|
|
|
module: "resource://gre/actors/SelectionSourceChild.jsm",
|
|
|
|
messages: ["ViewSource:GetSelection"],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
2018-07-30 08:25:48 +03:00
|
|
|
Thumbnails: {
|
|
|
|
child: {
|
|
|
|
module: "resource://gre/actors/ThumbnailsChild.jsm",
|
|
|
|
messages: [
|
|
|
|
"Browser:Thumbnail:Request",
|
|
|
|
"Browser:Thumbnail:CheckState",
|
|
|
|
"Browser:Thumbnail:GetOriginalURL",
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
2018-07-30 20:11:41 +03:00
|
|
|
UnselectedTabHover: {
|
|
|
|
child: {
|
|
|
|
module: "resource://gre/actors/UnselectedTabHoverChild.jsm",
|
|
|
|
events: {
|
|
|
|
"UnselectedTabHover:Enable": {},
|
|
|
|
"UnselectedTabHover:Disable": {},
|
|
|
|
},
|
|
|
|
messages: ["Browser:UnselectedTabHover"],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
2018-07-30 09:36:12 +03:00
|
|
|
WebChannel: {
|
|
|
|
child: {
|
|
|
|
module: "resource://gre/actors/WebChannelChild.jsm",
|
|
|
|
events: {
|
|
|
|
WebChannelMessageToChrome: { capture: true, wantUntrusted: true },
|
|
|
|
},
|
|
|
|
messages: ["WebChannelMessageToContent"],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
2018-07-30 22:55:22 +03:00
|
|
|
WebNavigation: {
|
|
|
|
child: {
|
|
|
|
module: "resource://gre/actors/WebNavigationChild.jsm",
|
|
|
|
messages: [
|
|
|
|
"WebNavigation:GoBack",
|
|
|
|
"WebNavigation:GoForward",
|
|
|
|
"WebNavigation:GotoIndex",
|
|
|
|
"WebNavigation:LoadURI",
|
|
|
|
"WebNavigation:Reload",
|
|
|
|
"WebNavigation:SetOriginAttributes",
|
|
|
|
"WebNavigation:Stop",
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
2018-08-12 01:27:12 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
class ActorSet {
|
|
|
|
constructor(group, actorSide) {
|
|
|
|
this.group = group;
|
|
|
|
this.actorSide = actorSide;
|
|
|
|
|
|
|
|
this.actors = new Map();
|
|
|
|
this.events = [];
|
|
|
|
this.messages = new DefaultMap(() => []);
|
|
|
|
this.observers = new DefaultMap(() => []);
|
|
|
|
}
|
|
|
|
|
|
|
|
addActor(actorName, actor) {
|
|
|
|
actorName += this.actorSide;
|
|
|
|
this.actors.set(actorName, { module: actor.module });
|
|
|
|
|
|
|
|
if (actor.events) {
|
|
|
|
for (let [event, options] of Object.entries(actor.events)) {
|
|
|
|
this.events.push({ actor: actorName, event, options });
|
|
|
|
}
|
|
|
|
}
|
|
|
|
for (let msg of actor.messages || []) {
|
|
|
|
this.messages.get(msg).push(actorName);
|
|
|
|
}
|
|
|
|
for (let topic of actor.observers || []) {
|
|
|
|
this.observers.get(topic).push(actorName);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
const { sharedData } = Services.ppmm;
|
|
|
|
|
|
|
|
var ActorManagerParent = {
|
|
|
|
// Actor sets which should be loaded in the child side, keyed by
|
|
|
|
// "messagemanagergroup".
|
|
|
|
childGroups: new DefaultMap(group => new ActorSet(group, "Child")),
|
|
|
|
// Actor sets which should be loaded in the parent side, keyed by
|
|
|
|
// "messagemanagergroup".
|
|
|
|
parentGroups: new DefaultMap(group => new ActorSet(group, "Parent")),
|
|
|
|
|
|
|
|
// Singleton actor sets, which should be loaded only for documents which match
|
|
|
|
// a specific pattern. The keys in this map are plain objects specifying
|
|
|
|
// filter keys as understood by MozDocumentMatcher.
|
|
|
|
singletons: new DefaultMap(() => new ActorSet(null, "Child")),
|
|
|
|
|
|
|
|
addActors(actors) {
|
2019-05-01 23:05:06 +03:00
|
|
|
for (let [actorName, actor] of Object.entries(actors)) {
|
|
|
|
ChromeUtils.registerWindowActor(actorName, actor);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
addLegacyActors(actors) {
|
2018-08-12 01:27:12 +03:00
|
|
|
for (let [actorName, actor] of Object.entries(actors)) {
|
|
|
|
let { child } = actor;
|
|
|
|
{
|
|
|
|
let actorSet;
|
2018-09-27 00:46:18 +03:00
|
|
|
if (child.matches || child.allFrames) {
|
|
|
|
actorSet = this.singletons.get({
|
|
|
|
matches: child.matches || ["<all_urls>"],
|
2018-08-12 01:27:12 +03:00
|
|
|
allFrames: child.allFrames,
|
|
|
|
matchAboutBlank: child.matchAboutBlank,
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
actorSet = this.childGroups.get(child.group || null);
|
|
|
|
}
|
|
|
|
|
|
|
|
actorSet.addActor(actorName, child);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (actor.parent) {
|
|
|
|
let { parent } = actor;
|
|
|
|
this.parentGroups.get(parent.group || null).addActor(actorName, parent);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Serializes the current set of registered actors into ppmm.sharedData, for
|
|
|
|
* use by ActorManagerChild. This must be called before any frame message
|
|
|
|
* managers have been created. It will have no effect on existing message
|
|
|
|
* managers.
|
|
|
|
*/
|
|
|
|
flush() {
|
|
|
|
for (let [name, data] of this.childGroups) {
|
|
|
|
sharedData.set(`ChildActors:${name || ""}`, data);
|
|
|
|
}
|
|
|
|
sharedData.set("ChildSingletonActors", this.singletons);
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
ActorManagerParent.addActors(ACTORS);
|
2019-05-01 23:05:06 +03:00
|
|
|
ActorManagerParent.addLegacyActors(LEGACY_ACTORS);
|