Change RequestInit origin type to ImmutableOrigin

This commit is contained in:
Fausto Núñez Alberro 2017-04-26 01:07:31 +02:00 committed by Fausto Núñez Alberro
parent 104e0b4730
commit 6032940fb8
32 changed files with 173 additions and 529 deletions

View file

@ -588,17 +588,14 @@ impl WorkletThread {
// TODO: Fetch a module graph, not just a single script.
// TODO: Fetch the script asynchronously?
// TODO: Caching.
// TODO: Avoid re-parsing the origin as a URL.
let resource_fetcher = self.global_init.resource_threads.sender();
let origin_url = ServoUrl::parse(&*origin.unicode_serialization())
.unwrap_or_else(|_| ServoUrl::parse("about:blank").unwrap());
let request = RequestInit {
url: script_url,
type_: RequestType::Script,
destination: Destination::Script,
mode: RequestMode::CorsMode,
origin: origin_url,
credentials_mode: credentials.into(),
origin,
.. RequestInit::default()
};
let script = load_whole_resource(request, &resource_fetcher).ok()