Closed Bug 1593937 Opened 5 years ago Closed 4 years ago

Watch for additional remote frame targets in the case of the content toolbox

Categories

(DevTools :: Framework, enhancement, P1)

enhancement

Tracking

(Fission Milestone:M6a, firefox77 fixed)

RESOLVED FIXED
Firefox 77
Fission Milestone M6a
Tracking Status
firefox77 --- fixed

People

(Reporter: ochameau, Assigned: ochameau)

References

(Blocks 3 open bugs)

Details

(Whiteboard: dt-fission-m2-mvp)

Attachments

(7 files, 4 obsolete files)

47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review

Bug 1578745 introduced the devtools.contenttoolbox.fission preference, but TargetList landed in bug 1471754 doesn't support it.
We should make it so that the TargetList tries to iterate over remote frames for the case of the content toolbox when the pref is turned on.

Landing such change might be blocked on bug 1565200 and bug 1593764 as frame.getTarget(); in LegacyImplementationFrames.listen will return null and we will log a warning message.

TargetList tests should be updated carefuly based on this comment:
https://phabricator.services.mozilla.com/D51783#inline-313810

Blocks: 1574350
Priority: -- → P2
Assignee: nobody → poirot.alex
Status: NEW → ASSIGNED
Whiteboard: dt-fission-m2-mvp

Tracking for Fission Nightly (M6)

Fission Milestone: --- → M6
Priority: P2 → P1
Blocks: 1608848
Depends on: 1609128

Comment on attachment 9119751 [details]
Bug 1593937 - Implement polymorphism in protocol.js

Revision D59333 was moved to bug 1609128. Setting attachment 9119751 [details] to obsolete.

Attachment #9119751 - Attachment is obsolete: true
Attachment #9119752 - Attachment is obsolete: true
Depends on: 1613119
Attachment #9109969 - Attachment description: Bug 1593937 - Implement watchDescriptors for remote frames. → Bug 1593937 - Implement watchTargets for remote frames.
Blocks: 1614291

Now that the BrowsingContextTarget are created by the watcher,
we should redirect existing code in the frontend which was using
RootFront.getBrowsingContextDescriptor in order to directly fetch the target from the watcher
.
We don't really need descriptors for additional targets.
I think that descriptors are mostly useful for the top level target and for about:debugging, to describe a target without debugging it yet.

This patch is a bit complex because we can't fetch the "parent BrowsingContext ID" from actors/browsing-context.js:form().
browsingContext.parent and browsingContext.embedderWindowGlobal are both null from the content process.
I have not found any way/API to get the parent browsing context ID from the content process, i.e. the ID of browser.xhtml from a tab content process.
So, I end up with this helper method on Watcher actor to get the parent ID on-demand.
We could also inject the parent ID into the browsingContextTarget's form in WindowGlobalWatcher._createTarget,
but that sounds very hacky and hard to follow.

Note that this patch address the issue of duplicated targets.
WatcherFront.getBrowsingContextTarget ensures fetching the ParentProcessTarget for browser.xhtml
instead of recreating a duplicated FrameDescriptor and BrowsingContextTarget for this document, as we do in the existing codebase.

I should probably update the node picker test, as the node picker in the browser toolbox was broken without this patch

This would allow creating the WindowGlobalTarget as soon as the WindowGlobal is created,
before any JS of the page starts executing.
Doing this in the parent is too late and the page already started running.

Blocks: 1620248
Blocks: 1620249
Attachment #9119750 - Attachment is obsolete: true

The new followWindowGlobalLifeCycle argument and field makes the actor behaves like a WindowGlobalTargetActor and only care about the current global (and all its inner iframes, still).
But it ignores the previous/next document. We still uses the DebuggerProgressListener, but mostly for iframes.
will-navigate and navigate are irrelevant for this actor now.
The plan would be to eventually switch all codepaths to this WindowGlobalTargetActor and rename it.
For now, this would only be used for remoted iframes, only additional frame targets.
But not for top level document, nor top level target switching.

Attachment #9127536 - Attachment description: Bug 1593937 - Experiment moving WindowGlobal watching from parent to content processes → Bug 1593937 - Implement watchTargets for remote frames.
Depends on: 1620257
Depends on: 1620966

Toggling the watchedByDevTools attribute will:

  • force loading the DevToolsFrameChild JS Window actor in the content process
  • emit DevToolsWatching DOM event, which will be listened to create the target actor

We have to stop setting the watchedByDevTools flag from DevTools code in the content
process as it is already set an spread by native code of BrowsingContext.

If we don't, and do not have the if (mFields.Get<IDX_WatchedByDevTools>()) return; check
the code would actually infinite loop as setting a BrowsingContext field,
even to the exact same value, would actually still call ::DidSet() methods.

See Also: → 1602748
Attachment #9109969 - Attachment is obsolete: true
Depends on: 1623350
Blocks: 1625026
Blocks: 1625027

Tentatively moving P1 Fission M6 bugs to M6a.

Fission Milestone: M6 → M6a
Blocks: 1628473

When navigating between process, we happen to destroy the AccessibleFront
in middle of this call to Target.getFront("inspector").
Before calling updateDetails, we already check if AccessibleFront is already destroyed.
This code also checks after the call to getFront.

Blocks: 1605330
Blocks: 1631451
Blocks: 1631495
Blocks: 1632066

The previous changeset removed all the usages of listRemoteFrames from
the frontend code. We can start removing this method from the actor codebase,
and keep backward compat code in the client.

Blocks: 1632567

I also disable browser_accessibility_tree_nagivation_oop.js as it fails intermittenly on Fission
and triggers a C++ assertion.

Attachment #9142776 - Attachment description: Bug 1593937 - Disable remote frame debugger if the devtools fission preference are false. → Bug 1593937 - Disable browser_accessibility_tree_nagivation_oop.js as it fails intermittenly on Fission.
Pushed by apoirot@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/481eb7022f30
Make the BrowsingContextTargetActor optionally follow the WindowGlobal lifecycle. r=jdescottes
https://hg.mozilla.org/integration/autoland/rev/8f0492701940
Implement watchTargets for remote frames. r=jdescottes
https://hg.mozilla.org/integration/autoland/rev/04eee1b240f8
Fetch BrowsingContextTargets via the watcher instead of the RootFront. r=jdescottes
https://hg.mozilla.org/integration/autoland/rev/8dddeb7310ca
Prevent fetching NodeFront for already destroyed AccessibleFront. r=yzen
https://hg.mozilla.org/integration/autoland/rev/7acfcfdcbfd9
Remove/Deprecate listRemoteFrames. r=jdescottes
https://hg.mozilla.org/integration/autoland/rev/fc77f6e49447
Disable browser_accessibility_tree_nagivation_oop.js as it fails intermittenly on Fission. r=yzen,jdescottes
Blocks: 1866814
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: