Closed Bug 1936774 Opened 1 year ago Closed 1 year ago

Investigate potential issues with nsIWorkerDebugger.initialize

Categories

(Remote Protocol :: WebDriver BiDi, task, P2)

task
Points:
2

Tracking

(firefox141 fixed)

RESOLVED FIXED
141 Branch
Tracking Status
firefox141 --- fixed

People

(Reporter: jdescottes, Assigned: jdescottes)

References

(Blocks 1 open bug)

Details

(Whiteboard: [webdriver:m16])

Attachments

(1 file, 2 obsolete files)

While prototyping worker support in BiDi, I noticed we rely on nsIWorkerDebugger initialize to load the "startup" script in devtools and this in turn makes the nsIWorkerDebugger instance initialized.

https://searchfox.org/mozilla-central/rev/39e6d5b609b74a19c0824d98ae654b60d6310152/dom/workers/nsIWorkerDebugger.idl#52

void initialize(in AString url);

https://searchfox.org/mozilla-central/rev/39e6d5b609b74a19c0824d98ae654b60d6310152/dom/workers/nsIWorkerDebugger.idl#32

readonly attribute boolean isInitialized;

This sounds fine as long as only DevTools is only using the API. But if we consider scenarios where BiDi is monitoring events on workers and we also want to open the DevTools toolbox, both protocols might try to call initialize on the same nsIWorkerDebugger instance. If BiDi already "initialized" the WorkerDebugger, DevTools will not try to load its script and won't be able to interact with the worker.

I can see two options here:

  • we extend initialize to make it more flexible
  • or both DevTools and BiDi use the same startup script?

Alex: any thoughts here?

Flags: needinfo?(poirot.alex)
Points: --- → 3
Priority: -- → P2
Whiteboard: [webdriver:m15]
Whiteboard: [webdriver:m15] → [webdriver:m16]
Assignee: nobody → jdescottes
Status: NEW → ASSIGNED
Flags: needinfo?(jdescottes)

(discussed on phab)

Flags: needinfo?(poirot.alex)

We should be able to reuse devtools/server/startup/shared-worker-initializer.js easily for BiDi now. The change was rather small so downgrading to 2P.

Points: 3 → 2
Pushed by jdescottes@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/733370ffdd0d https://hg.mozilla.org/integration/autoland/rev/b41b6ad00ee0 [devtools] Refactor worker initializer to be easier to reuse outside of devtools r=ochameau
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 141 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: