mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Make generated proxy handlers and DOM object hooks generic (#35292)
* script: Make DOM proxy handlers generic over DOM types. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Make finalize and trace hooks generic over DOM types. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
parent
1e164738d8
commit
2bd96633d4
7 changed files with 72 additions and 46 deletions
|
@ -319,7 +319,12 @@ impl DedicatedWorkerGlobalScope {
|
|||
control_receiver,
|
||||
insecure_requests_policy,
|
||||
));
|
||||
unsafe { DedicatedWorkerGlobalScopeBinding::Wrap(SafeJSContext::from_ptr(cx), scope) }
|
||||
unsafe {
|
||||
DedicatedWorkerGlobalScopeBinding::Wrap::<crate::DomTypeHolder>(
|
||||
SafeJSContext::from_ptr(cx),
|
||||
scope,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
/// <https://html.spec.whatwg.org/multipage/#run-a-worker>
|
||||
|
|
|
@ -74,7 +74,7 @@ impl DissimilarOriginWindow {
|
|||
window_proxy: Dom::from_ref(window_proxy),
|
||||
location: Default::default(),
|
||||
});
|
||||
unsafe { DissimilarOriginWindowBinding::Wrap(cx, win) }
|
||||
unsafe { DissimilarOriginWindowBinding::Wrap::<crate::DomTypeHolder>(cx, win) }
|
||||
}
|
||||
|
||||
pub(crate) fn window_proxy(&self) -> DomRoot<WindowProxy> {
|
||||
|
|
|
@ -120,7 +120,12 @@ impl PaintWorkletGlobalScope {
|
|||
missing_image_urls: Vec::new(),
|
||||
}),
|
||||
});
|
||||
unsafe { PaintWorkletGlobalScopeBinding::Wrap(JSContext::from_ptr(runtime.cx()), global) }
|
||||
unsafe {
|
||||
PaintWorkletGlobalScopeBinding::Wrap::<crate::DomTypeHolder>(
|
||||
JSContext::from_ptr(runtime.cx()),
|
||||
global,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn image_cache(&self) -> Arc<dyn ImageCache> {
|
||||
|
|
|
@ -266,7 +266,12 @@ impl ServiceWorkerGlobalScope {
|
|||
control_receiver,
|
||||
closing,
|
||||
));
|
||||
unsafe { ServiceWorkerGlobalScopeBinding::Wrap(SafeJSContext::from_ptr(cx), scope) }
|
||||
unsafe {
|
||||
ServiceWorkerGlobalScopeBinding::Wrap::<crate::DomTypeHolder>(
|
||||
SafeJSContext::from_ptr(cx),
|
||||
scope,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
/// <https://w3c.github.io/ServiceWorker/#run-service-worker-algorithm>
|
||||
|
|
|
@ -51,7 +51,12 @@ impl TestWorkletGlobalScope {
|
|||
),
|
||||
lookup_table: Default::default(),
|
||||
});
|
||||
unsafe { TestWorkletGlobalScopeBinding::Wrap(JSContext::from_ptr(runtime.cx()), global) }
|
||||
unsafe {
|
||||
TestWorkletGlobalScopeBinding::Wrap::<crate::DomTypeHolder>(
|
||||
JSContext::from_ptr(runtime.cx()),
|
||||
global,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn perform_a_worklet_task(&self, task: TestWorkletTask) {
|
||||
|
|
|
@ -2874,7 +2874,9 @@ impl Window {
|
|||
theme: Cell::new(PrefersColorScheme::Light),
|
||||
});
|
||||
|
||||
unsafe { WindowBinding::Wrap(JSContext::from_ptr(runtime.cx()), win) }
|
||||
unsafe {
|
||||
WindowBinding::Wrap::<crate::DomTypeHolder>(JSContext::from_ptr(runtime.cx()), win)
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn pipeline_id(&self) -> PipelineId {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue