mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Fetch cancellation: Add CancellationListener
This commit is contained in:
parent
27457e4d84
commit
6dd7af2bda
4 changed files with 38 additions and 10 deletions
|
@ -25,7 +25,7 @@ use hyper_openssl;
|
|||
use msg::constellation_msg::TEST_PIPELINE_ID;
|
||||
use net::connector::create_ssl_client;
|
||||
use net::fetch::cors_cache::CorsCache;
|
||||
use net::fetch::methods::FetchContext;
|
||||
use net::fetch::methods::{CancellationListener, FetchContext};
|
||||
use net::filemanager_thread::FileManager;
|
||||
use net::hsts::HstsEntry;
|
||||
use net::test::HttpState;
|
||||
|
@ -538,7 +538,7 @@ fn test_fetch_with_hsts() {
|
|||
user_agent: DEFAULT_USER_AGENT.into(),
|
||||
devtools_chan: None,
|
||||
filemanager: FileManager::new(),
|
||||
cancel_chan: None,
|
||||
cancellation_listener: Arc::new(Mutex::new(CancellationListener::new(None))),
|
||||
};
|
||||
|
||||
{
|
||||
|
|
|
@ -36,7 +36,7 @@ use devtools_traits::DevtoolsControlMsg;
|
|||
use hyper::server::{Handler, Listening, Server};
|
||||
use net::connector::create_ssl_client;
|
||||
use net::fetch::cors_cache::CorsCache;
|
||||
use net::fetch::methods::{self, FetchContext};
|
||||
use net::fetch::methods::{self, CancellationListener, FetchContext};
|
||||
use net::filemanager_thread::FileManager;
|
||||
use net::test::HttpState;
|
||||
use net_traits::FetchTaskTarget;
|
||||
|
@ -44,7 +44,7 @@ use net_traits::request::Request;
|
|||
use net_traits::response::Response;
|
||||
use servo_config::resource_files::resources_dir_path;
|
||||
use servo_url::ServoUrl;
|
||||
use std::sync::Arc;
|
||||
use std::sync::{Arc, Mutex};
|
||||
use std::sync::mpsc::{Sender, channel};
|
||||
|
||||
const DEFAULT_USER_AGENT: &'static str = "Such Browser. Very Layout. Wow.";
|
||||
|
@ -61,7 +61,7 @@ fn new_fetch_context(dc: Option<Sender<DevtoolsControlMsg>>) -> FetchContext {
|
|||
user_agent: DEFAULT_USER_AGENT.into(),
|
||||
devtools_chan: dc,
|
||||
filemanager: FileManager::new(),
|
||||
cancel_chan: None,
|
||||
cancellation_listener: Arc::new(Mutex::new(CancellationListener::new(None))),
|
||||
}
|
||||
}
|
||||
impl FetchTaskTarget for FetchResponseCollector {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue