| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "android_webview/browser/renderer_host/aw_resource_dispatcher_host_dele
gate.h" | 5 #include "android_webview/browser/renderer_host/aw_resource_dispatcher_host_dele
gate.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "android_webview/browser/aw_contents_io_thread_client.h" | 9 #include "android_webview/browser/aw_contents_io_thread_client.h" |
| 10 #include "android_webview/browser/aw_login_delegate.h" | 10 #include "android_webview/browser/aw_login_delegate.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 | 34 |
| 35 base::LazyInstance<android_webview::AwResourceDispatcherHostDelegate> | 35 base::LazyInstance<android_webview::AwResourceDispatcherHostDelegate> |
| 36 g_webview_resource_dispatcher_host_delegate = LAZY_INSTANCE_INITIALIZER; | 36 g_webview_resource_dispatcher_host_delegate = LAZY_INSTANCE_INITIALIZER; |
| 37 | 37 |
| 38 void SetCacheControlFlag( | 38 void SetCacheControlFlag( |
| 39 net::URLRequest* request, int flag) { | 39 net::URLRequest* request, int flag) { |
| 40 const int all_cache_control_flags = net::LOAD_BYPASS_CACHE | | 40 const int all_cache_control_flags = net::LOAD_BYPASS_CACHE | |
| 41 net::LOAD_VALIDATE_CACHE | | 41 net::LOAD_VALIDATE_CACHE | |
| 42 net::LOAD_PREFERRING_CACHE | | 42 net::LOAD_PREFERRING_CACHE | |
| 43 net::LOAD_ONLY_FROM_CACHE; | 43 net::LOAD_ONLY_FROM_CACHE; |
| 44 DCHECK((flag & all_cache_control_flags) == flag); | 44 DCHECK_EQ((flag & all_cache_control_flags), flag); |
| 45 int load_flags = request->load_flags(); | 45 int load_flags = request->load_flags(); |
| 46 load_flags &= ~all_cache_control_flags; | 46 load_flags &= ~all_cache_control_flags; |
| 47 load_flags |= flag; | 47 load_flags |= flag; |
| 48 request->SetLoadFlags(load_flags); | 48 request->SetLoadFlags(load_flags); |
| 49 } | 49 } |
| 50 | 50 |
| 51 } // namespace | 51 } // namespace |
| 52 | 52 |
| 53 namespace android_webview { | 53 namespace android_webview { |
| 54 | 54 |
| (...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 421 net::HttpRequestHeaders headers; | 421 net::HttpRequestHeaders headers; |
| 422 headers.AddHeadersFromString(extra_headers); | 422 headers.AddHeadersFromString(extra_headers); |
| 423 for (net::HttpRequestHeaders::Iterator it(headers); it.GetNext(); ) { | 423 for (net::HttpRequestHeaders::Iterator it(headers); it.GetNext(); ) { |
| 424 request->SetExtraRequestHeaderByName(it.name(), it.value(), false); | 424 request->SetExtraRequestHeaderByName(it.name(), it.value(), false); |
| 425 } | 425 } |
| 426 } | 426 } |
| 427 } | 427 } |
| 428 } | 428 } |
| 429 | 429 |
| 430 } // namespace android_webview | 430 } // namespace android_webview |
| OLD | NEW |