1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
8 * An actor architecture designed to allow compositional parent/content
9 * communications. The lifetime of a JSProcessActor{Child, Parent} is the `ContentParent`
10 * (for the parent-side) / `ContentChild` (for the child-side).
13 interface nsISupports;
16 * Base class for parent-side actor.
18 [ChromeOnly, Exposed=Window]
19 interface JSProcessActorParent {
23 readonly attribute nsIDOMProcessParent manager;
25 JSProcessActorParent includes JSActor;
27 [ChromeOnly, Exposed=Window]
28 interface JSProcessActorChild {
32 readonly attribute nsIDOMProcessChild manager;
34 JSProcessActorChild includes JSActor;
38 * Used by `ChromeUtils.registerProcessActor()` to register actors.
40 dictionary ProcessActorOptions {
42 * An array of remote type which restricts the actor is allowed to instantiate
43 * in specific process type. If this is defined, the prefix of process type
44 * matches the remote type by prefix match is allowed to instantiate, ex: if
45 * Fission is enabled, the prefix of process type will be `webIsolated`, it
46 * can prefix match remote type either `web` or `webIsolated`. If not passed,
47 * all content processes are allowed to instantiate the actor.
49 sequence<UTF8String> remoteTypes;
52 * If this is set to `true`, allow this actor to be created for the parent
55 boolean includeParent = false;
58 * If true, the actor will be loaded in the loader dedicated to DevTools.
60 * This ultimately prevents DevTools to debug itself.
62 boolean loadInDevToolsLoader = false;
64 /** This fields are used for configuring individual sides of the actor. */
65 ProcessActorSidedOptions parent;
66 ProcessActorChildOptions child;
69 dictionary ProcessActorSidedOptions {
71 * The ESM path which should be loaded for the actor on this side.
73 * If this is not passed, the specified side cannot receive messages, but may
74 * send them using `sendAsyncMessage` or `sendQuery`.
76 ByteString esModuleURI;
79 dictionary ProcessActorChildOptions : ProcessActorSidedOptions {
81 * An array of observer topics to listen to. An observer will be added for each
84 * Unlike for JSWindowActor, observers are always invoked, and do not need to
85 * pass an inner or outer window as subject.
87 sequence<ByteString> observers;