Backed out changeset 2450366cf7ca (bug 1891629) for causing win msix mochitest failures
[gecko.git] / dom / chrome-webidl / JSProcessActor.webidl
blobf158af53b370cfa8e4a07809066a6ea2f1a38ecc
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/. */
7 /**
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).
11  */
13 interface nsISupports;
15 /**
16  * Base class for parent-side actor.
17  */
18 [ChromeOnly, Exposed=Window]
19 interface JSProcessActorParent {
20   [ChromeOnly]
21   constructor();
23   readonly attribute nsIDOMProcessParent manager;
25 JSProcessActorParent includes JSActor;
27 [ChromeOnly, Exposed=Window]
28 interface JSProcessActorChild {
29   [ChromeOnly]
30   constructor();
32   readonly attribute nsIDOMProcessChild manager;
34 JSProcessActorChild includes JSActor;
37 /**
38  * Used by `ChromeUtils.registerProcessActor()` to register actors.
39  */
40 dictionary ProcessActorOptions {
41   /**
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.
48    */
49   sequence<UTF8String> remoteTypes;
51   /**
52    * If this is set to `true`, allow this actor to be created for the parent
53    * process.
54    */
55   boolean includeParent = false;
57   /**
58    * If true, the actor will be loaded in the loader dedicated to DevTools.
59    *
60    * This ultimately prevents DevTools to debug itself.
61    */
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 {
70   /**
71    * The JSM path which should be loaded for the actor on this side.
72    *
73    * Mutually exclusive with `esModuleURI`.
74    *
75    * If neither this nor `esModuleURI` is passed, the specified side cannot receive
76    * messages, but may send them using `sendAsyncMessage` or `sendQuery`.
77    *
78    * TODO: Remove this once m-c, c-c, and out-of-tree code migrations finish
79    *       (bug 1866732).
80    */
81   ByteString moduleURI;
83   /**
84    * The ESM path which should be loaded for the actor on this side.
85    *
86    * Mutually exclusive with `moduleURI`.
87    *
88    * If neither this nor `moduleURI` is passed, the specified side cannot
89    * receive messages, but may send them using `sendAsyncMessage` or
90    * `sendQuery`.
91    */
92   ByteString esModuleURI;
95 dictionary ProcessActorChildOptions : ProcessActorSidedOptions {
96   /**
97    * An array of observer topics to listen to. An observer will be added for each
98    * topic in the list.
99    *
100    * Unlike for JSWindowActor, observers are always invoked, and do not need to
101    * pass an inner or outer window as subject.
102    */
103   sequence<ByteString> observers;