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

Unified Diff: content/browser/appcache/appcache_request_handler.cc

Issue 2902653002: Get main frame and subframe AppCache loads to work. (Closed)
Patch Set: Address portions of the review comments Created 3 years, 7 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
Index: content/browser/appcache/appcache_request_handler.cc
diff --git a/content/browser/appcache/appcache_request_handler.cc b/content/browser/appcache/appcache_request_handler.cc
index 870fa7d35200c73a52989a24241190d1cd360aa3..5b5ba3365bb2007073ab4cd0dc2d634338942958 100644
--- a/content/browser/appcache/appcache_request_handler.cc
+++ b/content/browser/appcache/appcache_request_handler.cc
@@ -316,12 +316,22 @@ std::unique_ptr<AppCacheJob> AppCacheRequestHandler::MaybeLoadMainResource(
// If a page falls into the scope of a ServiceWorker, any matching AppCaches
// should be ignored. This depends on the ServiceWorker handler being invoked
// prior to the AppCache handler.
- if (ServiceWorkerRequestHandler::IsControlledByServiceWorker(
+ // TODO(ananta)
+ // We need to handle this for AppCache requests initiated for the network
+ // service
+ if (request_->GetURLRequest() &&
+ ServiceWorkerRequestHandler::IsControlledByServiceWorker(
request_->GetURLRequest())) {
host_->enable_cache_selection(false);
return nullptr;
}
+ if (service_->storage()->IsInitialized() &&
michaeln 2017/06/02 23:47:27 Please use the storage() method to access the stor
ananta 2017/06/03 01:55:56 Done.
+ service_->storage()->usage_map()->find(request_->GetURL().GetOrigin()) ==
+ service_->storage()->usage_map()->end()) {
+ return nullptr;
+ }
+
host_->enable_cache_selection(true);
const AppCacheHost* spawning_host =

Powered by Google App Engine
This is Rietveld 408576698