mirror of
https://github.com/servo/servo.git
synced 2025-08-11 08:25:32 +01:00
script: Add new worker globals as debuggees (#38551)
to debug workers in a page with the [SpiderMonkey Debugger API](https://firefox-source-docs.mozilla.org/js/Debugger/), we need to pass the worker’s global object to [Debugger.prototype.**addDebuggee()**](https://firefox-source-docs.mozilla.org/js/Debugger/Debugger.html#adddebuggee-global). we could pick up the global via the [onNewGlobalObject() hook](https://firefox-source-docs.mozilla.org/js/Debugger/Debugger.html#onnewglobalobject-global), but if our script system passes the global to the debugger script instead, we can later add details like the PipelineId that will help servo identify debuggees that the API is notifying us about (#38334). this patch creates a debugger global in worker threads, runs the debugger script in those new globals, and plumbs new worker globals from those threads into addDebuggee() via the debugger script. since worker threads can’t generate PipelineId values, but they only ever run workers on behalf of one pipeline, we use that pipeline’s PipelineId as the PipelineId of the debugger global, rather than generating a unique PipelineId like we do in script threads. Testing: will undergo many automated tests in #38334 Fixes: part of #36027 Signed-off-by: Delan Azabani <dazabani@igalia.com> Co-authored-by: atbrakhi <atbrakhi@igalia.com>
This commit is contained in:
parent
d50f02fa73
commit
a3e0a34802
9 changed files with 178 additions and 24 deletions
|
@ -7,4 +7,12 @@
|
|||
[Exposed=DebuggerGlobalScope]
|
||||
interface DebuggerEvent : Event {
|
||||
readonly attribute object global;
|
||||
readonly attribute PipelineId pipelineId;
|
||||
readonly attribute DOMString? workerId;
|
||||
};
|
||||
|
||||
[Exposed=DebuggerGlobalScope]
|
||||
interface PipelineId {
|
||||
readonly attribute unsigned long namespaceId;
|
||||
readonly attribute unsigned long index;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue