Skip to content

Commit

Permalink
Rename basic fetch to scheme fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
KiChjang committed Aug 8, 2017
1 parent ed9c165 commit b50bcdc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions components/net/fetch/methods.rs
Expand Up @@ -185,7 +185,7 @@ pub fn main_fetch(request: &mut Request,
request.response_tainting = ResponseTainting::Basic;

// Substep 2.
basic_fetch(request, cache, target, done_chan, context)
scheme_fetch(request, cache, target, done_chan, context)

} else if request.mode == RequestMode::SameOrigin {
Response::network_error(NetworkError::Internal("Cross-origin response".into()))
Expand All @@ -195,7 +195,7 @@ pub fn main_fetch(request: &mut Request,
request.response_tainting = ResponseTainting::Opaque;

// Substep 2.
basic_fetch(request, cache, target, done_chan, context)
scheme_fetch(request, cache, target, done_chan, context)

} else if !matches!(current_url.scheme(), "http" | "https") {
Response::network_error(NetworkError::Internal("Non-http scheme".into()))
Expand Down Expand Up @@ -397,7 +397,7 @@ fn wait_for_response(response: &Response, target: Target, done_chan: &mut DoneCh
let body = response.body.lock().unwrap();
if let ResponseBody::Done(ref vec) = *body {
// in case there was no channel to wait for, the body was
// obtained synchronously via basic_fetch for data/file/about/etc
// obtained synchronously via scheme_fetch for data/file/about/etc
// We should still send the body across as a chunk
target.process_response_chunk(vec.clone());
} else {
Expand All @@ -406,8 +406,8 @@ fn wait_for_response(response: &Response, target: Target, done_chan: &mut DoneCh
}
}

/// [Basic fetch](https://fetch.spec.whatwg.org#basic-fetch)
fn basic_fetch(request: &mut Request,
/// [Scheme fetch](https://fetch.spec.whatwg.org#scheme-fetch)
fn scheme_fetch(request: &mut Request,
cache: &mut CorsCache,
target: Target,
done_chan: &mut DoneChannel,
Expand Down
6 changes: 3 additions & 3 deletions components/net/websocket_loader.rs
Expand Up @@ -352,7 +352,7 @@ fn main_fetch(url: ServoUrl,
// doesn't need to be filtered at all.

// Step 12.2.
basic_fetch(&url, origin, &mut headers, http_state)
scheme_fetch(&url, origin, &mut headers, http_state)
});

// Step 13.
Expand Down Expand Up @@ -386,8 +386,8 @@ fn main_fetch(url: ServoUrl,
response
}

// https://fetch.spec.whatwg.org/#concept-basic-fetch
fn basic_fetch(url: &ServoUrl,
// https://fetch.spec.whatwg.org/#concept-scheme-fetch
fn scheme_fetch(url: &ServoUrl,
origin: String,
headers: &mut Headers,
http_state: &HttpState)
Expand Down

0 comments on commit b50bcdc

Please sign in to comment.