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 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 | 190 |
191 std::string GetWebURLRequestHeaders(const blink::WebURLRequest& request) { | 191 std::string GetWebURLRequestHeaders(const blink::WebURLRequest& request) { |
192 HeaderFlattener flattener; | 192 HeaderFlattener flattener; |
193 request.visitHTTPHeaderFields(&flattener); | 193 request.visitHTTPHeaderFields(&flattener); |
194 return flattener.GetBuffer(); | 194 return flattener.GetBuffer(); |
195 } | 195 } |
196 | 196 |
197 int GetLoadFlagsForWebURLRequest(const blink::WebURLRequest& request) { | 197 int GetLoadFlagsForWebURLRequest(const blink::WebURLRequest& request) { |
198 int load_flags = net::LOAD_NORMAL; | 198 int load_flags = net::LOAD_NORMAL; |
199 GURL url = request.url(); | 199 GURL url = request.url(); |
200 switch (request.cachePolicy()) { | 200 switch (request.getCachePolicy()) { |
201 case WebURLRequest::ReloadIgnoringCacheData: | 201 case WebURLRequest::ReloadIgnoringCacheData: |
202 // Required by LayoutTests/http/tests/misc/refresh-headers.php | 202 // Required by LayoutTests/http/tests/misc/refresh-headers.php |
203 load_flags |= net::LOAD_VALIDATE_CACHE; | 203 load_flags |= net::LOAD_VALIDATE_CACHE; |
204 break; | 204 break; |
205 case WebURLRequest::ReloadBypassingCache: | 205 case WebURLRequest::ReloadBypassingCache: |
206 load_flags |= net::LOAD_BYPASS_CACHE; | 206 load_flags |= net::LOAD_BYPASS_CACHE; |
207 break; | 207 break; |
208 case WebURLRequest::ReturnCacheDataElseLoad: | 208 case WebURLRequest::ReturnCacheDataElseLoad: |
209 load_flags |= net::LOAD_PREFERRING_CACHE; | 209 load_flags |= net::LOAD_PREFERRING_CACHE; |
210 break; | 210 break; |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
443 bool stale_copy_in_cache, | 443 bool stale_copy_in_cache, |
444 int reason, | 444 int reason, |
445 bool was_ignored_by_handler) { | 445 bool was_ignored_by_handler) { |
446 blink::WebURLError error = | 446 blink::WebURLError error = |
447 CreateWebURLError(unreachable_url, stale_copy_in_cache, reason); | 447 CreateWebURLError(unreachable_url, stale_copy_in_cache, reason); |
448 error.wasIgnoredByHandler = was_ignored_by_handler; | 448 error.wasIgnoredByHandler = was_ignored_by_handler; |
449 return error; | 449 return error; |
450 } | 450 } |
451 | 451 |
452 } // namespace content | 452 } // namespace content |
OLD | NEW |