| 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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 HeaderFlattener flattener; | 182 HeaderFlattener flattener; |
| 183 request.visitHTTPHeaderFields(&flattener); | 183 request.visitHTTPHeaderFields(&flattener); |
| 184 return flattener.GetBuffer(); | 184 return flattener.GetBuffer(); |
| 185 } | 185 } |
| 186 | 186 |
| 187 int GetLoadFlagsForWebURLRequest(const blink::WebURLRequest& request) { | 187 int GetLoadFlagsForWebURLRequest(const blink::WebURLRequest& request) { |
| 188 int load_flags = net::LOAD_NORMAL; | 188 int load_flags = net::LOAD_NORMAL; |
| 189 GURL url = request.url(); | 189 GURL url = request.url(); |
| 190 switch (request.getCachePolicy()) { | 190 switch (request.getCachePolicy()) { |
| 191 case WebCachePolicy::ValidatingCacheData: | 191 case WebCachePolicy::ValidatingCacheData: |
| 192 load_flags |= net::LOAD_VALIDATE_CACHE; | |
| 193 break; | 192 break; |
| 194 case WebCachePolicy::BypassingCache: | 193 case WebCachePolicy::BypassingCache: |
| 195 load_flags |= net::LOAD_BYPASS_CACHE; | 194 load_flags |= net::LOAD_BYPASS_CACHE; |
| 196 break; | 195 break; |
| 197 case WebCachePolicy::ReturnCacheDataElseLoad: | 196 case WebCachePolicy::ReturnCacheDataElseLoad: |
| 198 load_flags |= net::LOAD_PREFERRING_CACHE; | 197 load_flags |= net::LOAD_PREFERRING_CACHE; |
| 199 break; | 198 break; |
| 200 case WebCachePolicy::ReturnCacheDataDontLoad: | 199 case WebCachePolicy::ReturnCacheDataDontLoad: |
| 201 load_flags |= net::LOAD_ONLY_FROM_CACHE; | 200 load_flags |= net::LOAD_ONLY_FROM_CACHE; |
| 202 break; | 201 break; |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 434 bool stale_copy_in_cache, | 433 bool stale_copy_in_cache, |
| 435 int reason, | 434 int reason, |
| 436 bool was_ignored_by_handler) { | 435 bool was_ignored_by_handler) { |
| 437 blink::WebURLError error = | 436 blink::WebURLError error = |
| 438 CreateWebURLError(unreachable_url, stale_copy_in_cache, reason); | 437 CreateWebURLError(unreachable_url, stale_copy_in_cache, reason); |
| 439 error.wasIgnoredByHandler = was_ignored_by_handler; | 438 error.wasIgnoredByHandler = was_ignored_by_handler; |
| 440 return error; | 439 return error; |
| 441 } | 440 } |
| 442 | 441 |
| 443 } // namespace content | 442 } // namespace content |
| OLD | NEW |