aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/rtcdatachannel.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom/rtcdatachannel.rs')
-rw-r--r--components/script/dom/rtcdatachannel.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/components/script/dom/rtcdatachannel.rs b/components/script/dom/rtcdatachannel.rs
index 9b1a9c6f9ef..df473399c4a 100644
--- a/components/script/dom/rtcdatachannel.rs
+++ b/components/script/dom/rtcdatachannel.rs
@@ -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());
};