mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
rename compartment to realm
This commit is contained in:
parent
be409233fd
commit
5a3e1b8e69
54 changed files with 226 additions and 259 deletions
|
@ -2,7 +2,6 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use crate::compartments::InCompartment;
|
||||
use crate::dom::bindings::cell::DomRefCell;
|
||||
use crate::dom::bindings::codegen::Bindings::RTCIceCandidateBinding::RTCIceCandidateInit;
|
||||
use crate::dom::bindings::codegen::Bindings::RTCPeerConnectionBinding;
|
||||
|
@ -33,6 +32,7 @@ use crate::dom::rtcpeerconnectioniceevent::RTCPeerConnectionIceEvent;
|
|||
use crate::dom::rtcsessiondescription::RTCSessionDescription;
|
||||
use crate::dom::rtctrackevent::RTCTrackEvent;
|
||||
use crate::dom::window::Window;
|
||||
use crate::realms::InRealm;
|
||||
use crate::task::TaskCanceller;
|
||||
use crate::task_source::networking::NetworkingTaskSource;
|
||||
use crate::task_source::TaskSource;
|
||||
|
@ -454,8 +454,8 @@ impl RTCPeerConnectionMethods for RTCPeerConnection {
|
|||
);
|
||||
|
||||
/// https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnection-addicecandidate
|
||||
fn AddIceCandidate(&self, candidate: &RTCIceCandidateInit, comp: InCompartment) -> Rc<Promise> {
|
||||
let p = Promise::new_in_current_compartment(&self.global(), comp);
|
||||
fn AddIceCandidate(&self, candidate: &RTCIceCandidateInit, comp: InRealm) -> Rc<Promise> {
|
||||
let p = Promise::new_in_current_realm(&self.global(), comp);
|
||||
if candidate.sdpMid.is_none() && candidate.sdpMLineIndex.is_none() {
|
||||
p.reject_error(Error::Type(format!(
|
||||
"one of sdpMid and sdpMLineIndex must be set"
|
||||
|
@ -489,8 +489,8 @@ impl RTCPeerConnectionMethods for RTCPeerConnection {
|
|||
}
|
||||
|
||||
/// https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnection-createoffer
|
||||
fn CreateOffer(&self, _options: &RTCOfferOptions, comp: InCompartment) -> Rc<Promise> {
|
||||
let p = Promise::new_in_current_compartment(&self.global(), comp);
|
||||
fn CreateOffer(&self, _options: &RTCOfferOptions, comp: InRealm) -> Rc<Promise> {
|
||||
let p = Promise::new_in_current_realm(&self.global(), comp);
|
||||
if self.closed.get() {
|
||||
p.reject_error(Error::InvalidState);
|
||||
return p;
|
||||
|
@ -501,8 +501,8 @@ impl RTCPeerConnectionMethods for RTCPeerConnection {
|
|||
}
|
||||
|
||||
/// https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnection-createoffer
|
||||
fn CreateAnswer(&self, _options: &RTCAnswerOptions, comp: InCompartment) -> Rc<Promise> {
|
||||
let p = Promise::new_in_current_compartment(&self.global(), comp);
|
||||
fn CreateAnswer(&self, _options: &RTCAnswerOptions, comp: InRealm) -> Rc<Promise> {
|
||||
let p = Promise::new_in_current_realm(&self.global(), comp);
|
||||
if self.closed.get() {
|
||||
p.reject_error(Error::InvalidState);
|
||||
return p;
|
||||
|
@ -523,13 +523,9 @@ impl RTCPeerConnectionMethods for RTCPeerConnection {
|
|||
}
|
||||
|
||||
/// https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnection-setlocaldescription
|
||||
fn SetLocalDescription(
|
||||
&self,
|
||||
desc: &RTCSessionDescriptionInit,
|
||||
comp: InCompartment,
|
||||
) -> Rc<Promise> {
|
||||
fn SetLocalDescription(&self, desc: &RTCSessionDescriptionInit, comp: InRealm) -> Rc<Promise> {
|
||||
// XXXManishearth validate the current state
|
||||
let p = Promise::new_in_current_compartment(&self.global(), comp);
|
||||
let p = Promise::new_in_current_realm(&self.global(), comp);
|
||||
let this = Trusted::new(self);
|
||||
let desc: SessionDescription = desc.into();
|
||||
let trusted_promise = TrustedPromise::new(p.clone());
|
||||
|
@ -560,13 +556,9 @@ impl RTCPeerConnectionMethods for RTCPeerConnection {
|
|||
}
|
||||
|
||||
/// https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnection-setremotedescription
|
||||
fn SetRemoteDescription(
|
||||
&self,
|
||||
desc: &RTCSessionDescriptionInit,
|
||||
comp: InCompartment,
|
||||
) -> Rc<Promise> {
|
||||
fn SetRemoteDescription(&self, desc: &RTCSessionDescriptionInit, comp: InRealm) -> Rc<Promise> {
|
||||
// XXXManishearth validate the current state
|
||||
let p = Promise::new_in_current_compartment(&self.global(), comp);
|
||||
let p = Promise::new_in_current_realm(&self.global(), comp);
|
||||
let this = Trusted::new(self);
|
||||
let desc: SessionDescription = desc.into();
|
||||
let trusted_promise = TrustedPromise::new(p.clone());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue