diff options
author | Daniel Robertson <dan.robertson@anidata.org> | 2016-04-27 16:56:20 -0400 |
---|---|---|
committer | Daniel Robertson <dan.robertson@anidata.org> | 2016-04-27 17:02:54 -0400 |
commit | 483f07c8f012ded73347dd0307eb4d09dba96a94 (patch) | |
tree | 05bbc004aab98b2ac3ec728b42e25ffed2fb95b7 /components/net/fetch/methods.rs | |
parent | 153059c55c7578c63d607f8f29a8ad6b00f0bb16 (diff) | |
download | servo-483f07c8f012ded73347dd0307eb4d09dba96a94.tar.gz servo-483f07c8f012ded73347dd0307eb4d09dba96a94.zip |
Cleanup CORSCache
Remove the CORSCache trait, CORSCacheSender, CORSCacheThreadMsg, and
CORSCacheThread. Rename BasicCORSCache to CORSCache and keep its old
implementation of CORSCache.
Diffstat (limited to 'components/net/fetch/methods.rs')
-rw-r--r-- | components/net/fetch/methods.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/components/net/fetch/methods.rs b/components/net/fetch/methods.rs index bbf35fb0222..868d284707f 100644 --- a/components/net/fetch/methods.rs +++ b/components/net/fetch/methods.rs @@ -3,7 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use data_loader::decode; -use fetch::cors_cache::{BasicCORSCache, CORSCache, CacheRequestDetails}; +use fetch::cors_cache::{CORSCache, CacheRequestDetails}; use http_loader::{NetworkHttpRequestFactory, create_http_connector, obtain_response}; use hyper::header::{Accept, AcceptLanguage, Authorization, AccessControlAllowCredentials}; use hyper::header::{AccessControlAllowOrigin, AccessControlAllowHeaders, AccessControlAllowMethods}; @@ -40,10 +40,10 @@ pub fn fetch_async(request: Request, listener: Box<AsyncFetchListener + Send>) { /// [Fetch](https://fetch.spec.whatwg.org#concept-fetch) pub fn fetch(request: Rc<Request>) -> Response { - fetch_with_cors_cache(request, &mut BasicCORSCache::new()) + fetch_with_cors_cache(request, &mut CORSCache::new()) } -pub fn fetch_with_cors_cache(request: Rc<Request>, cache: &mut BasicCORSCache) -> Response { +pub fn fetch_with_cors_cache(request: Rc<Request>, cache: &mut CORSCache) -> Response { // Step 1 if request.window.get() == Window::Client { @@ -110,7 +110,7 @@ pub fn fetch_with_cors_cache(request: Rc<Request>, cache: &mut BasicCORSCache) - } /// [Main fetch](https://fetch.spec.whatwg.org/#concept-main-fetch) -fn main_fetch(request: Rc<Request>, cache: &mut BasicCORSCache, cors_flag: bool, recursive_flag: bool) -> Response { +fn main_fetch(request: Rc<Request>, cache: &mut CORSCache, cors_flag: bool, recursive_flag: bool) -> Response { // TODO: Implement main fetch spec // Step 1 @@ -284,7 +284,7 @@ fn main_fetch(request: Rc<Request>, cache: &mut BasicCORSCache, cors_flag: bool, } /// [Basic fetch](https://fetch.spec.whatwg.org#basic-fetch) -fn basic_fetch(request: Rc<Request>, cache: &mut BasicCORSCache) -> Response { +fn basic_fetch(request: Rc<Request>, cache: &mut CORSCache) -> Response { let url = request.current_url(); @@ -328,7 +328,7 @@ fn basic_fetch(request: Rc<Request>, cache: &mut BasicCORSCache) -> Response { /// [HTTP fetch](https://fetch.spec.whatwg.org#http-fetch) fn http_fetch(request: Rc<Request>, - cache: &mut BasicCORSCache, + cache: &mut CORSCache, cors_flag: bool, cors_preflight_flag: bool, authentication_fetch_flag: bool) -> Response { @@ -507,7 +507,7 @@ fn http_fetch(request: Rc<Request>, /// [HTTP redirect fetch](https://fetch.spec.whatwg.org#http-redirect-fetch) fn http_redirect_fetch(request: Rc<Request>, - cache: &mut BasicCORSCache, + cache: &mut CORSCache, response: Rc<Response>, cors_flag: bool) -> Response { @@ -922,7 +922,7 @@ fn http_network_fetch(request: Rc<Request>, } /// [CORS preflight fetch](https://fetch.spec.whatwg.org#cors-preflight-fetch) -fn cors_preflight_fetch(request: Rc<Request>, cache: &mut BasicCORSCache) -> Response { +fn cors_preflight_fetch(request: Rc<Request>, cache: &mut CORSCache) -> Response { // Step 1 let mut preflight = Request::new(request.current_url(), Some(request.origin.borrow().clone()), false); *preflight.method.borrow_mut() = Method::Options; |