diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2016-11-17 15:34:47 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-17 15:34:47 -0600 |
commit | 22aebdf5d41a3509cd6515ccf5edcdf33715a76d (patch) | |
tree | 824af410d147404d0a6dc0908cec85cc71df5bfd /components/script/dom/serviceworker.rs | |
parent | b3ad71353bf264770bf0b3a87b32d86928eb09d4 (diff) | |
parent | 913c874cb55fd0fdc9e8f3a4c34624cd015fac8a (diff) | |
download | servo-22aebdf5d41a3509cd6515ccf5edcdf33715a76d.tar.gz servo-22aebdf5d41a3509cd6515ccf5edcdf33715a76d.zip |
Auto merge of #14246 - emilio:servo-url, r=SimonSapin
Urlmageddon
<!-- Please describe your changes on the following line: -->
Still needs a bunch of code in net to be converted in order to get more
advantage of this for images and stuff, but meanwhile this should help quite a
bit with #13778.
Still wanted to get this in.
r? @SimonSapin
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14246)
<!-- Reviewable:end -->
Diffstat (limited to 'components/script/dom/serviceworker.rs')
-rw-r--r-- | components/script/dom/serviceworker.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/components/script/dom/serviceworker.rs b/components/script/dom/serviceworker.rs index 306b5316adf..d61f1120906 100644 --- a/components/script/dom/serviceworker.rs +++ b/components/script/dom/serviceworker.rs @@ -18,8 +18,8 @@ use dom::globalscope::GlobalScope; use js::jsapi::{HandleValue, JSContext}; use script_thread::Runnable; use script_traits::{ScriptMsg, DOMMessage}; +use servo_url::ServoUrl; use std::cell::Cell; -use url::Url; pub type TrustedServiceWorkerAddress = Trusted<ServiceWorker>; @@ -27,7 +27,7 @@ pub type TrustedServiceWorkerAddress = Trusted<ServiceWorker>; pub struct ServiceWorker { eventtarget: EventTarget, script_url: DOMRefCell<String>, - scope_url: Url, + scope_url: ServoUrl, state: Cell<ServiceWorkerState>, skip_waiting: Cell<bool> } @@ -35,7 +35,7 @@ pub struct ServiceWorker { impl ServiceWorker { fn new_inherited(script_url: &str, skip_waiting: bool, - scope_url: Url) -> ServiceWorker { + scope_url: ServoUrl) -> ServiceWorker { ServiceWorker { eventtarget: EventTarget::new_inherited(), script_url: DOMRefCell::new(String::from(script_url)), @@ -46,8 +46,8 @@ impl ServiceWorker { } pub fn install_serviceworker(global: &GlobalScope, - script_url: Url, - scope_url: Url, + script_url: ServoUrl, + scope_url: ServoUrl, skip_waiting: bool) -> Root<ServiceWorker> { reflect_dom_object(box ServiceWorker::new_inherited(script_url.as_str(), skip_waiting, @@ -64,8 +64,8 @@ impl ServiceWorker { self.upcast::<EventTarget>().fire_event(atom!("statechange")); } - pub fn get_script_url(&self) -> Url { - Url::parse(&self.script_url.borrow().clone()).unwrap() + pub fn get_script_url(&self) -> ServoUrl { + ServoUrl::parse(&self.script_url.borrow().clone()).unwrap() } } |