mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Introduce fetch_with_context() to reduce repetition.
This commit is contained in:
parent
8d34ef109d
commit
9d9f048b3b
3 changed files with 19 additions and 15 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue