Introduce fetch_with_context() to reduce repetition.

This commit is contained in:
Ms2ger 2016-12-02 11:52:44 +01:00
parent 8d34ef109d
commit 9d9f048b3b
3 changed files with 19 additions and 15 deletions

View file

@ -79,7 +79,11 @@ fn fetch_async(request: Request, target: Box<FetchTaskTarget + Send>, dc: Option
}
fn fetch_sync(request: Request, dc: Option<Sender<DevtoolsControlMsg>>) -> Response {
methods::fetch(Rc::new(request), &mut None, &new_fetch_context(dc))
fetch_with_context(request, &new_fetch_context(dc))
}
fn fetch_with_context(request: Request, context: &FetchContext) -> Response {
methods::fetch(Rc::new(request), &mut None, context)
}
fn make_server<H: Handler + 'static>(handler: H) -> (Listening, ServoUrl) {