mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Rename Promise::new to Promise::new_in_current_compartment
This commit is contained in:
parent
6fa1853bb1
commit
782b58587a
25 changed files with 93 additions and 51 deletions
|
@ -43,8 +43,9 @@ impl NavigationPreloadManager {
|
|||
|
||||
impl NavigationPreloadManagerMethods for NavigationPreloadManager {
|
||||
// https://w3c.github.io/ServiceWorker/#navigation-preload-manager-enable
|
||||
#[allow(unsafe_code)]
|
||||
fn Enable(&self) -> Rc<Promise> {
|
||||
let promise = Promise::new(&*self.global());
|
||||
let promise = unsafe { Promise::new_in_current_compartment(&*self.global()) };
|
||||
|
||||
// 2.
|
||||
if self.serviceworker_registration.active().is_none() {
|
||||
|
@ -65,8 +66,9 @@ impl NavigationPreloadManagerMethods for NavigationPreloadManager {
|
|||
}
|
||||
|
||||
// https://w3c.github.io/ServiceWorker/#navigation-preload-manager-disable
|
||||
#[allow(unsafe_code)]
|
||||
fn Disable(&self) -> Rc<Promise> {
|
||||
let promise = Promise::new(&*self.global());
|
||||
let promise = unsafe { Promise::new_in_current_compartment(&*self.global()) };
|
||||
|
||||
// 2.
|
||||
if self.serviceworker_registration.active().is_none() {
|
||||
|
@ -87,8 +89,9 @@ impl NavigationPreloadManagerMethods for NavigationPreloadManager {
|
|||
}
|
||||
|
||||
// https://w3c.github.io/ServiceWorker/#navigation-preload-manager-setheadervalue
|
||||
#[allow(unsafe_code)]
|
||||
fn SetHeaderValue(&self, value: ByteString) -> Rc<Promise> {
|
||||
let promise = Promise::new(&*self.global());
|
||||
let promise = unsafe { Promise::new_in_current_compartment(&*self.global()) };
|
||||
|
||||
// 2.
|
||||
if self.serviceworker_registration.active().is_none() {
|
||||
|
@ -109,8 +112,9 @@ impl NavigationPreloadManagerMethods for NavigationPreloadManager {
|
|||
}
|
||||
|
||||
// https://w3c.github.io/ServiceWorker/#navigation-preload-manager-getstate
|
||||
#[allow(unsafe_code)]
|
||||
fn GetState(&self) -> Rc<Promise> {
|
||||
let promise = Promise::new(&*self.global());
|
||||
let promise = unsafe { Promise::new_in_current_compartment(&*self.global()) };
|
||||
// 2.
|
||||
let mut state = NavigationPreloadState::empty();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue