| 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 <memory> | 7 #include <memory> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "android_webview/browser/aw_browser_context.h" | 10 #include "android_webview/browser/aw_browser_context.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 using android_webview::AwContentsIoThreadClient; | 36 using android_webview::AwContentsIoThreadClient; |
| 37 using android_webview::AwContentsClientBridgeBase; | 37 using android_webview::AwContentsClientBridgeBase; |
| 38 using android_webview::AwWebResourceRequest; | 38 using android_webview::AwWebResourceRequest; |
| 39 using content::BrowserThread; | 39 using content::BrowserThread; |
| 40 using content::ResourceType; | 40 using content::ResourceType; |
| 41 using content::WebContents; | 41 using content::WebContents; |
| 42 using navigation_interception::InterceptNavigationDelegate; | 42 using navigation_interception::InterceptNavigationDelegate; |
| 43 | 43 |
| 44 namespace { | 44 namespace { |
| 45 | 45 |
| 46 base::LazyInstance<android_webview::AwResourceDispatcherHostDelegate> | 46 base::LazyInstance<android_webview::AwResourceDispatcherHostDelegate>:: |
| 47 g_webview_resource_dispatcher_host_delegate = LAZY_INSTANCE_INITIALIZER; | 47 DestructorAtExit g_webview_resource_dispatcher_host_delegate = |
| 48 LAZY_INSTANCE_INITIALIZER; |
| 48 | 49 |
| 49 void SetCacheControlFlag( | 50 void SetCacheControlFlag( |
| 50 net::URLRequest* request, int flag) { | 51 net::URLRequest* request, int flag) { |
| 51 const int all_cache_control_flags = | 52 const int all_cache_control_flags = |
| 52 net::LOAD_BYPASS_CACHE | net::LOAD_VALIDATE_CACHE | | 53 net::LOAD_BYPASS_CACHE | net::LOAD_VALIDATE_CACHE | |
| 53 net::LOAD_SKIP_CACHE_VALIDATION | net::LOAD_ONLY_FROM_CACHE; | 54 net::LOAD_SKIP_CACHE_VALIDATION | net::LOAD_ONLY_FROM_CACHE; |
| 54 DCHECK_EQ((flag & all_cache_control_flags), flag); | 55 DCHECK_EQ((flag & all_cache_control_flags), flag); |
| 55 int load_flags = request->load_flags(); | 56 int load_flags = request->load_flags(); |
| 56 load_flags &= ~all_cache_control_flags; | 57 load_flags &= ~all_cache_control_flags; |
| 57 load_flags |= flag; | 58 load_flags |= flag; |
| (...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 491 net::HttpRequestHeaders headers; | 492 net::HttpRequestHeaders headers; |
| 492 headers.AddHeadersFromString(extra_headers); | 493 headers.AddHeadersFromString(extra_headers); |
| 493 for (net::HttpRequestHeaders::Iterator it(headers); it.GetNext(); ) { | 494 for (net::HttpRequestHeaders::Iterator it(headers); it.GetNext(); ) { |
| 494 request->SetExtraRequestHeaderByName(it.name(), it.value(), false); | 495 request->SetExtraRequestHeaderByName(it.name(), it.value(), false); |
| 495 } | 496 } |
| 496 } | 497 } |
| 497 } | 498 } |
| 498 } | 499 } |
| 499 | 500 |
| 500 } // namespace android_webview | 501 } // namespace android_webview |
| OLD | NEW |