diff options
author | Patrick Walton <pcwalton@mimiga.net> | 2015-07-09 16:18:38 -0700 |
---|---|---|
committer | Patrick Walton <pcwalton@mimiga.net> | 2015-07-31 11:27:49 -0700 |
commit | 9c9d7dc93b1d64b1524eb2bdcbdc817319abc8b9 (patch) | |
tree | d03336f8dcd684ace3cea05033b49cd4e4bc4b16 /components/script/script_task.rs | |
parent | 7e772857458f60a68346ac1a7020ae51d65959a1 (diff) | |
download | servo-9c9d7dc93b1d64b1524eb2bdcbdc817319abc8b9.tar.gz servo-9c9d7dc93b1d64b1524eb2bdcbdc817319abc8b9.zip |
net: Make most of the resource task messages serializable.
Diffstat (limited to 'components/script/script_task.rs')
-rw-r--r-- | components/script/script_task.rs | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/components/script/script_task.rs b/components/script/script_task.rs index 7deed84430d..192c922991a 100644 --- a/components/script/script_task.rs +++ b/components/script/script_task.rs @@ -67,8 +67,10 @@ use msg::constellation_msg::{LoadData, PipelineId, SubpageId, MozBrowserEvent, W use msg::constellation_msg::{Failure, WindowSizeData, PipelineExitType}; use msg::constellation_msg::Msg as ConstellationMsg; use msg::webdriver_msg::WebDriverScriptCommand; -use net_traits::{ResourceTask, LoadConsumer, ControlMsg, Metadata}; use net_traits::LoadData as NetLoadData; +use net_traits::{ResourceTask, LoadConsumer, ControlMsg, Metadata}; +use net_traits::{SerializableContentType, SerializableHeaders, SerializableMethod}; +use net_traits::{SerializableUrl}; use net_traits::image_cache_task::{ImageCacheChan, ImageCacheTask, ImageCacheResult}; use net_traits::storage_task::StorageTask; use profile_traits::mem::{self, Report, Reporter, ReporterRequest, ReportKind, ReportsChan}; @@ -1309,7 +1311,7 @@ impl ScriptTask { /// The entry point to document loading. Defines bindings, sets up the window and document /// objects, parses HTML and CSS, and kicks off initial layout. fn load(&self, metadata: Metadata, incomplete: InProgressLoad) -> Root<ServoHTMLParser> { - let final_url = metadata.final_url.clone(); + let final_url = (*metadata.final_url).clone(); debug!("ScriptTask: loading {} on page {:?}", incomplete.url.serialize(), incomplete.pipeline_id); // We should either be initializing a root page or loading a child page of an @@ -1415,7 +1417,11 @@ impl ScriptTask { }); let content_type = match metadata.content_type { - Some(ContentType(Mime(TopLevel::Text, SubLevel::Plain, _))) => Some("text/plain".to_owned()), + Some(SerializableContentType(ContentType(Mime(TopLevel::Text, + SubLevel::Plain, + _)))) => { + Some("text/plain".to_owned()) + } _ => None }; @@ -1690,10 +1696,10 @@ impl ScriptTask { } resource_task.send(ControlMsg::Load(NetLoadData { - url: load_data.url, - method: load_data.method, - headers: Headers::new(), - preserved_headers: load_data.headers, + url: SerializableUrl(load_data.url), + method: SerializableMethod(load_data.method), + headers: SerializableHeaders(Headers::new()), + preserved_headers: SerializableHeaders(load_data.headers), data: load_data.data, cors: None, pipeline_id: Some(id), |