diff options
author | Aron Zwaan <aronzwaan@gmail.com> | 2019-03-30 21:03:20 +0100 |
---|---|---|
committer | Aron Zwaan <aronzwaan@gmail.com> | 2019-04-03 20:45:30 +0200 |
commit | 782b58587acc754c7b378a84a4b51405738bb081 (patch) | |
tree | a530be8317cbda75e8d81679a7abc9fbd6379541 /components/script/dom/rtcpeerconnection.rs | |
parent | 6fa1853bb1e9bc80271c5259a8d2ed7799a0d6ff (diff) | |
download | servo-782b58587acc754c7b378a84a4b51405738bb081.tar.gz servo-782b58587acc754c7b378a84a4b51405738bb081.zip |
Rename Promise::new to Promise::new_in_current_compartment
Diffstat (limited to 'components/script/dom/rtcpeerconnection.rs')
-rw-r--r-- | components/script/dom/rtcpeerconnection.rs | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/components/script/dom/rtcpeerconnection.rs b/components/script/dom/rtcpeerconnection.rs index e4948e08d8e..a0a1cfbb6e9 100644 --- a/components/script/dom/rtcpeerconnection.rs +++ b/components/script/dom/rtcpeerconnection.rs @@ -429,8 +429,9 @@ impl RTCPeerConnectionMethods for RTCPeerConnection { ); /// https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnection-addicecandidate + #[allow(unsafe_code)] fn AddIceCandidate(&self, candidate: &RTCIceCandidateInit) -> Rc<Promise> { - let p = Promise::new(&self.global()); + let p = unsafe { Promise::new_in_current_compartment(&self.global()) }; if candidate.sdpMid.is_none() && candidate.sdpMLineIndex.is_none() { p.reject_error(Error::Type(format!( "one of sdpMid and sdpMLineIndex must be set" @@ -464,8 +465,9 @@ impl RTCPeerConnectionMethods for RTCPeerConnection { } /// https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnection-createoffer + #[allow(unsafe_code)] fn CreateOffer(&self, _options: &RTCOfferOptions) -> Rc<Promise> { - let p = Promise::new(&self.global()); + let p = unsafe { Promise::new_in_current_compartment(&self.global()) }; if self.closed.get() { p.reject_error(Error::InvalidState); return p; @@ -476,8 +478,9 @@ impl RTCPeerConnectionMethods for RTCPeerConnection { } /// https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnection-createoffer + #[allow(unsafe_code)] fn CreateAnswer(&self, _options: &RTCAnswerOptions) -> Rc<Promise> { - let p = Promise::new(&self.global()); + let p = unsafe { Promise::new_in_current_compartment(&self.global()) }; if self.closed.get() { p.reject_error(Error::InvalidState); return p; @@ -498,9 +501,10 @@ impl RTCPeerConnectionMethods for RTCPeerConnection { } /// https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnection-setlocaldescription + #[allow(unsafe_code)] fn SetLocalDescription(&self, desc: &RTCSessionDescriptionInit) -> Rc<Promise> { // XXXManishearth validate the current state - let p = Promise::new(&self.global()); + let p = unsafe { Promise::new_in_current_compartment(&self.global()) }; let this = Trusted::new(self); let desc: SessionDescription = desc.into(); let trusted_promise = TrustedPromise::new(p.clone()); @@ -531,9 +535,10 @@ impl RTCPeerConnectionMethods for RTCPeerConnection { } /// https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnection-setremotedescription + #[allow(unsafe_code)] fn SetRemoteDescription(&self, desc: &RTCSessionDescriptionInit) -> Rc<Promise> { // XXXManishearth validate the current state - let p = Promise::new(&self.global()); + let p = unsafe { Promise::new_in_current_compartment(&self.global()) }; let this = Trusted::new(self); let desc: SessionDescription = desc.into(); let trusted_promise = TrustedPromise::new(p.clone()); |