refactor(script): remove {DedicatedWorkerGlobalScope, ServiceWorkerGlobalScope}::origin

This commit is contained in:
yvt 2021-07-13 21:25:46 +09:00
parent 90b78a193c
commit dfb4a0c844
2 changed files with 2 additions and 10 deletions

View file

@ -53,7 +53,7 @@ use net_traits::IpcSend;
use parking_lot::Mutex;
use script_traits::{WorkerGlobalScopeInit, WorkerScriptLoadOrigin};
use servo_rand::random;
use servo_url::{MutableOrigin, ServoUrl};
use servo_url::ServoUrl;
use std::mem::replace;
use std::sync::atomic::AtomicBool;
use std::sync::Arc;
@ -307,10 +307,6 @@ impl DedicatedWorkerGlobalScope {
unsafe { DedicatedWorkerGlobalScopeBinding::Wrap(SafeJSContext::from_ptr(cx), scope) }
}
pub fn origin(&self) -> MutableOrigin {
MutableOrigin::new(self.workerglobalscope.get_url().origin())
}
#[allow(unsafe_code)]
// https://html.spec.whatwg.org/multipage/#run-a-worker
pub fn run_worker_scope(

View file

@ -43,7 +43,7 @@ use parking_lot::Mutex;
use script_traits::{ScopeThings, ServiceWorkerMsg, WorkerGlobalScopeInit, WorkerScriptLoadOrigin};
use servo_config::pref;
use servo_rand::random;
use servo_url::{MutableOrigin, ServoUrl};
use servo_url::ServoUrl;
use std::sync::atomic::AtomicBool;
use std::sync::Arc;
use std::thread::{self, JoinHandle};
@ -279,10 +279,6 @@ impl ServiceWorkerGlobalScope {
unsafe { ServiceWorkerGlobalScopeBinding::Wrap(SafeJSContext::from_ptr(cx), scope) }
}
pub fn origin(&self) -> MutableOrigin {
MutableOrigin::new(self.scope_url.origin())
}
#[allow(unsafe_code)]
// https://html.spec.whatwg.org/multipage/#run-a-worker
pub fn run_serviceworker_scope(