#[repr(C)]pub(crate) struct DebuggerGlobalScope {
global_scope: GlobalScope,
devtools_to_script_sender: GenericSender<DevtoolScriptControlMsg>,
get_possible_breakpoints_result_sender: RefCell<Option<GenericSender<Vec<RecommendedBreakpointLocation>>>>,
eval_result_sender: RefCell<Option<GenericSender<EvaluateJSReply>>>,
get_list_frame_result_sender: RefCell<Option<GenericSender<Vec<String>>>>,
get_environment_result_sender: RefCell<Option<GenericSender<String>>>,
get_function_parameter_names: DomRefCell<Option<TracedCallback<GetFunctionParameterNames<DomTypeHolder>>>>,
pipeline_id: PipelineId,
origin: MutableOrigin,
}Expand description
Global scope for interacting with the devtools Debugger API.
Fields§
§global_scope: GlobalScope§devtools_to_script_sender: GenericSender<DevtoolScriptControlMsg>§get_possible_breakpoints_result_sender: RefCell<Option<GenericSender<Vec<RecommendedBreakpointLocation>>>>§eval_result_sender: RefCell<Option<GenericSender<EvaluateJSReply>>>§get_list_frame_result_sender: RefCell<Option<GenericSender<Vec<String>>>>§get_environment_result_sender: RefCell<Option<GenericSender<String>>>§get_function_parameter_names: DomRefCell<Option<TracedCallback<GetFunctionParameterNames<DomTypeHolder>>>>Callback registered by debugger.js that returns the parameter names of a debuggee function.
pipeline_id: PipelineId§origin: MutableOriginImplementations§
Source§impl DebuggerGlobalScope
impl DebuggerGlobalScope
fn __assert_parent_type(&self)
Source§impl DebuggerGlobalScope
impl DebuggerGlobalScope
Sourcefn new(
debugger_pipeline_id: PipelineId,
script_to_devtools_sender: Option<GenericCallback<ScriptToDevtoolsControlMsg>>,
devtools_to_script_sender: GenericSender<DevtoolScriptControlMsg>,
mem_profiler_chan: ProfilerChan,
time_profiler_chan: ProfilerChan,
script_to_constellation_sender: ScriptToConstellationSender,
script_to_embedder_chan: ScriptToEmbedderChan,
resource_threads: ResourceThreads,
storage_threads: StorageThreads,
gpu_id_hub: Arc<IdentityHub>,
cx: &mut JSContext,
) -> DomRoot<Self>
fn new( debugger_pipeline_id: PipelineId, script_to_devtools_sender: Option<GenericCallback<ScriptToDevtoolsControlMsg>>, devtools_to_script_sender: GenericSender<DevtoolScriptControlMsg>, mem_profiler_chan: ProfilerChan, time_profiler_chan: ProfilerChan, script_to_constellation_sender: ScriptToConstellationSender, script_to_embedder_chan: ScriptToEmbedderChan, resource_threads: ResourceThreads, storage_threads: StorageThreads, gpu_id_hub: Arc<IdentityHub>, cx: &mut JSContext, ) -> DomRoot<Self>
Create a new heap-allocated DebuggerGlobalScope.
debugger_pipeline_id is the pipeline id to use when creating the debugger’s GlobalScope:
- in normal script threads, it should be set to
PipelineId::new(), because those threads can generate pipeline ids, and they may contain debuggees from more than one pipeline - in web worker threads, it should be set to the pipeline id of the page that created the thread, because those threads can’t generate pipeline ids, and they only contain one debuggee from one pipeline
Sourcepub(crate) fn new_if_needed(
cx: &mut JSContext,
debugger_pipeline_id: PipelineId,
script_to_devtools_sender: &Option<GenericCallback<ScriptToDevtoolsControlMsg>>,
devtools_to_script_sender: &Option<GenericSender<DevtoolScriptControlMsg>>,
mem_profiler_chan: &ProfilerChan,
time_profiler_chan: &ProfilerChan,
script_to_constellation_sender: &ScriptToConstellationSender,
script_to_embedder_chan: &ScriptToEmbedderChan,
resource_threads: &ResourceThreads,
storage_threads: &StorageThreads,
gpu_id_hub: &Arc<IdentityHub>,
) -> Option<DomRoot<Self>>
pub(crate) fn new_if_needed( cx: &mut JSContext, debugger_pipeline_id: PipelineId, script_to_devtools_sender: &Option<GenericCallback<ScriptToDevtoolsControlMsg>>, devtools_to_script_sender: &Option<GenericSender<DevtoolScriptControlMsg>>, mem_profiler_chan: &ProfilerChan, time_profiler_chan: &ProfilerChan, script_to_constellation_sender: &ScriptToConstellationSender, script_to_embedder_chan: &ScriptToEmbedderChan, resource_threads: &ResourceThreads, storage_threads: &StorageThreads, gpu_id_hub: &Arc<IdentityHub>, ) -> Option<DomRoot<Self>>
Create a new heap-allocated DebuggerGlobalScope if the devtools_to_script_sender is not None.
Otherwise return None.
debugger_pipeline_id is the pipeline id to use when creating the debugger’s GlobalScope:
- in normal script threads, it should be set to
PipelineId::new(), because those threads can generate pipeline ids, and they may contain debuggees from more than one pipeline - in web worker threads, it should be set to the pipeline id of the page that created the thread, because those threads can’t generate pipeline ids, and they only contain one debuggee from one pipeline
pub(crate) fn origin(&self) -> MutableOrigin
pub(crate) fn as_global_scope(&self) -> &GlobalScope
pub(crate) fn execute(&self, cx: &mut JSContext)
pub(crate) fn fire_add_debuggee( &self, cx: &mut JSContext, debuggee_global: &GlobalScope, debuggee_pipeline_id: PipelineId, debuggee_worker_id: Option<WorkerId>, )
pub(crate) fn fire_eval( &self, cx: &mut JSContext, code: DOMString, debuggee_pipeline_id: PipelineId, debuggee_worker_id: Option<WorkerId>, frame_actor_id: Option<String>, eager: bool, result_sender: GenericSender<EvaluateJSReply>, )
pub(crate) fn fire_get_possible_breakpoints( &self, cx: &mut JSContext, spidermonkey_id: u32, result_sender: GenericSender<Vec<RecommendedBreakpointLocation>>, )
pub(crate) fn fire_set_breakpoint( &self, cx: &mut JSContext, spidermonkey_id: u32, script_id: u32, offset: u32, )
pub(crate) fn fire_interrupt(&self, cx: &mut JSContext)
pub(crate) fn fire_list_frames( &self, cx: &mut JSContext, pipeline_id: PipelineId, start: u32, count: u32, result_sender: GenericSender<Vec<String>>, )
pub(crate) fn fire_get_environment( &self, cx: &mut JSContext, request: GetEnvironmentRequest, result_sender: GenericSender<String>, )
pub(crate) fn fire_resume( &self, cx: &mut JSContext, resume_limit_type: Option<String>, frame_actor_id: Option<String>, )
pub(crate) fn fire_clear_breakpoint( &self, cx: &mut JSContext, spidermonkey_id: u32, script_id: u32, offset: u32, )
pub(crate) fn fire_blackbox( &self, cx: &mut JSContext, spidermonkey_id: u32, coverage: BlackboxCoverage, )
pub(crate) fn fire_unblackbox( &self, cx: &mut JSContext, spidermonkey_id: u32, coverage: BlackboxCoverage, )
pub(crate) fn pipeline_id(&self) -> PipelineId
Sourcepub(crate) fn function_parameter_names(
&self,
cx: &mut JSContext,
function: HandleValue<'_>,
) -> Option<Vec<String>>
pub(crate) fn function_parameter_names( &self, cx: &mut JSContext, function: HandleValue<'_>, ) -> Option<Vec<String>>
Get the parameter names of a debuggee function, using the callback registered by debugger.js.
Returns None if no callback has been registered or the callback fails.
Trait Implementations§
§impl Castable for DebuggerGlobalScope
impl Castable for DebuggerGlobalScope
Source§impl DebuggerGlobalScopeMethods<DomTypeHolder> for DebuggerGlobalScope
impl DebuggerGlobalScopeMethods<DomTypeHolder> for DebuggerGlobalScope
Source§fn EvalResult(&self, _event: &DebuggerEvalEvent, result: &EvalResult)
fn EvalResult(&self, _event: &DebuggerEvalEvent, result: &EvalResult)
Handle the result from debugger.js executeInGlobal() call.
The result contains completion value information from the SpiderMonkey Debugger API: https://firefox-source-docs.mozilla.org/js/Debugger/Conventions.html#completion-values
fn NotifyNewSource(&self, args: &NotifyNewSource)
fn GetPossibleBreakpointsResult( &self, event: &DebuggerGetPossibleBreakpointsEvent, result: Vec<RecommendedBreakpointLocation>, )
fn RegisterObjectActor(&self, serialized_value: DOMString) -> Option<DOMString>
fn PauseAndRespond( &self, pipeline_id: &PipelineIdInit, frame_offset: &FrameOffset, pause_reason: &PauseReason, )
fn RegisterFrameActor( &self, pipeline_id: &PipelineIdInit, result: &FrameInfo, ) -> Option<DOMString>
fn ListFramesResult(&self, frame_actor_ids: Vec<DOMString>)
fn RegisterEnvironmentActor( &self, environment: &EnvironmentInfo, parent: Option<DOMString>, actor: Option<DOMString>, ) -> Option<DOMString>
fn SetGetFunctionParameterNamesCallback( &self, callback: RootedCallback<GetFunctionParameterNames<DomTypeHolder>>, )
fn GetEnvironmentResult(&self, environment_actor_id: DOMString)
impl DerivedFrom<EventTarget> for DebuggerGlobalScope
impl DerivedFrom<GlobalScope> for DebuggerGlobalScope
Source§impl DomObject for DebuggerGlobalScope
impl DomObject for DebuggerGlobalScope
type ReflectorType = <GlobalScope as DomObject>::ReflectorType
Source§fn reflector(&self) -> &Reflector<Self::ReflectorType>
fn reflector(&self) -> &Reflector<Self::ReflectorType>
Source§impl Drop for DebuggerGlobalScope
impl Drop for DebuggerGlobalScope
impl Eq for DebuggerGlobalScope
Source§impl HasOrigin for DebuggerGlobalScope
impl HasOrigin for DebuggerGlobalScope
fn origin(&self) -> MutableOrigin
Source§impl HasParent for DebuggerGlobalScope
impl HasParent for DebuggerGlobalScope
Source§fn as_parent(&self) -> &GlobalScope
fn as_parent(&self) -> &GlobalScope
This is used in a type assertion to ensure that the source and webidls agree as to what the parent type is
type Parent = GlobalScope
Source§impl HasPrototype for DebuggerGlobalScope
impl HasPrototype for DebuggerGlobalScope
const PROTOTYPE_ID: ID = script_bindings::codegen::PrototypeList::ID::DebuggerGlobalScope
Source§impl IDLInterface for DebuggerGlobalScope
impl IDLInterface for DebuggerGlobalScope
Source§const PROTO_ID: ID = PrototypeList::ID::DebuggerGlobalScope
const PROTO_ID: ID = PrototypeList::ID::DebuggerGlobalScope
Source§const PROTO_FIRST: u16 = 196
const PROTO_FIRST: u16 = 196
Source§const PROTO_LAST: u16 = 196
const PROTO_LAST: u16 = 196
Source§impl MallocSizeOf for DebuggerGlobalScope
impl MallocSizeOf for DebuggerGlobalScope
Source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
Source§impl MutDomObject for DebuggerGlobalScope
impl MutDomObject for DebuggerGlobalScope
Source§impl PartialEq for DebuggerGlobalScope
impl PartialEq for DebuggerGlobalScope
Source§impl PrototypeInitializer for DebuggerGlobalScope
impl PrototypeInitializer for DebuggerGlobalScope
fn set_proto_id(&mut self, id: ID)
Source§impl ToJSValConvertible for DebuggerGlobalScope
impl ToJSValConvertible for DebuggerGlobalScope
Source§fn to_jsval(&self, cx: &mut JSContext, rval: MutableHandleValue<'_>)
fn to_jsval(&self, cx: &mut JSContext, rval: MutableHandleValue<'_>)
self to a JSVal. JSAPI failure causes a panic.Auto Trait Implementations§
impl !Freeze for DebuggerGlobalScope
impl !RefUnwindSafe for DebuggerGlobalScope
impl !Send for DebuggerGlobalScope
impl !Sync for DebuggerGlobalScope
impl !UnwindSafe for DebuggerGlobalScope
impl Unpin for DebuggerGlobalScope
impl UnsafeUnpin for DebuggerGlobalScope
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<D, T> DomGlobalGeneric<D> for T
impl<D, T> DomGlobalGeneric<D> for T
Source§fn global_from_reflector(&self) -> Root<Dom<<D as DomTypes>::GlobalScope>>where
Self: Sized,
fn global_from_reflector(&self) -> Root<Dom<<D as DomTypes>::GlobalScope>>where
Self: Sized,
GlobalScope] of the realm that the DomObject was created in. If this
object is a Node, this will be different from it’s owning Document if adopted by. For
Nodes it’s almost always better to use NodeTraits::owning_global.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more