Skip to content

Commit c73088c

Browse files
committed
Bug 1643175 - update documentation about JSWindowActor's observers list, r=Yoric
DONTBUILD Differential Revision: https://phabricator.services.mozilla.com/D78566
1 parent 925ac1a commit c73088c

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

dom/chrome-webidl/JSProcessActor.webidl

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,8 @@ dictionary ProcessActorChildOptions : ProcessActorSidedOptions {
6767
* An array of observer topics to listen to. An observer will be added for each
6868
* topic in the list.
6969
*
70-
* Observer notifications in the list use nsGlobalContentInner or
71-
* nsGlobalContentOuter object as their subject, and the events will only be
72-
* dispatched to the corresponding content actor. If additional observer
73-
* notification's subjects are needed, please file a bug for that.
70+
* Unlike for JSWindowActor, observers are always invoked, and do not need to
71+
* pass an inner or outer window as subject.
7472
**/
7573
sequence<ByteString> observers;
7674
};

dom/docs/Fission.rst

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -309,8 +309,8 @@ In the old model, framescript were loaded and executed as soon as possible by th
309309

310310
1. They're instantiated explicitly by calling ``getActor`` on a ``WindowGlobal``, and passing in the name of the Actor.
311311
2. A message is sent to them.
312-
3. A pre-defined ``nsIObserver`` observer notification fires
313-
4. A pre-defined content Event fires
312+
3. A pre-defined ``nsIObserver`` observer notification fires with the subject of the notification corresponding to an inner or outer window.
313+
4. A pre-defined content Event fires.
314314

315315
Making the Actors lazy like this saves on processing time to get a frame ready to load web pages, as well as the overhead of loading the Actor into memory.
316316

@@ -498,9 +498,12 @@ We're similarly declaring where the ``PluginChild`` subclassing ``JSWindowActorC
498498
Next, we declare the content events, if fired in a BrowsingContext, will cause the JSWindowActor pair to instantiate if it doesn't already exist, and then have ``handleEvent`` called on the ``PluginChild`` instance. For each event name, an Object of event listener options can be passed. You can use the same event listener options as accepted by ``addEventListener``.
499499

500500
.. note::
501-
Content events make sense for JSWindowActor (which *have* a content) but are ignored for JSProcessActor (which don't).
501+
Content events make sense for ``JSWindowActorChild`` (which *have* a content) but are ignored for ``JSProcessActorChild`` (which don't).
502502

503-
Next, we declare that ``PluginChild`` should observe the ``decoder-doctor-notification`` ``nsIObserver`` notification. When that observer notification fires, the ``PluginChild`` will be instantiated for all ``BrowsingContext``'s, and the ``observe`` method on the ``PluginChild`` implementation will be called.
503+
Next, we declare that ``PluginChild`` should observe the ``decoder-doctor-notification`` ``nsIObserver`` notification. When that observer notification fires, the ``PluginChild`` actor will be instantiated for the ``BrowsingContext`` corresponding to the inner or outer window that is the subject argument of the observer notification, and the ``observe`` method on that ``PluginChild`` implementation will be called. If you need this functionality to work with other subjects, please file a bug.
504+
505+
.. note::
506+
Unlike ``JSWindowActorChild`` subclasses, observer topics specified for ``JSProcessActorChild`` subclasses will cause those child actor instances to be created and invoke their ``observe`` method no matter what the subject argument of the observer is.
504507

505508
Finally, we say that the ``PluginChild`` actor should apply to ``allFrames``. This means that the ``PluginChild`` is allowed to be loaded in any subframe. If ``allFrames`` is set to false (the default), the actor will only ever load in the top-level frame.
506509

0 commit comments

Comments
 (0)