MSE-in-Workers: Introduce basic MediaSourceAttachment interface
To prepare for cross-thread HTMLMediaElement+MediaSource API attachments, aka "MSE-in-Workers", this CL decouples the MediaSource object from what is directly registered. A new type, MediaSourceAttachment, is used to register available MediaSource objects, and a simple concrete implementation is included in this type to resolve the underlying MediaSource for use in actual attachment. This CL is needed as a prerequisite for cross-thread attachments because subsequent CLs are significantly complex. They will: 1) Move MediaSourceRegistry singleton creation to modules initializer to ensure it is owned on the main thread, even if a worker thread was the first to need it (see bullet 3, below). 2) Update MediaSourceAttachment to be an interface and move the communication between HTMLMediaElement and the MediaSource to be done via the interface with concrete implementation(s) in modules. 3) Add a cross-thread attachment implementation. This part will be complex, and will be better handled if the existing same-thread behavior and the new cross-thread behavior are distinct implementations of a common attachment interface. Further, having a non-oilpan type (the concrete implementations of MediaSourceAttachment) as the registrable enables the implementations to safely operate when lifetimes of either side of the attachment vary. And such a non-oilpan type must be used as the registrable if the registry singleton's internal initialization is done prior to Oilpan being ready (during the modules initializer). 4) Refine the interface and concrete implementations for performance and quality specific to the types of attachment being used. BUG=878133 Change-Id: I8376f6483142d3653e5d39d76f5a245c80365b18 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2300804Reviewed-by:Keishi Hattori <keishi@chromium.org> Reviewed-by:
Mounir Lamouri <mlamouri@chromium.org> Commit-Queue: Matthew Wolenetz <wolenetz@chromium.org> Cr-Commit-Position: refs/heads/master@{#796549}
Showing
Please register or sign in to comment