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

Unified Diff: content/browser/service_worker/service_worker_request_handler.cc

Issue 1181573010: ServiceWorker: Fix matching registration info missing during shift-reload. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: iterate living registrations Created 5 years, 6 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/service_worker/service_worker_request_handler.cc
diff --git a/content/browser/service_worker/service_worker_request_handler.cc b/content/browser/service_worker/service_worker_request_handler.cc
index c70b3fd9b9e59e40c0f085b255cdc191dc1df0b0..35faad547888834f2a03573cd19191543d70496e 100644
--- a/content/browser/service_worker/service_worker_request_handler.cc
+++ b/content/browser/service_worker/service_worker_request_handler.cc
@@ -15,6 +15,7 @@
#include "content/common/resource_request_body.h"
#include "content/common/service_worker/service_worker_types.h"
#include "content/public/browser/resource_context.h"
+#include "net/base/load_flags.h"
#include "net/base/net_util.h"
#include "net/url_request/url_request.h"
#include "net/url_request/url_request_interceptor.h"
@@ -80,6 +81,10 @@ void ServiceWorkerRequestHandler::InitializeHandler(
if (ServiceWorkerUtils::IsMainResourceType(resource_type)) {
provider_host->SetDocumentUrl(net::SimplifyUrlForRequest(request->url()));
provider_host->SetTopmostFrameUrl(request->first_party_for_cookies());
+ // A page load with skip_service_worker should be triggered by
+ // shift-reload, so retain all live matching registrations.
+ DCHECK(request->load_flags() & net::LOAD_BYPASS_CACHE);
michaeln 2015/06/24 19:47:22 I'm not sure the dcheck is really appropriate, see
xiang 2015/06/25 05:37:32 The dcheck is on the assumption that when a main r
+ provider_host->CopyMatchingRegistrations();
}
return;
}

Powered by Google App Engine
This is Rietveld 408576698