Create source actors from Debugger API notifications

Co-authored-by: atbrakhi <atbrakhi@igalia.com>
Signed-off-by: Delan Azabani <dazabani@igalia.com>
This commit is contained in:
Delan Azabani 2025-07-29 18:45:20 +08:00
parent 92a9d24a13
commit 411cd93ac5
13 changed files with 194 additions and 65 deletions

View file

@ -0,0 +1,52 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use std::cell::Cell;
use dom_struct::dom_struct;
use js::rust::HandleObject;
use crate::dom::bindings::codegen::Bindings::DebuggerEventBinding::PipelineIdMethods;
use crate::dom::bindings::error::Fallible;
use crate::dom::bindings::reflector::{
Reflector, reflect_dom_object, reflect_dom_object_with_proto,
};
use crate::dom::bindings::root::DomRoot;
use crate::dom::globalscope::GlobalScope;
use crate::script_runtime::CanGc;
#[dom_struct]
pub(crate) struct PipelineId {
reflector_: Reflector,
#[no_trace]
inner: base::id::PipelineId,
}
impl PipelineId {
pub(crate) fn new(
global: &GlobalScope,
pipeline_id: base::id::PipelineId,
can_gc: CanGc,
) -> DomRoot<Self> {
reflect_dom_object(
Box::new(Self {
reflector_: Reflector::new(),
inner: pipeline_id,
}),
global,
can_gc,
)
}
}
impl PipelineIdMethods<crate::DomTypeHolder> for PipelineId {
// check-tidy: no specs after this line
fn NamespaceId(&self) -> u32 {
self.inner.namespace_id.0
}
fn Index(&self) -> u32 {
self.inner.index.0.get()
}
}