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

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

Issue 362183002: ServiceWorker: Set provider host document URL for no-cache load. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/service_worker/service_worker_controllee_request_handler.cc
diff --git a/content/browser/service_worker/service_worker_controllee_request_handler.cc b/content/browser/service_worker/service_worker_controllee_request_handler.cc
index 4ae7ef20a9a7fe3cac9364d8d68b24ea3da8b356..98a5208f374ab2d471dddbb4fc42c9c80875a34c 100644
--- a/content/browser/service_worker/service_worker_controllee_request_handler.cc
+++ b/content/browser/service_worker/service_worker_controllee_request_handler.cc
@@ -45,6 +45,9 @@ ServiceWorkerControlleeRequestHandler::
net::URLRequestJob* ServiceWorkerControlleeRequestHandler::MaybeCreateJob(
net::URLRequest* request,
net::NetworkDelegate* network_delegate) {
+ if (is_main_resource_load_ && provider_host_)
+ provider_host_->SetDocumentUrl(request->url());
+
if (!context_ || !provider_host_ ||
request->load_flags() & net::LOAD_BYPASS_CACHE) {
michaeln 2014/07/02 18:40:30 might make sense to split the BYPASS condition out
// We can't do anything other than to fall back to network.
@@ -97,7 +100,6 @@ void ServiceWorkerControlleeRequestHandler::PrepareForMainResource(
provider_host_->SetWaitingVersion(NULL);
GURL stripped_url = net::SimplifyUrlForRequest(url);
- provider_host_->SetDocumentUrl(stripped_url);
michaeln 2014/07/02 18:40:30 probably should continue to pass in a stripped_url
context_->storage()->FindRegistrationForDocument(
stripped_url,
base::Bind(&self::DidLookupRegistrationForMainResource,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698