| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |