Closed Bug 1523631 Opened 7 years ago Closed 7 years ago

Lazily create JS Actors when events fire in content

Categories

(Core :: DOM: Content Processes, enhancement, P1)

enhancement

Tracking

()

RESOLVED FIXED
mozilla67
Fission Milestone M1
Tracking Status
firefox67 --- fixed

People

(Reporter: jdai, Assigned: nika)

References

Details

Attachments

(5 files)

No description provided.

This is a follow-up to the initial JS Actor APIs which will initially only support creation upon calls to getActor.

This will add additional options to WindowActorSidedOptions:

dictionary WindowActorSidedOptions {
  // ...

  // Mapping from event names to the corresponding AddEventListenerOptions 
  // object used to configure the event listener.
  //
  // An event listed here will be listened to by native code, and will 
  // cause the actor to be created to recieve the event if it is fired. 
  // Once the actor has been created, it will automatically be delivered 
  // these events for the duration of its lifetime. When the actor is 
  // destroyed, it will automatically be unregistered.
  //
  // If `once` is set, only the first event of the given type will be 
  // delivered to the JSWindowActor.
  record<DOMString, AddEventListenerOptions> events;

  // Array of observer topics which should trigger actor creation.
  //
  // Once an actor has been created, it will automatically be registered 
  // as an observer for these topics for the duration of its lifetime. 
  // When the actor is destroyed, it will automatically be unregistered.
  //
  // WARNING: Observer notifications are global, and can cause creation
  // of unnecessary actors! Filtering of messages must be done on a 
  // per-actor basis.
  sequence<DOMString> observers;
};
Fission Milestone: --- → M2
Priority: -- → P2
Summary: Implement events and observer notifications which cause actor creation probably → Lazily create JS Actors when events or observer notifications fire in content
Component: DOM → DOM: Content Processes

NOTE: The events option should not be valid when used on the parent side, as there is no global to be listening to events from.

Status: NEW → ASSIGNED

Separate lazily create JS Actors when observer notifications fire in content to bug 1526406.

Summary: Lazily create JS Actors when events or observer notifications fire in content → Lazily create JS Actors when events fire in content
Assignee: jdai → nika
Fission Milestone: M2 → M1
Priority: P2 → P1
Whiteboard: [2/19] patches under review

This warning (as an error) is showing up with this patch due to the new
use of AddEventListenerOptions in ChromeUtilsBinding.h. That header is
included in some codegen units which have this warning enabled, which
revealed the issue.

I believe the warning is spurious in this case, but fixing it doesn't
seem like a big deal. Requesting review from Boris, as he added the
comment 6 years ago.

Depends on D20015

Pushed by nlayzell@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/2beb789b521f Part 1: Add a JSWindowActorProtocol object for protocol-specific state, r=jdai https://hg.mozilla.org/integration/autoland/rev/3575c9a372e7 Part 2: Add support for event listeners to JS Window Actor Protocols, r=jdai,qdot https://hg.mozilla.org/integration/autoland/rev/20be5e162a7d Part 3: Unregister in content processes as well, r=jdai https://hg.mozilla.org/integration/autoland/rev/a3f79e3f59f9 Part 4: Add tests for event listeners on JS Window Actor Protocols, r=jdai https://hg.mozilla.org/integration/autoland/rev/fd3f6a36c79f Part 5: Avoid GCC warning when including dictionary types in WebIDL, r=bzbarsky
Whiteboard: [2/19] patches under review
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: