diff options
author | Patrick Walton <pcwalton@mimiga.net> | 2015-07-09 17:16:21 -0700 |
---|---|---|
committer | Patrick Walton <pcwalton@mimiga.net> | 2015-07-31 11:28:09 -0700 |
commit | 2aa51742460a351abfb746aec4352dd6d27a3c52 (patch) | |
tree | 58bbb99f2936dc75694471bca00f883ef828bd3a /components/script/cors.rs | |
parent | 44d13f7fd419bdff1420ed21ca3efd72f4015bfa (diff) | |
download | servo-2aa51742460a351abfb746aec4352dd6d27a3c52.tar.gz servo-2aa51742460a351abfb746aec4352dd6d27a3c52.zip |
script: Make the resource task communication use IPC channels.
Diffstat (limited to 'components/script/cors.rs')
-rw-r--r-- | components/script/cors.rs | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/components/script/cors.rs b/components/script/cors.rs index e2ecb1da5cb..b1a1e56cb02 100644 --- a/components/script/cors.rs +++ b/components/script/cors.rs @@ -11,13 +11,11 @@ use network_listener::{NetworkListener, PreInvoke}; use script_task::ScriptChan; -use net_traits::{AsyncResponseTarget, AsyncResponseListener, ResponseAction, Metadata}; -use net_traits::{SerializableStringResult}; +use net_traits::{AsyncResponseListener, ResponseAction, Metadata}; use std::ascii::AsciiExt; use std::borrow::ToOwned; use std::cell::RefCell; -use std::sync::mpsc; use std::sync::{Arc, Mutex}; use time; use time::{now, Timespec}; @@ -133,14 +131,9 @@ impl CORSRequest { listener: listener, response: RefCell::new(None), }; - let (action_sender, action_receiver) = mpsc::channel(); let listener = NetworkListener { context: Arc::new(Mutex::new(context)), script_chan: script_chan, - receiver: action_receiver, - }; - let response_target = AsyncResponseTarget { - sender: action_sender, }; // TODO: this exists only to make preflight check non-blocking @@ -151,8 +144,7 @@ impl CORSRequest { let mut context = listener.context.lock(); let context = context.as_mut().unwrap(); *context.response.borrow_mut() = Some(response); - response_target.invoke_with_listener(ResponseAction::ResponseComplete( - SerializableStringResult(Ok(())))); + listener.notify(ResponseAction::ResponseComplete(Ok(()))); }); } |