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

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

Issue 2009453002: service worker: Don't control a subframe of an insecure context (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: refactor errorMessage Created 4 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_context_core.cc
diff --git a/content/browser/service_worker/service_worker_context_core.cc b/content/browser/service_worker/service_worker_context_core.cc
index 704f821d151d6b7c874d6452728743f0b82973a6..5afed8a7c8dcef484ef12a6a3fece1e08a57702c 100644
--- a/content/browser/service_worker/service_worker_context_core.cc
+++ b/content/browser/service_worker/service_worker_context_core.cc
@@ -631,13 +631,13 @@ ServiceWorkerContextCore::TransferProviderHostOut(int process_id,
int provider_id) {
ProviderMap* map = GetProviderMapForProcess(process_id);
ServiceWorkerProviderHost* transferee = map->Lookup(provider_id);
- ServiceWorkerProviderHost* replacement =
- new ServiceWorkerProviderHost(process_id,
- transferee->frame_id(),
- provider_id,
- transferee->provider_type(),
- AsWeakPtr(),
- transferee->dispatcher_host());
+ ServiceWorkerProviderHost* replacement = new ServiceWorkerProviderHost(
+ process_id, transferee->frame_id(), provider_id,
+ transferee->provider_type(),
+ transferee->is_parent_frame_secure()
+ ? ServiceWorkerProviderHost::FrameSecurityLevel::SECURE
+ : ServiceWorkerProviderHost::FrameSecurityLevel::INSECURE,
+ AsWeakPtr(), transferee->dispatcher_host());
map->Replace(provider_id, replacement);
transferee->PrepareForCrossSiteTransfer();
return base::WrapUnique(transferee);

Powered by Google App Engine
This is Rietveld 408576698