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

Side by Side Diff: content/browser/loader/async_revalidation_manager.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 unified diff | Download patch
« no previous file with comments | « content/browser/frame_host/navigation_request.cc ('k') | content/child/web_url_request_util.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/browser/loader/async_revalidation_manager.h" 5 #include "content/browser/loader/async_revalidation_manager.h"
6 6
7 #include <tuple> 7 #include <tuple>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 it != in_progress_.end() && 162 it != in_progress_.end() &&
163 it->first.resource_context == resource_context;) { 163 it->first.resource_context == resource_context;) {
164 it = in_progress_.erase(it); 164 it = in_progress_.erase(it);
165 } 165 }
166 } 166 }
167 167
168 bool AsyncRevalidationManager::QualifiesForAsyncRevalidation( 168 bool AsyncRevalidationManager::QualifiesForAsyncRevalidation(
169 const ResourceRequest& request) { 169 const ResourceRequest& request) {
170 if (request.load_flags & 170 if (request.load_flags &
171 (net::LOAD_BYPASS_CACHE | net::LOAD_DISABLE_CACHE | 171 (net::LOAD_BYPASS_CACHE | net::LOAD_DISABLE_CACHE |
172 net::LOAD_VALIDATE_CACHE | net::LOAD_PREFERRING_CACHE | 172 net::LOAD_VALIDATE_CACHE | net::LOAD_SKIP_CACHE_VALIDATION |
173 net::LOAD_ONLY_FROM_CACHE | net::LOAD_IGNORE_LIMITS | 173 net::LOAD_ONLY_FROM_CACHE | net::LOAD_IGNORE_LIMITS |
174 net::LOAD_PREFETCH)) { 174 net::LOAD_PREFETCH)) {
175 return false; 175 return false;
176 } 176 }
177 if (request.method != "GET") 177 if (request.method != "GET")
178 return false; 178 return false;
179 // A GET request should not have a body. 179 // A GET request should not have a body.
180 if (request.request_body.get()) 180 if (request.request_body.get())
181 return false; 181 return false;
182 if (!request.url.SchemeIsHTTPOrHTTPS()) 182 if (!request.url.SchemeIsHTTPOrHTTPS())
183 return false; 183 return false;
184 184
185 return true; 185 return true;
186 } 186 }
187 187
188 void AsyncRevalidationManager::OnAsyncRevalidationComplete( 188 void AsyncRevalidationManager::OnAsyncRevalidationComplete(
189 AsyncRevalidationMap::iterator it) { 189 AsyncRevalidationMap::iterator it) {
190 in_progress_.erase(it); 190 in_progress_.erase(it);
191 } 191 }
192 192
193 } // namespace content 193 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/navigation_request.cc ('k') | content/child/web_url_request_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698