JSContext debugging hook pointer should be moved to JSCompartment

NEW
Unassigned

Status

()

Core
JavaScript Engine
7 years ago
7 years ago

People

(Reporter: jimb, Unassigned)

Tracking

(Blocks: 1 bug)

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

7 years ago
At the moment, we choose which debug hook function to call when an event occurs in a JS debuggee by consulting a 'JSDebugHooks *' in the current context. I would like to move this pointer to the JSCompartment. That is, hook references that now look like cx->debugHooks->mumbleHook would become cx->compartment->debugHooks->mumbleHook.

Why? Compartments are a natural choice for the extent of a JavaScript debuggee. In content, they correspond to origins. They also work nicely for debugger/debuggee separation, as the wrapper logic can enforce restrictions on how debugger and debuggee objects refer to each other. Contexts don't work so well, since they're invisible at the JavaScript level. Runtimes are too broad; we want to be able to establish hooks for the debuggee without any risk of the debugger's own code triggering them.

This change shouldn't affect jsd, since that ignores the JSContext's JSDebugHooks pointer and manipulates only the JSRuntime's hook functions. As far as I can tell, Firefox does not use the per-context pointers either, beyond calling JS_ClearContextDebugHooks to avoid dragging Firebug into worker thread activities.
(Reporter)

Updated

7 years ago
Blocks: 636907
(Reporter)

Updated

7 years ago
Depends on: 640468
(Assignee)

Updated

7 years ago
Component: JavaScript Debugging/Profiling APIs → JavaScript Engine
Product: Core → Core
You need to log in before you can comment on or make changes to this bug.