Open Bug 1597451 Opened 2 months ago Updated 2 months ago

Fix uses of mozilla::MediaManager::IterateWindowListeners in dom/media/MediaManager.cpp


(Core :: DOM: Navigation, defect, P3)




Fission Milestone M6


(Reporter: djvj, Unassigned)


(Blocks 1 open bug)


(Whiteboard: [rm-docshell-tree-item:hard])

In file dom/media/MediaManager.cpp

Iterates over child DocShell tree, and for each one with a Window, pulls out its UserMediaWindowListener.

Calls a visitor callback on every such UserMediaWindowListener.

Four users each passing their own callback logic:

  • DeviceListChanged
    • Calls StopRawId() on listener with ID of device.
    • Should be invoked rarely, can be switched to using IPC to invoke on parent process.
  • OnNavigation
    • Calls RemoveAll on listeners.
    • Itself invoked by Navigator::OnNavigation
    • Convert to using BrowsingContext.
    • If any children are out-of-process, collect root of each out-of-process subtree and send async-IPC to chrome to forward listener removal.
  • MediaCaptureWindowState
    • Retrieves media capture state (Enabled|Disabled|Off for camera/browser/etc.), merges it across the tree, and returns it.
    • Used by WebRTC code.
    • Seems OK to use sync IPC here - ask process to collate this across windows.
    • WindowContext seems most reasonable place for this state.
  • StopScreenSharing
    • Calls StopSharing() on listener.
    • Rare call.
    • Can use IPC too.

Kannan says replacing nsIDocShellTreeItem calls should block enabling Fission in Nightly (M6).

Fission Milestone: --- → M6
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.