diff options
author | Emilio Cobos Álvarez <ecoal95@gmail.com> | 2016-11-16 11:57:39 +0100 |
---|---|---|
committer | Emilio Cobos Álvarez <ecoal95@gmail.com> | 2016-11-17 18:34:23 +0100 |
commit | 913c874cb55fd0fdc9e8f3a4c34624cd015fac8a (patch) | |
tree | 4526ecefafe0cde2f56cb1e2a4ebffd372e1f70a /components/script/dom/htmlscriptelement.rs | |
parent | f14e7339b5ff95fce0127dce4fe87ce082ab7259 (diff) | |
download | servo-913c874cb55fd0fdc9e8f3a4c34624cd015fac8a.tar.gz servo-913c874cb55fd0fdc9e8f3a4c34624cd015fac8a.zip |
Urlmageddon: Use refcounted urls more often.
Diffstat (limited to 'components/script/dom/htmlscriptelement.rs')
-rw-r--r-- | components/script/dom/htmlscriptelement.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/components/script/dom/htmlscriptelement.rs b/components/script/dom/htmlscriptelement.rs index 68b65f93142..50c7658daab 100644 --- a/components/script/dom/htmlscriptelement.rs +++ b/components/script/dom/htmlscriptelement.rs @@ -35,11 +35,11 @@ use net_traits::{FetchMetadata, FetchResponseListener, Metadata, NetworkError}; use net_traits::request::{CorsSettings, CredentialsMode, Destination, RequestInit, RequestMode, Type as RequestType}; use network_listener::{NetworkListener, PreInvoke}; use servo_atoms::Atom; +use servo_url::ServoUrl; use std::ascii::AsciiExt; use std::cell::Cell; use std::sync::{Arc, Mutex}; use style::str::{HTML_SPACE_CHARACTERS, StaticStringVec}; -use url::Url; #[dom_struct] pub struct HTMLScriptElement { @@ -115,12 +115,12 @@ static SCRIPT_JS_MIMES: StaticStringVec = &[ #[derive(HeapSizeOf, JSTraceable)] pub struct ScriptOrigin { text: DOMString, - url: Url, + url: ServoUrl, external: bool, } impl ScriptOrigin { - fn internal(text: DOMString, url: Url) -> ScriptOrigin { + fn internal(text: DOMString, url: ServoUrl) -> ScriptOrigin { ScriptOrigin { text: text, url: url, @@ -128,7 +128,7 @@ impl ScriptOrigin { } } - fn external(text: DOMString, url: Url) -> ScriptOrigin { + fn external(text: DOMString, url: ServoUrl) -> ScriptOrigin { ScriptOrigin { text: text, url: url, @@ -149,7 +149,7 @@ struct ScriptContext { /// The response metadata received to date. metadata: Option<Metadata>, /// The initial URL requested. - url: Url, + url: ServoUrl, /// Indicates whether the request failed, and why status: Result<(), NetworkError> } @@ -219,7 +219,7 @@ impl PreInvoke for ScriptContext {} /// https://html.spec.whatwg.org/multipage/#fetch-a-classic-script fn fetch_a_classic_script(script: &HTMLScriptElement, - url: Url, + url: ServoUrl, cors_setting: Option<CorsSettings>, character_encoding: EncodingRef) { let doc = document_from_node(script); |