| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/child/web_url_request_util.h" | 5 #include "content/child/web_url_request_util.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <limits> | 10 #include <limits> |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 int load_flags = net::LOAD_NORMAL; | 192 int load_flags = net::LOAD_NORMAL; |
| 193 GURL url = request.url(); | 193 GURL url = request.url(); |
| 194 switch (request.getCachePolicy()) { | 194 switch (request.getCachePolicy()) { |
| 195 case WebCachePolicy::ValidatingCacheData: | 195 case WebCachePolicy::ValidatingCacheData: |
| 196 load_flags |= net::LOAD_VALIDATE_CACHE; | 196 load_flags |= net::LOAD_VALIDATE_CACHE; |
| 197 break; | 197 break; |
| 198 case WebCachePolicy::BypassingCache: | 198 case WebCachePolicy::BypassingCache: |
| 199 load_flags |= net::LOAD_BYPASS_CACHE; | 199 load_flags |= net::LOAD_BYPASS_CACHE; |
| 200 break; | 200 break; |
| 201 case WebCachePolicy::ReturnCacheDataElseLoad: | 201 case WebCachePolicy::ReturnCacheDataElseLoad: |
| 202 load_flags |= net::LOAD_PREFERRING_CACHE; | 202 load_flags |= net::LOAD_SKIP_CACHE_VALIDATION; |
| 203 break; | 203 break; |
| 204 case WebCachePolicy::ReturnCacheDataDontLoad: | 204 case WebCachePolicy::ReturnCacheDataDontLoad: |
| 205 load_flags |= net::LOAD_ONLY_FROM_CACHE; | 205 load_flags |= net::LOAD_ONLY_FROM_CACHE | net::LOAD_SKIP_CACHE_VALIDATION; |
| 206 break; | 206 break; |
| 207 case WebCachePolicy::UseProtocolCachePolicy: | 207 case WebCachePolicy::UseProtocolCachePolicy: |
| 208 break; | 208 break; |
| 209 default: | 209 default: |
| 210 NOTREACHED(); | 210 NOTREACHED(); |
| 211 } | 211 } |
| 212 | 212 |
| 213 if (!request.allowStoredCredentials()) { | 213 if (!request.allowStoredCredentials()) { |
| 214 load_flags |= net::LOAD_DO_NOT_SAVE_COOKIES; | 214 load_flags |= net::LOAD_DO_NOT_SAVE_COOKIES; |
| 215 load_flags |= net::LOAD_DO_NOT_SEND_COOKIES; | 215 load_flags |= net::LOAD_DO_NOT_SEND_COOKIES; |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 501 bool stale_copy_in_cache, | 501 bool stale_copy_in_cache, |
| 502 int reason, | 502 int reason, |
| 503 bool was_ignored_by_handler) { | 503 bool was_ignored_by_handler) { |
| 504 blink::WebURLError error = | 504 blink::WebURLError error = |
| 505 CreateWebURLError(unreachable_url, stale_copy_in_cache, reason); | 505 CreateWebURLError(unreachable_url, stale_copy_in_cache, reason); |
| 506 error.wasIgnoredByHandler = was_ignored_by_handler; | 506 error.wasIgnoredByHandler = was_ignored_by_handler; |
| 507 return error; | 507 return error; |
| 508 } | 508 } |
| 509 | 509 |
| 510 } // namespace content | 510 } // namespace content |
| OLD | NEW |