Files
sousa-gecko/dom/chrome-webidl/JSProcessActor.webidl
T
Andrew McCreight 7be36ab56a Bug 2041729 - Refactor JS actor options. r=nika
This moves the remoteTypes member to a new base class JSActorOptions for
WindowActorOptions and ProcessActorOptions. The parent member is the same
in both, but it is left in the subclass to keep the side options together,
and to simplify potential future specialization of the member.

It also moves the esModuleURI member to a new base class JSActorSidedOptions
for the various side options dictionaries. The observer member appears in
both child subclasses, but the behavior is different, so the member is
left in the subclasses.

This refactoring will make it easier to add new options that are used by both
kinds of actors.

I also cleaned up the writing in the comments in a number of places.

Differential Revision: https://phabricator.services.mozilla.com/D302066
2026-05-26 19:37:59 +00:00

69 lines
1.8 KiB
Plaintext

/* 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/. */
/**
* An actor architecture designed to allow compositional parent/content
* communications. The lifetime of a JSProcessActor{Child, Parent} is the `ContentParent`
* (for the parent-side) / `ContentChild` (for the child-side).
*/
interface nsISupports;
/**
* Base class for parent-side actor.
*/
[ChromeOnly, Exposed=Window]
interface JSProcessActorParent {
[ChromeOnly]
constructor();
readonly attribute nsIDOMProcessParent manager;
};
JSProcessActorParent includes JSActor;
[ChromeOnly, Exposed=Window]
interface JSProcessActorChild {
[ChromeOnly]
constructor();
readonly attribute nsIDOMProcessChild manager;
};
JSProcessActorChild includes JSActor;
/**
* Used by `ChromeUtils.registerProcessActor()` to register actors.
*/
dictionary ProcessActorOptions : JSActorOptions {
/**
* If this is set to `true`, allow this actor to be created for the parent
* process.
*/
boolean includeParent = false;
/**
* If true, the actor will be loaded in the loader dedicated to DevTools.
*
* This ultimately prevents DevTools from debugging itself.
*/
boolean loadInDevToolsLoader = false;
/**
* These fields are used to configure the individual sides of the actor.
*/
JSActorSidedOptions parent;
ProcessActorChildOptions child;
};
dictionary ProcessActorChildOptions : JSActorSidedOptions {
/**
* An array of observer topics to listen to. An observer will be added for each
* topic in the list.
*
* Unlike for JSWindowActor, observers are always invoked, and do not need to
* pass an inner or outer window as subject.
*/
sequence<ByteString> observers;
};