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. |
+ 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(); |