mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
More CanGc fixes: Range, Event, gpu error, Header (#33774)
* Propagate CanGc parameter in Range Signed-off-by: webbeef <me@webbeef.org> * Propagate CanGc parameter in gpu code and dependencies Signed-off-by: webbeef <me@webbeef.org> * Propagate CanGc parameter in Header and dependencies Signed-off-by: webbeef <me@webbeef.org> * Propagate CanGc parameter in Event and dependencies Signed-off-by: webbeef <me@webbeef.org> * Propagate CanGc parameter in rtcdatachannel Signed-off-by: webbeef <me@webbeef.org> * Propagate CanGc parameter in servoparser Signed-off-by: webbeef <me@webbeef.org> --------- Signed-off-by: webbeef <me@webbeef.org>
This commit is contained in:
parent
8c56cbdab2
commit
f9a06d62a2
17 changed files with 92 additions and 85 deletions
|
@ -117,6 +117,7 @@ impl RTCDataChannel {
|
|||
atom!("open"),
|
||||
EventBubbles::DoesNotBubble,
|
||||
EventCancelable::NotCancelable,
|
||||
CanGc::note(),
|
||||
);
|
||||
event.upcast::<Event>().fire(self.upcast());
|
||||
}
|
||||
|
@ -127,6 +128,7 @@ impl RTCDataChannel {
|
|||
atom!("close"),
|
||||
EventBubbles::DoesNotBubble,
|
||||
EventCancelable::NotCancelable,
|
||||
CanGc::note(),
|
||||
);
|
||||
event.upcast::<Event>().fire(self.upcast());
|
||||
|
||||
|
@ -134,7 +136,7 @@ impl RTCDataChannel {
|
|||
.unregister_data_channel(&self.servo_media_id);
|
||||
}
|
||||
|
||||
pub fn on_error(&self, error: WebRtcError) {
|
||||
pub fn on_error(&self, error: WebRtcError, can_gc: CanGc) {
|
||||
let global = self.global();
|
||||
let cx = GlobalScope::get_cx();
|
||||
let _ac = JSAutoRealm::new(*cx, self.reflector().get_jsobject().get());
|
||||
|
@ -150,7 +152,7 @@ impl RTCDataChannel {
|
|||
WebRtcError::Backend(message) => DOMString::from(message),
|
||||
};
|
||||
let error = RTCError::new(&global, &init, message);
|
||||
let event = RTCErrorEvent::new(&global, atom!("error"), false, false, &error);
|
||||
let event = RTCErrorEvent::new(&global, atom!("error"), false, false, &error, can_gc);
|
||||
event.upcast::<Event>().fire(self.upcast());
|
||||
}
|
||||
|
||||
|
@ -201,13 +203,14 @@ impl RTCDataChannel {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn on_state_change(&self, state: DataChannelState) {
|
||||
pub fn on_state_change(&self, state: DataChannelState, can_gc: CanGc) {
|
||||
if let DataChannelState::Closing = state {
|
||||
let event = Event::new(
|
||||
&self.global(),
|
||||
atom!("closing"),
|
||||
EventBubbles::DoesNotBubble,
|
||||
EventCancelable::NotCancelable,
|
||||
can_gc,
|
||||
);
|
||||
event.upcast::<Event>().fire(self.upcast());
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue