Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the fetch target non-optional. #14465

Merged
merged 9 commits into from Dec 15, 2016

Qualify the fetch() calls in unit tests.

  • Loading branch information
Ms2ger committed Dec 15, 2016
commit 8d34ef109daf0ec77f837671708dc3e0c1944763
@@ -36,7 +36,7 @@ extern crate url;

use devtools_traits::DevtoolsControlMsg;
use hyper::server::{Handler, Listening, Server};
use net::fetch::methods::{FetchContext, fetch};
use net::fetch::methods::{self, FetchContext};
use net::filemanager_thread::FileManager;
use net::test::HttpState;
use net_traits::FetchTaskTarget;
@@ -74,12 +74,12 @@ impl FetchTaskTarget for FetchResponseCollector {

fn fetch_async(request: Request, target: Box<FetchTaskTarget + Send>, dc: Option<Sender<DevtoolsControlMsg>>) {
thread::spawn(move || {
fetch(Rc::new(request), &mut Some(target), &new_fetch_context(dc));
methods::fetch(Rc::new(request), &mut Some(target), &new_fetch_context(dc));
});
}

fn fetch_sync(request: Request, dc: Option<Sender<DevtoolsControlMsg>>) -> Response {
fetch(Rc::new(request), &mut None, &new_fetch_context(dc))
methods::fetch(Rc::new(request), &mut None, &new_fetch_context(dc))
}

fn make_server<H: Handler + 'static>(handler: H) -> (Listening, ServoUrl) {
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.