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

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

Issue 625433002: Pages controlled by ServiceWorkers should not participate in AppCaching (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
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 7987a9906e8871400422e626d226a14efa762720..a21337c111193c75d4e9c24ab5f2186f09f7b314 100644
--- a/content/browser/appcache/appcache_request_handler.cc
+++ b/content/browser/appcache/appcache_request_handler.cc
@@ -8,6 +8,7 @@
#include "content/browser/appcache/appcache_backend_impl.h"
#include "content/browser/appcache/appcache_policy.h"
#include "content/browser/appcache/appcache_url_request_job.h"
+#include "content/browser/service_worker/service_worker_request_handler.h"
#include "net/url_request/url_request.h"
#include "net/url_request/url_request_job.h"
@@ -238,6 +239,16 @@ void AppCacheRequestHandler::MaybeLoadMainResource(
DCHECK(!job_.get());
DCHECK(host_);
+ // 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.
michaeln 2014/10/03 01:09:46 bah... the ordering is wrong, appcache gets called
+ if (ServiceWorkerRequestHandler::IsControlledByServiceWorker(request)) {
+ host_->enable_cache_selection(false);
+ return;
+ }
+
+ host_->enable_cache_selection(true);
+
const AppCacheHost* spawning_host =
(resource_type_ == RESOURCE_TYPE_SHARED_WORKER) ?
host_ : host_->GetSpawningHost();
« no previous file with comments | « content/browser/appcache/appcache_host.cc ('k') | content/browser/service_worker/service_worker_provider_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698