Closed Bug 1899503 Opened 1 year ago Closed 11 months ago

Making WorkerDebugger communication through IPC instead of runnable dispatching between threads.

Categories

(Core :: DOM: Workers, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
139 Branch
Tracking Status
firefox139 --- fixed

People

(Reporter: edenchuang, Assigned: edenchuang)

References

(Blocks 3 open bugs)

Details

Attachments

(4 files)

This is a part of bug 1672491. This bug is specific for improving the communication between Worker and WorkerDebugger by the IPC mechanism.

Assignee: nobody → echuang
Blocks: 1672491
Severity: -- → S3
Status: NEW → ASSIGNED
Priority: -- → P2
Attachment #9439975 - Attachment description: WIP: Bug 1899503 - P1 New top-level IPC PRemoteWorkerDebugger to support nsIWorkerDebugger interface for Workers in the parent process. r=asuth → Bug 1899503 - P1 New top-level IPC PRemoteWorkerDebugger to support nsIWorkerDebugger interface for Workers in the parent process. r=asuth
Attachment #9439976 - Attachment description: WIP: Bug 1899503 - P2 Hook RemoteWorkerDebuggerChild on WorkerPrivate. r=asuth → Bug 1899503 - P2 Hook RemoteWorkerDebuggerChild on WorkerPrivate. r=asuth

:ochameau, I'm setting a needinfo on you for https://phabricator.services.mozilla.com/D230260#7992817 because it's very easy to not see phabricator name-checks.

Flags: needinfo?(poirot.alex)
Attachment #9439975 - Attachment description: Bug 1899503 - P1 New top-level IPC PRemoteWorkerDebugger to support nsIWorkerDebugger interface for Workers in the parent process. r=asuth → WIP: Bug 1899503 - P1 New top-level IPC PRemoteWorkerDebuggerManager and PRemoteWorkerDebugger to support nsIWorkerDebugger interface for Workers in the parent process. r=asuth
Attachment #9439976 - Attachment description: Bug 1899503 - P2 Hook RemoteWorkerDebuggerChild on WorkerPrivate. r=asuth → WIP: Bug 1899503 - P3 PRemoteWorkerDebugger binding implementation. r=asuth
Blocks: 1899509
Attachment #9439975 - Attachment description: WIP: Bug 1899503 - P1 New top-level IPC PRemoteWorkerDebuggerManager and PRemoteWorkerDebugger to support nsIWorkerDebugger interface for Workers in the parent process. r=asuth → Bug 1899503 - P1 New top-level IPC PRemoteWorkerDebuggerManager and PRemoteWorkerDebugger to support nsIWorkerDebugger interface for Workers in the parent process. r=asuth
Attachment #9442674 - Attachment description: WIP: Bug 1899503 - P2 PRemoteWorkerDebuggerMangaer binding implementation. r=asuth → Bug 1899503 - P2 PRemoteWorkerDebuggerMangaer binding implementation. r=asuth
Attachment #9439976 - Attachment description: WIP: Bug 1899503 - P3 PRemoteWorkerDebugger binding implementation. r=asuth → Bug 1899503 - P3 PRemoteWorkerDebugger binding implementation. r=asuth
Flags: needinfo?(poirot.alex)

Hi!

I'm currently working on adding worker support for WebDriver BiDi (which shares a lot of similarities with what we try to do in DevTools), and it's going to be one of our focus for 2025, so I'd like to get a picture of the potential impacts of this change.

From looking at the comments on phabricator, it's not clear to me if the nsIWorkerDebugger will now be created in the parent process main thread for all workers, or if that only applies to shared/service workers.

My initial goal is to be able to interact with regular web workers, and for now my setup is similar to devtools: I spawn a WorkerDebugger in content process main thread, and then load a script via initialize to load the WebDriver BiDi logic in the worker thread.

Can you confirm if this will need to change with this Bug (and to be clear, that would probably only simplify things for us, so that's a nice win for the BiDi implementation, just trying to assess the impacts).
Thanks

Flags: needinfo?(echuang)

After the bug, nsIWorkerDebugger could be registered in parent process main thread for all types of Worker. Basically, it has the same behavior with the nsIWorkerDebugger in the content process main thread. You can still call nsIWorkerDebugger::Initilaize(url) in the parent process, and the debugger script will be loaded in the content process. And any notification, such as onmessage, onerror, are propagated to the parent process nsIWorkerDebuggerListener.

After this bug, we will not get rid of the content process nsIWorkerDebugger immediately. There will a bug for the debugger movement from content to parent.

Flags: needinfo?(echuang)

Thanks for the feedback, this sounds like it will really simplify the implementation for us in WebDriver BiDi. So I'm hesitant to start working on this topic before this bug lands. I see you already have patches attached and reviews in progress, do you think this has a good chance to land early 2025?

Flags: needinfo?(echuang)

The patch is still being reviewed. Yes, we expect this will be landed in the early of 2025.

Flags: needinfo?(echuang)
Blocks: 1944240
Blocks: 1944242
Pushed by echuang@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/2596059bf325 P1 New top-level IPC PRemoteWorkerDebuggerManager and PRemoteWorkerDebugger to support nsIWorkerDebugger interface for Workers in the parent process. r=asuth https://hg.mozilla.org/integration/autoland/rev/8973242af52a P2 PRemoteWorkerDebuggerMangaer binding implementation. r=asuth https://hg.mozilla.org/integration/autoland/rev/b0cfee4dccb7 P3 PRemoteWorkerDebugger binding implementation. r=asuth https://hg.mozilla.org/integration/autoland/rev/ffad31a6d765 P4 Update SharedWorker windowID for remote worker debugger. r=asuth
Pushed by echuang@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/e80b18ca9165 P1 New top-level IPC PRemoteWorkerDebuggerManager and PRemoteWorkerDebugger to support nsIWorkerDebugger interface for Workers in the parent process. r=asuth https://hg.mozilla.org/integration/autoland/rev/9bd2a82481f4 P2 PRemoteWorkerDebuggerMangaer binding implementation. r=asuth https://hg.mozilla.org/integration/autoland/rev/01fe98c08d10 P3 PRemoteWorkerDebugger binding implementation. r=asuth https://hg.mozilla.org/integration/autoland/rev/d926f7fefc9d P4 Update SharedWorker windowID for remote worker debugger. r=asuth
Flags: needinfo?(echuang)
Pushed by echuang@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/5d39af040a61 P1 New top-level IPC PRemoteWorkerDebuggerManager and PRemoteWorkerDebugger to support nsIWorkerDebugger interface for Workers in the parent process. r=asuth https://hg.mozilla.org/integration/autoland/rev/df07abc82381 P2 PRemoteWorkerDebuggerMangaer binding implementation. r=asuth https://hg.mozilla.org/integration/autoland/rev/07833c96f60c P3 PRemoteWorkerDebugger binding implementation. r=asuth https://hg.mozilla.org/integration/autoland/rev/18bb85ce72bd P4 Update SharedWorker windowID for remote worker debugger. r=asuth
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Target Milestone: 138 Branch → ---
Pushed by echuang@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/9e22fbf8ab8f P1 New top-level IPC PRemoteWorkerDebuggerManager and PRemoteWorkerDebugger to support nsIWorkerDebugger interface for Workers in the parent process. r=asuth https://hg.mozilla.org/integration/autoland/rev/b003e26209cf P2 PRemoteWorkerDebuggerMangaer binding implementation. r=asuth https://hg.mozilla.org/integration/autoland/rev/1e774bd7f365 P3 PRemoteWorkerDebugger binding implementation. r=asuth https://hg.mozilla.org/integration/autoland/rev/d40050ad198b P4 Update SharedWorker windowID for remote worker debugger. r=asuth
Flags: needinfo?(echuang)

Backed out for causing wpt failures @nsTArray.h.

Flags: needinfo?(echuang)
Pushed by echuang@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/77eda17d0795 P1 New top-level IPC PRemoteWorkerDebuggerManager and PRemoteWorkerDebugger to support nsIWorkerDebugger interface for Workers in the parent process. r=asuth https://hg.mozilla.org/integration/autoland/rev/604c4c52574a P2 PRemoteWorkerDebuggerMangaer binding implementation. r=asuth https://hg.mozilla.org/integration/autoland/rev/f2debe329bca P3 PRemoteWorkerDebugger binding implementation. r=asuth https://hg.mozilla.org/integration/autoland/rev/53705a19f919 P4 Update SharedWorker windowID for remote worker debugger. r=asuth
Regressions: 1961837
QA Whiteboard: [qa-triage-done-c140/b139]
Flags: needinfo?(echuang)
Regressions: 1965872
No longer regressions: 1965872
Regressions: 1967390
No longer blocks: 1944242
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: