mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
CanGc fixes originating from gamepadevent.rs
& stereopannernode.rs
(#33828)
* CanGc fixes originating from gamepadevent.rs & stereopannernode.rs Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com> * Revert changes within task! macro Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com> --------- Signed-off-by: taniishkaaa <tanishkasingh2004@gmail.com>
This commit is contained in:
parent
2322b22a6b
commit
cfd15dd14d
5 changed files with 10 additions and 14 deletions
|
@ -381,11 +381,12 @@ impl BaseAudioContextMethods for BaseAudioContext {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <https://webaudio.github.io/web-audio-api/#dom-baseaudiocontext-createstereopanner>
|
/// <https://webaudio.github.io/web-audio-api/#dom-baseaudiocontext-createstereopanner>
|
||||||
fn CreateStereoPanner(&self) -> Fallible<DomRoot<StereoPannerNode>> {
|
fn CreateStereoPanner(&self, can_gc: CanGc) -> Fallible<DomRoot<StereoPannerNode>> {
|
||||||
StereoPannerNode::new(
|
StereoPannerNode::new(
|
||||||
self.global().as_window(),
|
self.global().as_window(),
|
||||||
self,
|
self,
|
||||||
&StereoPannerOptions::empty(),
|
&StereoPannerOptions::empty(),
|
||||||
|
can_gc,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ DOMInterfaces = {
|
||||||
|
|
||||||
'BaseAudioContext': {
|
'BaseAudioContext': {
|
||||||
'inRealms': ['DecodeAudioData', 'Resume', 'ParseFromString', 'GetBounds', 'GetClientRects'],
|
'inRealms': ['DecodeAudioData', 'Resume', 'ParseFromString', 'GetBounds', 'GetClientRects'],
|
||||||
'canGc': ['CreateOscillator'],
|
'canGc': ['CreateOscillator', 'CreateStereoPanner'],
|
||||||
},
|
},
|
||||||
|
|
||||||
'Blob': {
|
'Blob': {
|
||||||
|
|
|
@ -246,7 +246,7 @@ impl Gamepad {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn notify_event(&self, event_type: GamepadEventType) {
|
pub fn notify_event(&self, event_type: GamepadEventType) {
|
||||||
let event = GamepadEvent::new_with_type(&self.global(), event_type, self);
|
let event = GamepadEvent::new_with_type(&self.global(), event_type, self, CanGc::note());
|
||||||
event
|
event
|
||||||
.upcast::<Event>()
|
.upcast::<Event>()
|
||||||
.fire(self.global().as_window().upcast::<EventTarget>());
|
.fire(self.global().as_window().upcast::<EventTarget>());
|
||||||
|
|
|
@ -45,16 +45,9 @@ impl GamepadEvent {
|
||||||
bubbles: bool,
|
bubbles: bool,
|
||||||
cancelable: bool,
|
cancelable: bool,
|
||||||
gamepad: &Gamepad,
|
gamepad: &Gamepad,
|
||||||
|
can_gc: CanGc,
|
||||||
) -> DomRoot<GamepadEvent> {
|
) -> DomRoot<GamepadEvent> {
|
||||||
Self::new_with_proto(
|
Self::new_with_proto(global, None, type_, bubbles, cancelable, gamepad, can_gc)
|
||||||
global,
|
|
||||||
None,
|
|
||||||
type_,
|
|
||||||
bubbles,
|
|
||||||
cancelable,
|
|
||||||
gamepad,
|
|
||||||
CanGc::note(),
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn new_with_proto(
|
fn new_with_proto(
|
||||||
|
@ -83,13 +76,14 @@ impl GamepadEvent {
|
||||||
global: &GlobalScope,
|
global: &GlobalScope,
|
||||||
event_type: GamepadEventType,
|
event_type: GamepadEventType,
|
||||||
gamepad: &Gamepad,
|
gamepad: &Gamepad,
|
||||||
|
can_gc: CanGc,
|
||||||
) -> DomRoot<GamepadEvent> {
|
) -> DomRoot<GamepadEvent> {
|
||||||
let name = match event_type {
|
let name = match event_type {
|
||||||
GamepadEventType::Connected => "gamepadconnected",
|
GamepadEventType::Connected => "gamepadconnected",
|
||||||
GamepadEventType::Disconnected => "gamepaddisconnected",
|
GamepadEventType::Disconnected => "gamepaddisconnected",
|
||||||
};
|
};
|
||||||
|
|
||||||
GamepadEvent::new(global, name.into(), false, false, gamepad)
|
GamepadEvent::new(global, name.into(), false, false, gamepad, can_gc)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -78,8 +78,9 @@ impl StereoPannerNode {
|
||||||
window: &Window,
|
window: &Window,
|
||||||
context: &BaseAudioContext,
|
context: &BaseAudioContext,
|
||||||
options: &StereoPannerOptions,
|
options: &StereoPannerOptions,
|
||||||
|
can_gc: CanGc,
|
||||||
) -> Fallible<DomRoot<StereoPannerNode>> {
|
) -> Fallible<DomRoot<StereoPannerNode>> {
|
||||||
Self::new_with_proto(window, None, context, options, CanGc::note())
|
Self::new_with_proto(window, None, context, options, can_gc)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(crown::unrooted_must_root)]
|
#[allow(crown::unrooted_must_root)]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue