Closed Bug 1597413 Opened 5 years ago Closed 4 years ago

Fix uses of mozilla::dom::ScreenOrientation::LockInternal and AbortOrientationPromises in dom/base/ScreenOrientation.cpp

Categories

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

defect

Tracking

()

RESOLVED FIXED
mozilla77
Fission Milestone M6
Tracking Status
firefox77 --- fixed

People

(Reporter: djvj, Assigned: smacleod)

References

(Blocks 1 open bug)

Details

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

Attachments

(1 file)

In file dom/base/ScreenOrientation.cpp

Uses DocShell tree to find children recurse on them.

  • Retrieves promise each document in subtree (accesses internals).

Uses DocShell tree to find root item, then retrieves the DocShell to set the orientation lock.

  • Root might not be in process.

Change to use BrowsingContext.

  • Do a pre-check to see if the entire tree is in process, if so perform current logic.
  • If any of tree is out of process, compute the root BrowsingContext locally, and IPC chrome.
    • Chrome process can compute full set of processes, and list of browsingcontext id list for each.
    • Chrome can then dispatch those to each process, invoking in-process AbortOrientationPromises.

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

Fission Milestone: --- → M6
Priority: -- → P3
Summary: Fix uses of mozila::dom::ScreenOrientation::LockInternal and AbortOrientationPromises in dom/base/ScreenOrientation.cpp → Fix uses of mozilla::dom::ScreenOrientation::LockInternal and AbortOrientationPromises in dom/base/ScreenOrientation.cpp
Assignee: nobody → smacleod
Status: NEW → ASSIGNED

Both the deprecated Screen.lockOrientation and replacement
ScreenOrientation.lock APIs have been updated to make use of a new
OrientationLock field on the BrowsingContext. This replaces the
storage and use of APIs for this on the root docshell.

In the non fission case things should behave the same, as pending
promises for previous calls to Screen.lockOrientation will still be
cancelled in process. If there are BrowsingContexts in other
processes though, IPC will be sent to the parent, and then each other
child to cancel them. This should be spec compliant as the spec is
already racy with regards to multiple lockOrientation calls.

This new implementation has a little extra IPC than the optimal
implementation would since the root BrowsingContexts
OrientationLock is set using the normal SyncedContext machinery,
rather than combining the AbortOtherOrientationPendingPromises
message for a single message.

This commit fixes both Bug 1597413 and Bug 1597443.

See Also: → 1597443
Attachment #9139544 - Attachment description: Bug 1597413 - fix locking screen orientation to be fission compatible. r?nika → Bug 1597413 - fix locking screen orientation to be fission compatible. r=farre
Pushed by smacleod@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/e110f422c3e0
fix locking screen orientation to be fission compatible. r=farre
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla77
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: