Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1733)

Unified Diff: android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc

Issue 2398613002: [HttpCache] LOAD_ONLY_FROM_CACHE should not imply LOAD_PREFERRING_CACHE (Closed)
Patch Set: Always check vary Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/safe_browsing/threat_details_cache.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc
diff --git a/android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc b/android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc
index fa0dc8851b5525d99db84ba1955357858b2325e3..98d337bfd53e8fc26f90501c2ac07911314adb81 100644
--- a/android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc
+++ b/android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc
@@ -41,10 +41,9 @@ base::LazyInstance<android_webview::AwResourceDispatcherHostDelegate>
void SetCacheControlFlag(
net::URLRequest* request, int flag) {
- const int all_cache_control_flags = net::LOAD_BYPASS_CACHE |
- net::LOAD_VALIDATE_CACHE |
- net::LOAD_PREFERRING_CACHE |
- net::LOAD_ONLY_FROM_CACHE;
+ const int all_cache_control_flags =
+ net::LOAD_BYPASS_CACHE | net::LOAD_VALIDATE_CACHE |
+ net::LOAD_SKIP_CACHE_VALIDATION | net::LOAD_ONLY_FROM_CACHE;
DCHECK_EQ((flag & all_cache_control_flags), flag);
int load_flags = request->load_flags();
load_flags &= ~all_cache_control_flags;
@@ -177,18 +176,20 @@ bool IoThreadClientThrottle::ShouldBlockRequest() {
if (request_->url().SchemeIs(url::kFtpScheme)) {
return true;
}
- SetCacheControlFlag(request_, net::LOAD_ONLY_FROM_CACHE);
+ SetCacheControlFlag(
+ request_, net::LOAD_ONLY_FROM_CACHE | net::LOAD_SKIP_CACHE_VALIDATION);
} else {
AwContentsIoThreadClient::CacheMode cache_mode = io_client->GetCacheMode();
switch(cache_mode) {
case AwContentsIoThreadClient::LOAD_CACHE_ELSE_NETWORK:
- SetCacheControlFlag(request_, net::LOAD_PREFERRING_CACHE);
+ SetCacheControlFlag(request_, net::LOAD_SKIP_CACHE_VALIDATION);
break;
case AwContentsIoThreadClient::LOAD_NO_CACHE:
SetCacheControlFlag(request_, net::LOAD_BYPASS_CACHE);
break;
case AwContentsIoThreadClient::LOAD_CACHE_ONLY:
- SetCacheControlFlag(request_, net::LOAD_ONLY_FROM_CACHE);
+ SetCacheControlFlag(request_, net::LOAD_ONLY_FROM_CACHE |
+ net::LOAD_SKIP_CACHE_VALIDATION);
break;
default:
break;
« no previous file with comments | « no previous file | chrome/browser/safe_browsing/threat_details_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698