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

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

Issue 625533002: Respect content settings for Service Worker registration (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@testing
Patch Set: sync 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/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 83ab7c3eb5d2f52ad63228e9fa352e7ff958662e..82470e1af9fd9352f252fd5b42a29e34205c48c6 100644
--- a/content/browser/service_worker/service_worker_controllee_request_handler.cc
+++ b/content/browser/service_worker/service_worker_controllee_request_handler.cc
@@ -94,7 +94,7 @@ net::URLRequestJob* ServiceWorkerControlleeRequestHandler::MaybeCreateJob(
frame_type_,
body_);
if (is_main_resource_load_)
- PrepareForMainResource(request->url());
+ PrepareForMainResource(request);
else
PrepareForSubResource();
@@ -131,7 +131,7 @@ void ServiceWorkerControlleeRequestHandler::GetExtraResponseInfo(
}
void ServiceWorkerControlleeRequestHandler::PrepareForMainResource(
- const GURL& url) {
+ const net::URLRequest* request) {
DCHECK(job_.get());
DCHECK(context_);
DCHECK(provider_host_);
@@ -139,7 +139,7 @@ void ServiceWorkerControlleeRequestHandler::PrepareForMainResource(
"ServiceWorker",
"ServiceWorkerControlleeRequestHandler::PrepareForMainResource",
job_.get(),
- "URL", url.spec());
+ "URL", request->url().spec());
// The corresponding provider_host may already have associated a registration
// in redirect case, unassociate it now.
provider_host_->DisassociateRegistration();
@@ -148,8 +148,9 @@ void ServiceWorkerControlleeRequestHandler::PrepareForMainResource(
// registration while we're finding an existing registration.
provider_host_->SetAllowAssociation(false);
- GURL stripped_url = net::SimplifyUrlForRequest(url);
+ GURL stripped_url = net::SimplifyUrlForRequest(request->url());
provider_host_->SetDocumentUrl(stripped_url);
+ provider_host_->SetTopmostFrameUrl(request->first_party_for_cookies());
context_->storage()->FindRegistrationForDocument(
stripped_url,
base::Bind(&self::DidLookupRegistrationForMainResource,

Powered by Google App Engine
This is Rietveld 408576698