mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Remove now-unnecessary must_root and allow(unrooted_must_root) annotations
This commit is contained in:
parent
6df1c6d7e7
commit
611dc4bc70
28 changed files with 2 additions and 67 deletions
|
@ -107,7 +107,6 @@ impl AudioContextMethods for AudioContext {
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://webaudio.github.io/web-audio-api/#dom-audiocontext-suspend
|
// https://webaudio.github.io/web-audio-api/#dom-audiocontext-suspend
|
||||||
#[allow(unrooted_must_root)]
|
|
||||||
fn Suspend(&self) -> Rc<Promise> {
|
fn Suspend(&self) -> Rc<Promise> {
|
||||||
// Step 1.
|
// Step 1.
|
||||||
let promise = Promise::new(&self.global());
|
let promise = Promise::new(&self.global());
|
||||||
|
@ -169,7 +168,6 @@ impl AudioContextMethods for AudioContext {
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://webaudio.github.io/web-audio-api/#dom-audiocontext-close
|
// https://webaudio.github.io/web-audio-api/#dom-audiocontext-close
|
||||||
#[allow(unrooted_must_root)]
|
|
||||||
fn Close(&self) -> Rc<Promise> {
|
fn Close(&self) -> Rc<Promise> {
|
||||||
// Step 1.
|
// Step 1.
|
||||||
let promise = Promise::new(&self.global());
|
let promise = Promise::new(&self.global());
|
||||||
|
|
|
@ -62,7 +62,6 @@ pub enum BaseAudioContextOptions {
|
||||||
OfflineAudioContext(OfflineAudioContextOptions),
|
OfflineAudioContext(OfflineAudioContextOptions),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[must_root]
|
|
||||||
#[derive(JSTraceable)]
|
#[derive(JSTraceable)]
|
||||||
struct DecodeResolver {
|
struct DecodeResolver {
|
||||||
pub promise: Rc<Promise>,
|
pub promise: Rc<Promise>,
|
||||||
|
@ -147,7 +146,6 @@ impl BaseAudioContext {
|
||||||
self.state.get() == AudioContextState::Suspended
|
self.state.get() == AudioContextState::Suspended
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unrooted_must_root)]
|
|
||||||
fn push_pending_resume_promise(&self, promise: &Rc<Promise>) {
|
fn push_pending_resume_promise(&self, promise: &Rc<Promise>) {
|
||||||
self.pending_resume_promises
|
self.pending_resume_promises
|
||||||
.borrow_mut()
|
.borrow_mut()
|
||||||
|
@ -164,7 +162,6 @@ impl BaseAudioContext {
|
||||||
/// Each call to this method must be followed by a call to
|
/// Each call to this method must be followed by a call to
|
||||||
/// `fulfill_in_flight_resume_promises`, to actually fulfill the promises
|
/// `fulfill_in_flight_resume_promises`, to actually fulfill the promises
|
||||||
/// which were taken and moved to the in-flight queue.
|
/// which were taken and moved to the in-flight queue.
|
||||||
#[allow(unrooted_must_root)]
|
|
||||||
fn take_pending_resume_promises(&self, result: ErrorResult) {
|
fn take_pending_resume_promises(&self, result: ErrorResult) {
|
||||||
let pending_resume_promises =
|
let pending_resume_promises =
|
||||||
mem::replace(&mut *self.pending_resume_promises.borrow_mut(), vec![]);
|
mem::replace(&mut *self.pending_resume_promises.borrow_mut(), vec![]);
|
||||||
|
@ -271,7 +268,6 @@ impl BaseAudioContextMethods for BaseAudioContext {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// https://webaudio.github.io/web-audio-api/#dom-baseaudiocontext-resume
|
/// https://webaudio.github.io/web-audio-api/#dom-baseaudiocontext-resume
|
||||||
#[allow(unrooted_must_root)]
|
|
||||||
fn Resume(&self) -> Rc<Promise> {
|
fn Resume(&self) -> Rc<Promise> {
|
||||||
// Step 1.
|
// Step 1.
|
||||||
let promise = Promise::new(&self.global());
|
let promise = Promise::new(&self.global());
|
||||||
|
@ -397,7 +393,6 @@ impl BaseAudioContextMethods for BaseAudioContext {
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://webaudio.github.io/web-audio-api/#dom-baseaudiocontext-decodeaudiodata
|
// https://webaudio.github.io/web-audio-api/#dom-baseaudiocontext-decodeaudiodata
|
||||||
#[allow(unrooted_must_root)]
|
|
||||||
fn DecodeAudioData(
|
fn DecodeAudioData(
|
||||||
&self,
|
&self,
|
||||||
audio_data: CustomAutoRooterGuard<ArrayBuffer>,
|
audio_data: CustomAutoRooterGuard<ArrayBuffer>,
|
||||||
|
|
|
@ -91,7 +91,6 @@ impl TrustedPromise {
|
||||||
/// Obtain a usable DOM Promise from a pinned `TrustedPromise` value. Fails if used on
|
/// Obtain a usable DOM Promise from a pinned `TrustedPromise` value. Fails if used on
|
||||||
/// a different thread than the original value from which this `TrustedPromise` was
|
/// a different thread than the original value from which this `TrustedPromise` was
|
||||||
/// obtained.
|
/// obtained.
|
||||||
#[allow(unrooted_must_root)]
|
|
||||||
pub fn root(self) -> Rc<Promise> {
|
pub fn root(self) -> Rc<Promise> {
|
||||||
LIVE_REFERENCES.with(|ref r| {
|
LIVE_REFERENCES.with(|ref r| {
|
||||||
let r = r.borrow();
|
let r = r.borrow();
|
||||||
|
|
|
@ -277,7 +277,6 @@ pub fn response_async<T: AsyncBluetoothListener + DomObject + 'static>(
|
||||||
action_sender
|
action_sender
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unrooted_must_root)]
|
|
||||||
// https://webbluetoothcg.github.io/web-bluetooth/#getgattchildren
|
// https://webbluetoothcg.github.io/web-bluetooth/#getgattchildren
|
||||||
pub fn get_gatt_children<T, F>(
|
pub fn get_gatt_children<T, F>(
|
||||||
attribute: &T,
|
attribute: &T,
|
||||||
|
@ -530,7 +529,6 @@ impl From<BluetoothError> for Error {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl BluetoothMethods for Bluetooth {
|
impl BluetoothMethods for Bluetooth {
|
||||||
#[allow(unrooted_must_root)]
|
|
||||||
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetooth-requestdevice
|
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetooth-requestdevice
|
||||||
fn RequestDevice(&self, option: &RequestDeviceOptions) -> Rc<Promise> {
|
fn RequestDevice(&self, option: &RequestDeviceOptions) -> Rc<Promise> {
|
||||||
let p = Promise::new(&self.global());
|
let p = Promise::new(&self.global());
|
||||||
|
@ -549,7 +547,6 @@ impl BluetoothMethods for Bluetooth {
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unrooted_must_root)]
|
|
||||||
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetooth-getavailability
|
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetooth-getavailability
|
||||||
fn GetAvailability(&self) -> Rc<Promise> {
|
fn GetAvailability(&self) -> Rc<Promise> {
|
||||||
let p = Promise::new(&self.global());
|
let p = Promise::new(&self.global());
|
||||||
|
|
|
@ -276,7 +276,6 @@ impl BluetoothDeviceMethods for BluetoothDevice {
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unrooted_must_root)]
|
|
||||||
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothdevice-watchadvertisements
|
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothdevice-watchadvertisements
|
||||||
fn WatchAdvertisements(&self) -> Rc<Promise> {
|
fn WatchAdvertisements(&self) -> Rc<Promise> {
|
||||||
let p = Promise::new(&self.global());
|
let p = Promise::new(&self.global());
|
||||||
|
|
|
@ -102,7 +102,6 @@ impl BluetoothRemoteGATTCharacteristicMethods for BluetoothRemoteGATTCharacteris
|
||||||
self.uuid.clone()
|
self.uuid.clone()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unrooted_must_root)]
|
|
||||||
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattcharacteristic-getdescriptor
|
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattcharacteristic-getdescriptor
|
||||||
fn GetDescriptor(&self, descriptor: BluetoothDescriptorUUID) -> Rc<Promise> {
|
fn GetDescriptor(&self, descriptor: BluetoothDescriptorUUID) -> Rc<Promise> {
|
||||||
get_gatt_children(
|
get_gatt_children(
|
||||||
|
@ -116,7 +115,6 @@ impl BluetoothRemoteGATTCharacteristicMethods for BluetoothRemoteGATTCharacteris
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unrooted_must_root)]
|
|
||||||
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattcharacteristic-getdescriptors
|
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattcharacteristic-getdescriptors
|
||||||
fn GetDescriptors(&self, descriptor: Option<BluetoothDescriptorUUID>) -> Rc<Promise> {
|
fn GetDescriptors(&self, descriptor: Option<BluetoothDescriptorUUID>) -> Rc<Promise> {
|
||||||
get_gatt_children(
|
get_gatt_children(
|
||||||
|
@ -135,7 +133,6 @@ impl BluetoothRemoteGATTCharacteristicMethods for BluetoothRemoteGATTCharacteris
|
||||||
self.value.borrow().clone()
|
self.value.borrow().clone()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unrooted_must_root)]
|
|
||||||
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattcharacteristic-readvalue
|
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattcharacteristic-readvalue
|
||||||
fn ReadValue(&self) -> Rc<Promise> {
|
fn ReadValue(&self) -> Rc<Promise> {
|
||||||
let p = Promise::new(&self.global());
|
let p = Promise::new(&self.global());
|
||||||
|
@ -169,7 +166,6 @@ impl BluetoothRemoteGATTCharacteristicMethods for BluetoothRemoteGATTCharacteris
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unrooted_must_root)]
|
|
||||||
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattcharacteristic-writevalue
|
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattcharacteristic-writevalue
|
||||||
fn WriteValue(&self, value: ArrayBufferViewOrArrayBuffer) -> Rc<Promise> {
|
fn WriteValue(&self, value: ArrayBufferViewOrArrayBuffer) -> Rc<Promise> {
|
||||||
let p = Promise::new(&self.global());
|
let p = Promise::new(&self.global());
|
||||||
|
@ -221,7 +217,6 @@ impl BluetoothRemoteGATTCharacteristicMethods for BluetoothRemoteGATTCharacteris
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unrooted_must_root)]
|
|
||||||
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattcharacteristic-startnotifications
|
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattcharacteristic-startnotifications
|
||||||
fn StartNotifications(&self) -> Rc<Promise> {
|
fn StartNotifications(&self) -> Rc<Promise> {
|
||||||
let p = Promise::new(&self.global());
|
let p = Promise::new(&self.global());
|
||||||
|
@ -259,7 +254,6 @@ impl BluetoothRemoteGATTCharacteristicMethods for BluetoothRemoteGATTCharacteris
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unrooted_must_root)]
|
|
||||||
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattcharacteristic-stopnotifications
|
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattcharacteristic-stopnotifications
|
||||||
fn StopNotifications(&self) -> Rc<Promise> {
|
fn StopNotifications(&self) -> Rc<Promise> {
|
||||||
let p = Promise::new(&self.global());
|
let p = Promise::new(&self.global());
|
||||||
|
|
|
@ -92,7 +92,6 @@ impl BluetoothRemoteGATTDescriptorMethods for BluetoothRemoteGATTDescriptor {
|
||||||
self.value.borrow().clone()
|
self.value.borrow().clone()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unrooted_must_root)]
|
|
||||||
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattdescriptor-readvalue
|
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattdescriptor-readvalue
|
||||||
fn ReadValue(&self) -> Rc<Promise> {
|
fn ReadValue(&self) -> Rc<Promise> {
|
||||||
let p = Promise::new(&self.global());
|
let p = Promise::new(&self.global());
|
||||||
|
@ -125,7 +124,6 @@ impl BluetoothRemoteGATTDescriptorMethods for BluetoothRemoteGATTDescriptor {
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unrooted_must_root)]
|
|
||||||
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattdescriptor-writevalue
|
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattdescriptor-writevalue
|
||||||
fn WriteValue(&self, value: ArrayBufferViewOrArrayBuffer) -> Rc<Promise> {
|
fn WriteValue(&self, value: ArrayBufferViewOrArrayBuffer) -> Rc<Promise> {
|
||||||
let p = Promise::new(&self.global());
|
let p = Promise::new(&self.global());
|
||||||
|
|
|
@ -68,7 +68,6 @@ impl BluetoothRemoteGATTServerMethods for BluetoothRemoteGATTServer {
|
||||||
self.connected.get()
|
self.connected.get()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unrooted_must_root)]
|
|
||||||
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattserver-connect
|
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattserver-connect
|
||||||
fn Connect(&self) -> Rc<Promise> {
|
fn Connect(&self) -> Rc<Promise> {
|
||||||
// Step 1.
|
// Step 1.
|
||||||
|
@ -109,7 +108,6 @@ impl BluetoothRemoteGATTServerMethods for BluetoothRemoteGATTServer {
|
||||||
self.Device().garbage_collect_the_connection()
|
self.Device().garbage_collect_the_connection()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unrooted_must_root)]
|
|
||||||
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattserver-getprimaryservice
|
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattserver-getprimaryservice
|
||||||
fn GetPrimaryService(&self, service: BluetoothServiceUUID) -> Rc<Promise> {
|
fn GetPrimaryService(&self, service: BluetoothServiceUUID) -> Rc<Promise> {
|
||||||
// Step 1 - 2.
|
// Step 1 - 2.
|
||||||
|
@ -124,7 +122,6 @@ impl BluetoothRemoteGATTServerMethods for BluetoothRemoteGATTServer {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unrooted_must_root)]
|
|
||||||
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattserver-getprimaryservices
|
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattserver-getprimaryservices
|
||||||
fn GetPrimaryServices(&self, service: Option<BluetoothServiceUUID>) -> Rc<Promise> {
|
fn GetPrimaryServices(&self, service: Option<BluetoothServiceUUID>) -> Rc<Promise> {
|
||||||
// Step 1 - 2.
|
// Step 1 - 2.
|
||||||
|
|
|
@ -82,7 +82,6 @@ impl BluetoothRemoteGATTServiceMethods for BluetoothRemoteGATTService {
|
||||||
self.uuid.clone()
|
self.uuid.clone()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unrooted_must_root)]
|
|
||||||
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattservice-getcharacteristic
|
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattservice-getcharacteristic
|
||||||
fn GetCharacteristic(&self, characteristic: BluetoothCharacteristicUUID) -> Rc<Promise> {
|
fn GetCharacteristic(&self, characteristic: BluetoothCharacteristicUUID) -> Rc<Promise> {
|
||||||
get_gatt_children(
|
get_gatt_children(
|
||||||
|
@ -96,7 +95,6 @@ impl BluetoothRemoteGATTServiceMethods for BluetoothRemoteGATTService {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unrooted_must_root)]
|
|
||||||
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattservice-getcharacteristics
|
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattservice-getcharacteristics
|
||||||
fn GetCharacteristics(
|
fn GetCharacteristics(
|
||||||
&self,
|
&self,
|
||||||
|
@ -113,7 +111,6 @@ impl BluetoothRemoteGATTServiceMethods for BluetoothRemoteGATTService {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unrooted_must_root)]
|
|
||||||
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattservice-getincludedservice
|
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattservice-getincludedservice
|
||||||
fn GetIncludedService(&self, service: BluetoothServiceUUID) -> Rc<Promise> {
|
fn GetIncludedService(&self, service: BluetoothServiceUUID) -> Rc<Promise> {
|
||||||
get_gatt_children(
|
get_gatt_children(
|
||||||
|
@ -127,7 +124,6 @@ impl BluetoothRemoteGATTServiceMethods for BluetoothRemoteGATTService {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unrooted_must_root)]
|
|
||||||
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattservice-getincludedservices
|
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattservice-getincludedservices
|
||||||
fn GetIncludedServices(&self, service: Option<BluetoothServiceUUID>) -> Rc<Promise> {
|
fn GetIncludedServices(&self, service: Option<BluetoothServiceUUID>) -> Rc<Promise> {
|
||||||
get_gatt_children(
|
get_gatt_children(
|
||||||
|
|
|
@ -399,7 +399,6 @@ impl CustomElementRegistryMethods for CustomElementRegistry {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <https://html.spec.whatwg.org/multipage/#dom-customelementregistry-whendefined>
|
/// <https://html.spec.whatwg.org/multipage/#dom-customelementregistry-whendefined>
|
||||||
#[allow(unrooted_must_root)]
|
|
||||||
fn WhenDefined(&self, name: DOMString) -> Rc<Promise> {
|
fn WhenDefined(&self, name: DOMString) -> Rc<Promise> {
|
||||||
let global_scope = self.window.upcast::<GlobalScope>();
|
let global_scope = self.window.upcast::<GlobalScope>();
|
||||||
let name = LocalName::from(&*name);
|
let name = LocalName::from(&*name);
|
||||||
|
|
|
@ -3139,7 +3139,6 @@ impl Document {
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://fullscreen.spec.whatwg.org/#dom-element-requestfullscreen
|
// https://fullscreen.spec.whatwg.org/#dom-element-requestfullscreen
|
||||||
#[allow(unrooted_must_root)]
|
|
||||||
pub fn enter_fullscreen(&self, pending: &Element) -> Rc<Promise> {
|
pub fn enter_fullscreen(&self, pending: &Element) -> Rc<Promise> {
|
||||||
// Step 1
|
// Step 1
|
||||||
let promise = Promise::new(self.global().r());
|
let promise = Promise::new(self.global().r());
|
||||||
|
@ -3198,7 +3197,6 @@ impl Document {
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://fullscreen.spec.whatwg.org/#exit-fullscreen
|
// https://fullscreen.spec.whatwg.org/#exit-fullscreen
|
||||||
#[allow(unrooted_must_root)]
|
|
||||||
pub fn exit_fullscreen(&self) -> Rc<Promise> {
|
pub fn exit_fullscreen(&self) -> Rc<Promise> {
|
||||||
let global = self.global();
|
let global = self.global();
|
||||||
// Step 1
|
// Step 1
|
||||||
|
@ -4561,7 +4559,6 @@ impl DocumentMethods for Document {
|
||||||
self.fullscreen_element.get()
|
self.fullscreen_element.get()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unrooted_must_root)]
|
|
||||||
// https://fullscreen.spec.whatwg.org/#dom-document-exitfullscreen
|
// https://fullscreen.spec.whatwg.org/#dom-document-exitfullscreen
|
||||||
fn ExitFullscreen(&self) -> Rc<Promise> {
|
fn ExitFullscreen(&self) -> Rc<Promise> {
|
||||||
self.exit_fullscreen()
|
self.exit_fullscreen()
|
||||||
|
|
|
@ -2565,7 +2565,6 @@ impl ElementMethods for Element {
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://fullscreen.spec.whatwg.org/#dom-element-requestfullscreen
|
// https://fullscreen.spec.whatwg.org/#dom-element-requestfullscreen
|
||||||
#[allow(unrooted_must_root)]
|
|
||||||
fn RequestFullscreen(&self) -> Rc<Promise> {
|
fn RequestFullscreen(&self) -> Rc<Promise> {
|
||||||
let doc = document_from_node(self);
|
let doc = document_from_node(self);
|
||||||
doc.enter_fullscreen(self)
|
doc.enter_fullscreen(self)
|
||||||
|
|
|
@ -1022,7 +1022,6 @@ impl HTMLMediaElement {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Appends a promise to the list of pending play promises.
|
/// Appends a promise to the list of pending play promises.
|
||||||
#[allow(unrooted_must_root)]
|
|
||||||
fn push_pending_play_promise(&self, promise: &Rc<Promise>) {
|
fn push_pending_play_promise(&self, promise: &Rc<Promise>) {
|
||||||
self.pending_play_promises
|
self.pending_play_promises
|
||||||
.borrow_mut()
|
.borrow_mut()
|
||||||
|
@ -1039,7 +1038,6 @@ impl HTMLMediaElement {
|
||||||
/// Each call to this method must be followed by a call to
|
/// Each call to this method must be followed by a call to
|
||||||
/// `fulfill_in_flight_play_promises`, to actually fulfill the promises
|
/// `fulfill_in_flight_play_promises`, to actually fulfill the promises
|
||||||
/// which were taken and moved to the in-flight queue.
|
/// which were taken and moved to the in-flight queue.
|
||||||
#[allow(unrooted_must_root)]
|
|
||||||
fn take_pending_play_promises(&self, result: ErrorResult) {
|
fn take_pending_play_promises(&self, result: ErrorResult) {
|
||||||
let pending_play_promises =
|
let pending_play_promises =
|
||||||
mem::replace(&mut *self.pending_play_promises.borrow_mut(), vec![]);
|
mem::replace(&mut *self.pending_play_promises.borrow_mut(), vec![]);
|
||||||
|
@ -1375,7 +1373,6 @@ impl HTMLMediaElementMethods for HTMLMediaElement {
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/multipage/#dom-media-play
|
// https://html.spec.whatwg.org/multipage/#dom-media-play
|
||||||
#[allow(unrooted_must_root)]
|
|
||||||
fn Play(&self) -> Rc<Promise> {
|
fn Play(&self) -> Rc<Promise> {
|
||||||
let promise = Promise::new(&self.global());
|
let promise = Promise::new(&self.global());
|
||||||
self.play(&promise);
|
self.play(&promise);
|
||||||
|
|
|
@ -42,7 +42,6 @@ impl NavigationPreloadManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl NavigationPreloadManagerMethods for NavigationPreloadManager {
|
impl NavigationPreloadManagerMethods for NavigationPreloadManager {
|
||||||
#[allow(unrooted_must_root)]
|
|
||||||
// https://w3c.github.io/ServiceWorker/#navigation-preload-manager-enable
|
// https://w3c.github.io/ServiceWorker/#navigation-preload-manager-enable
|
||||||
fn Enable(&self) -> Rc<Promise> {
|
fn Enable(&self) -> Rc<Promise> {
|
||||||
let promise = Promise::new(&*self.global());
|
let promise = Promise::new(&*self.global());
|
||||||
|
@ -65,7 +64,6 @@ impl NavigationPreloadManagerMethods for NavigationPreloadManager {
|
||||||
promise
|
promise
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unrooted_must_root)]
|
|
||||||
// https://w3c.github.io/ServiceWorker/#navigation-preload-manager-disable
|
// https://w3c.github.io/ServiceWorker/#navigation-preload-manager-disable
|
||||||
fn Disable(&self) -> Rc<Promise> {
|
fn Disable(&self) -> Rc<Promise> {
|
||||||
let promise = Promise::new(&*self.global());
|
let promise = Promise::new(&*self.global());
|
||||||
|
@ -88,7 +86,6 @@ impl NavigationPreloadManagerMethods for NavigationPreloadManager {
|
||||||
promise
|
promise
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unrooted_must_root)]
|
|
||||||
// https://w3c.github.io/ServiceWorker/#navigation-preload-manager-setheadervalue
|
// https://w3c.github.io/ServiceWorker/#navigation-preload-manager-setheadervalue
|
||||||
fn SetHeaderValue(&self, value: ByteString) -> Rc<Promise> {
|
fn SetHeaderValue(&self, value: ByteString) -> Rc<Promise> {
|
||||||
let promise = Promise::new(&*self.global());
|
let promise = Promise::new(&*self.global());
|
||||||
|
@ -111,7 +108,6 @@ impl NavigationPreloadManagerMethods for NavigationPreloadManager {
|
||||||
promise
|
promise
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unrooted_must_root)]
|
|
||||||
// https://w3c.github.io/ServiceWorker/#navigation-preload-manager-getstate
|
// https://w3c.github.io/ServiceWorker/#navigation-preload-manager-getstate
|
||||||
fn GetState(&self) -> Rc<Promise> {
|
fn GetState(&self) -> Rc<Promise> {
|
||||||
let promise = Promise::new(&*self.global());
|
let promise = Promise::new(&*self.global());
|
||||||
|
|
|
@ -147,7 +147,6 @@ impl NavigatorMethods for Navigator {
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://w3c.github.io/webvr/spec/1.1/#navigator-getvrdisplays-attribute
|
// https://w3c.github.io/webvr/spec/1.1/#navigator-getvrdisplays-attribute
|
||||||
#[allow(unrooted_must_root)]
|
|
||||||
fn GetVRDisplays(&self) -> Rc<Promise> {
|
fn GetVRDisplays(&self) -> Rc<Promise> {
|
||||||
let promise = Promise::new(&self.global());
|
let promise = Promise::new(&self.global());
|
||||||
let displays = self.Xr().get_displays();
|
let displays = self.Xr().get_displays();
|
||||||
|
|
|
@ -113,7 +113,6 @@ impl OfflineAudioContextMethods for OfflineAudioContext {
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://webaudio.github.io/web-audio-api/#dom-offlineaudiocontext-startrendering
|
// https://webaudio.github.io/web-audio-api/#dom-offlineaudiocontext-startrendering
|
||||||
#[allow(unrooted_must_root)]
|
|
||||||
fn StartRendering(&self) -> Rc<Promise> {
|
fn StartRendering(&self) -> Rc<Promise> {
|
||||||
let promise = Promise::new(&self.global());
|
let promise = Promise::new(&self.global());
|
||||||
if self.rendering_started.get() {
|
if self.rendering_started.get() {
|
||||||
|
|
|
@ -84,7 +84,6 @@ impl Permissions {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unrooted_must_root)]
|
|
||||||
// https://w3c.github.io/permissions/#dom-permissions-query
|
// https://w3c.github.io/permissions/#dom-permissions-query
|
||||||
// https://w3c.github.io/permissions/#dom-permissions-request
|
// https://w3c.github.io/permissions/#dom-permissions-request
|
||||||
// https://w3c.github.io/permissions/#dom-permissions-revoke
|
// https://w3c.github.io/permissions/#dom-permissions-revoke
|
||||||
|
@ -197,21 +196,18 @@ impl Permissions {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl PermissionsMethods for Permissions {
|
impl PermissionsMethods for Permissions {
|
||||||
#[allow(unrooted_must_root)]
|
|
||||||
#[allow(unsafe_code)]
|
#[allow(unsafe_code)]
|
||||||
// https://w3c.github.io/permissions/#dom-permissions-query
|
// https://w3c.github.io/permissions/#dom-permissions-query
|
||||||
unsafe fn Query(&self, cx: *mut JSContext, permissionDesc: *mut JSObject) -> Rc<Promise> {
|
unsafe fn Query(&self, cx: *mut JSContext, permissionDesc: *mut JSObject) -> Rc<Promise> {
|
||||||
self.manipulate(Operation::Query, cx, permissionDesc, None)
|
self.manipulate(Operation::Query, cx, permissionDesc, None)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unrooted_must_root)]
|
|
||||||
#[allow(unsafe_code)]
|
#[allow(unsafe_code)]
|
||||||
// https://w3c.github.io/permissions/#dom-permissions-request
|
// https://w3c.github.io/permissions/#dom-permissions-request
|
||||||
unsafe fn Request(&self, cx: *mut JSContext, permissionDesc: *mut JSObject) -> Rc<Promise> {
|
unsafe fn Request(&self, cx: *mut JSContext, permissionDesc: *mut JSObject) -> Rc<Promise> {
|
||||||
self.manipulate(Operation::Request, cx, permissionDesc, None)
|
self.manipulate(Operation::Request, cx, permissionDesc, None)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unrooted_must_root)]
|
|
||||||
#[allow(unsafe_code)]
|
#[allow(unsafe_code)]
|
||||||
// https://w3c.github.io/permissions/#dom-permissions-revoke
|
// https://w3c.github.io/permissions/#dom-permissions-revoke
|
||||||
unsafe fn Revoke(&self, cx: *mut JSContext, permissionDesc: *mut JSObject) -> Rc<Promise> {
|
unsafe fn Revoke(&self, cx: *mut JSContext, permissionDesc: *mut JSObject) -> Rc<Promise> {
|
||||||
|
|
|
@ -89,7 +89,7 @@ impl Promise {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unsafe_code, unrooted_must_root)]
|
#[allow(unsafe_code)]
|
||||||
pub fn duplicate(&self) -> Rc<Promise> {
|
pub fn duplicate(&self) -> Rc<Promise> {
|
||||||
let cx = self.global().get_cx();
|
let cx = self.global().get_cx();
|
||||||
unsafe { Promise::new_with_js_promise(self.reflector().get_jsobject(), cx) }
|
unsafe { Promise::new_with_js_promise(self.reflector().get_jsobject(), cx) }
|
||||||
|
|
|
@ -95,7 +95,6 @@ impl PromiseRejectionEvent {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl PromiseRejectionEventMethods for PromiseRejectionEvent {
|
impl PromiseRejectionEventMethods for PromiseRejectionEvent {
|
||||||
#[allow(unrooted_must_root)]
|
|
||||||
// https://html.spec.whatwg.org/multipage/#dom-promiserejectionevent-promise
|
// https://html.spec.whatwg.org/multipage/#dom-promiserejectionevent-promise
|
||||||
fn Promise(&self) -> Rc<Promise> {
|
fn Promise(&self) -> Rc<Promise> {
|
||||||
self.promise.clone()
|
self.promise.clone()
|
||||||
|
|
|
@ -620,31 +620,26 @@ impl RequestMethods for Request {
|
||||||
Request::clone_from(self)
|
Request::clone_from(self)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unrooted_must_root)]
|
|
||||||
// https://fetch.spec.whatwg.org/#dom-body-text
|
// https://fetch.spec.whatwg.org/#dom-body-text
|
||||||
fn Text(&self) -> Rc<Promise> {
|
fn Text(&self) -> Rc<Promise> {
|
||||||
consume_body(self, BodyType::Text)
|
consume_body(self, BodyType::Text)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unrooted_must_root)]
|
|
||||||
// https://fetch.spec.whatwg.org/#dom-body-blob
|
// https://fetch.spec.whatwg.org/#dom-body-blob
|
||||||
fn Blob(&self) -> Rc<Promise> {
|
fn Blob(&self) -> Rc<Promise> {
|
||||||
consume_body(self, BodyType::Blob)
|
consume_body(self, BodyType::Blob)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unrooted_must_root)]
|
|
||||||
// https://fetch.spec.whatwg.org/#dom-body-formdata
|
// https://fetch.spec.whatwg.org/#dom-body-formdata
|
||||||
fn FormData(&self) -> Rc<Promise> {
|
fn FormData(&self) -> Rc<Promise> {
|
||||||
consume_body(self, BodyType::FormData)
|
consume_body(self, BodyType::FormData)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unrooted_must_root)]
|
|
||||||
// https://fetch.spec.whatwg.org/#dom-body-json
|
// https://fetch.spec.whatwg.org/#dom-body-json
|
||||||
fn Json(&self) -> Rc<Promise> {
|
fn Json(&self) -> Rc<Promise> {
|
||||||
consume_body(self, BodyType::Json)
|
consume_body(self, BodyType::Json)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unrooted_must_root)]
|
|
||||||
// https://fetch.spec.whatwg.org/#dom-body-arraybuffer
|
// https://fetch.spec.whatwg.org/#dom-body-arraybuffer
|
||||||
fn ArrayBuffer(&self) -> Rc<Promise> {
|
fn ArrayBuffer(&self) -> Rc<Promise> {
|
||||||
consume_body(self, BodyType::ArrayBuffer)
|
consume_body(self, BodyType::ArrayBuffer)
|
||||||
|
|
|
@ -362,31 +362,26 @@ impl ResponseMethods for Response {
|
||||||
self.body_used.get()
|
self.body_used.get()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unrooted_must_root)]
|
|
||||||
// https://fetch.spec.whatwg.org/#dom-body-text
|
// https://fetch.spec.whatwg.org/#dom-body-text
|
||||||
fn Text(&self) -> Rc<Promise> {
|
fn Text(&self) -> Rc<Promise> {
|
||||||
consume_body(self, BodyType::Text)
|
consume_body(self, BodyType::Text)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unrooted_must_root)]
|
|
||||||
// https://fetch.spec.whatwg.org/#dom-body-blob
|
// https://fetch.spec.whatwg.org/#dom-body-blob
|
||||||
fn Blob(&self) -> Rc<Promise> {
|
fn Blob(&self) -> Rc<Promise> {
|
||||||
consume_body(self, BodyType::Blob)
|
consume_body(self, BodyType::Blob)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unrooted_must_root)]
|
|
||||||
// https://fetch.spec.whatwg.org/#dom-body-formdata
|
// https://fetch.spec.whatwg.org/#dom-body-formdata
|
||||||
fn FormData(&self) -> Rc<Promise> {
|
fn FormData(&self) -> Rc<Promise> {
|
||||||
consume_body(self, BodyType::FormData)
|
consume_body(self, BodyType::FormData)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unrooted_must_root)]
|
|
||||||
// https://fetch.spec.whatwg.org/#dom-body-json
|
// https://fetch.spec.whatwg.org/#dom-body-json
|
||||||
fn Json(&self) -> Rc<Promise> {
|
fn Json(&self) -> Rc<Promise> {
|
||||||
consume_body(self, BodyType::Json)
|
consume_body(self, BodyType::Json)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unrooted_must_root)]
|
|
||||||
// https://fetch.spec.whatwg.org/#dom-body-arraybuffer
|
// https://fetch.spec.whatwg.org/#dom-body-arraybuffer
|
||||||
fn ArrayBuffer(&self) -> Rc<Promise> {
|
fn ArrayBuffer(&self) -> Rc<Promise> {
|
||||||
consume_body(self, BodyType::ArrayBuffer)
|
consume_body(self, BodyType::ArrayBuffer)
|
||||||
|
|
|
@ -51,9 +51,9 @@ impl ServiceWorkerContainerMethods for ServiceWorkerContainer {
|
||||||
self.client.get_controller()
|
self.client.get_controller()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(unrooted_must_root)] // Job is unrooted
|
||||||
/// https://w3c.github.io/ServiceWorker/#service-worker-container-register-method and - A
|
/// https://w3c.github.io/ServiceWorker/#service-worker-container-register-method and - A
|
||||||
/// https://w3c.github.io/ServiceWorker/#start-register-algorithm - B
|
/// https://w3c.github.io/ServiceWorker/#start-register-algorithm - B
|
||||||
#[allow(unrooted_must_root)] // Job is unrooted
|
|
||||||
fn Register(&self, script_url: USVString, options: &RegistrationOptions) -> Rc<Promise> {
|
fn Register(&self, script_url: USVString, options: &RegistrationOptions) -> Rc<Promise> {
|
||||||
// A: Step 1
|
// A: Step 1
|
||||||
let promise = Promise::new(&*self.global());
|
let promise = Promise::new(&*self.global());
|
||||||
|
|
|
@ -1006,7 +1006,6 @@ impl TestBindingMethods for TestBinding {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unrooted_must_root)]
|
|
||||||
fn PromiseNativeHandler(
|
fn PromiseNativeHandler(
|
||||||
&self,
|
&self,
|
||||||
resolve: Option<Rc<SimpleCallback>>,
|
resolve: Option<Rc<SimpleCallback>>,
|
||||||
|
@ -1041,7 +1040,6 @@ impl TestBindingMethods for TestBinding {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unrooted_must_root)]
|
|
||||||
fn PromiseAttribute(&self) -> Rc<Promise> {
|
fn PromiseAttribute(&self) -> Rc<Promise> {
|
||||||
Promise::new(&self.global())
|
Promise::new(&self.global())
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,7 +51,6 @@ impl TestWorklet {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl TestWorkletMethods for TestWorklet {
|
impl TestWorkletMethods for TestWorklet {
|
||||||
#[allow(unrooted_must_root)]
|
|
||||||
fn AddModule(&self, moduleURL: USVString, options: &WorkletOptions) -> Rc<Promise> {
|
fn AddModule(&self, moduleURL: USVString, options: &WorkletOptions) -> Rc<Promise> {
|
||||||
self.worklet.AddModule(moduleURL, options)
|
self.worklet.AddModule(moduleURL, options)
|
||||||
}
|
}
|
||||||
|
|
|
@ -307,7 +307,6 @@ impl VRDisplayMethods for VRDisplay {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unrooted_must_root)]
|
|
||||||
// https://w3c.github.io/webvr/#dom-vrdisplay-requestpresent
|
// https://w3c.github.io/webvr/#dom-vrdisplay-requestpresent
|
||||||
fn RequestPresent(&self, layers: Vec<VRLayer>) -> Rc<Promise> {
|
fn RequestPresent(&self, layers: Vec<VRLayer>) -> Rc<Promise> {
|
||||||
let promise = Promise::new(&self.global());
|
let promise = Promise::new(&self.global());
|
||||||
|
@ -380,7 +379,6 @@ impl VRDisplayMethods for VRDisplay {
|
||||||
promise
|
promise
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unrooted_must_root)]
|
|
||||||
// https://w3c.github.io/webvr/#dom-vrdisplay-exitpresent
|
// https://w3c.github.io/webvr/#dom-vrdisplay-exitpresent
|
||||||
fn ExitPresent(&self) -> Rc<Promise> {
|
fn ExitPresent(&self) -> Rc<Promise> {
|
||||||
let promise = Promise::new(&self.global());
|
let promise = Promise::new(&self.global());
|
||||||
|
|
|
@ -1138,7 +1138,6 @@ impl WindowMethods for Window {
|
||||||
mql
|
mql
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unrooted_must_root)]
|
|
||||||
// https://fetch.spec.whatwg.org/#fetch-method
|
// https://fetch.spec.whatwg.org/#fetch-method
|
||||||
fn Fetch(
|
fn Fetch(
|
||||||
&self,
|
&self,
|
||||||
|
|
|
@ -109,7 +109,6 @@ impl Worklet {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl WorkletMethods for Worklet {
|
impl WorkletMethods for Worklet {
|
||||||
#[allow(unrooted_must_root)]
|
|
||||||
/// <https://drafts.css-houdini.org/worklets/#dom-worklet-addmodule>
|
/// <https://drafts.css-houdini.org/worklets/#dom-worklet-addmodule>
|
||||||
fn AddModule(&self, module_url: USVString, options: &WorkletOptions) -> Rc<Promise> {
|
fn AddModule(&self, module_url: USVString, options: &WorkletOptions) -> Rc<Promise> {
|
||||||
// Step 1.
|
// Step 1.
|
||||||
|
|
|
@ -57,7 +57,6 @@ impl Drop for XR {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl XRMethods for XR {
|
impl XRMethods for XR {
|
||||||
#[allow(unrooted_must_root)]
|
|
||||||
/// https://immersive-web.github.io/webxr/#dom-xr-supportssessionmode
|
/// https://immersive-web.github.io/webxr/#dom-xr-supportssessionmode
|
||||||
fn SupportsSessionMode(&self, mode: XRSessionMode) -> Rc<Promise> {
|
fn SupportsSessionMode(&self, mode: XRSessionMode) -> Rc<Promise> {
|
||||||
// XXXManishearth this should select an XR device first
|
// XXXManishearth this should select an XR device first
|
||||||
|
@ -72,7 +71,6 @@ impl XRMethods for XR {
|
||||||
promise
|
promise
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unrooted_must_root)]
|
|
||||||
/// https://immersive-web.github.io/webxr/#dom-xr-requestsession
|
/// https://immersive-web.github.io/webxr/#dom-xr-requestsession
|
||||||
fn RequestSession(&self, options: &XRSessionCreationOptions) -> Rc<Promise> {
|
fn RequestSession(&self, options: &XRSessionCreationOptions) -> Rc<Promise> {
|
||||||
let promise = Promise::new(&self.global());
|
let promise = Promise::new(&self.global());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue