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

Side by Side Diff: content/browser/service_worker/service_worker_context_core.cc

Issue 2071433003: Reland: service worker: Don't control a subframe of an insecure context (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: revised 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/service_worker/service_worker_context_core.h" 5 #include "content/browser/service_worker/service_worker_context_core.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <set> 8 #include <set>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after
625 const StatusCallback& callback) { 625 const StatusCallback& callback) {
626 job_coordinator_->AbortAll(); 626 job_coordinator_->AbortAll();
627 storage_->DeleteAndStartOver(callback); 627 storage_->DeleteAndStartOver(callback);
628 } 628 }
629 629
630 std::unique_ptr<ServiceWorkerProviderHost> 630 std::unique_ptr<ServiceWorkerProviderHost>
631 ServiceWorkerContextCore::TransferProviderHostOut(int process_id, 631 ServiceWorkerContextCore::TransferProviderHostOut(int process_id,
632 int provider_id) { 632 int provider_id) {
633 ProviderMap* map = GetProviderMapForProcess(process_id); 633 ProviderMap* map = GetProviderMapForProcess(process_id);
634 ServiceWorkerProviderHost* transferee = map->Lookup(provider_id); 634 ServiceWorkerProviderHost* transferee = map->Lookup(provider_id);
635 ServiceWorkerProviderHost* replacement = 635 ServiceWorkerProviderHost* replacement = new ServiceWorkerProviderHost(
636 new ServiceWorkerProviderHost(process_id, 636 process_id, transferee->frame_id(), provider_id,
637 transferee->frame_id(), 637 transferee->provider_type(),
638 provider_id, 638 transferee->is_parent_frame_secure()
639 transferee->provider_type(), 639 ? ServiceWorkerProviderHost::FrameSecurityLevel::SECURE
640 AsWeakPtr(), 640 : ServiceWorkerProviderHost::FrameSecurityLevel::INSECURE,
641 transferee->dispatcher_host()); 641 AsWeakPtr(), transferee->dispatcher_host());
642 map->Replace(provider_id, replacement); 642 map->Replace(provider_id, replacement);
643 transferee->PrepareForCrossSiteTransfer(); 643 transferee->PrepareForCrossSiteTransfer();
644 return base::WrapUnique(transferee); 644 return base::WrapUnique(transferee);
645 } 645 }
646 646
647 void ServiceWorkerContextCore::TransferProviderHostIn( 647 void ServiceWorkerContextCore::TransferProviderHostIn(
648 int new_process_id, 648 int new_process_id,
649 int new_provider_id, 649 int new_provider_id,
650 std::unique_ptr<ServiceWorkerProviderHost> transferee) { 650 std::unique_ptr<ServiceWorkerProviderHost> transferee) {
651 ProviderMap* map = GetProviderMapForProcess(new_process_id); 651 ProviderMap* map = GetProviderMapForProcess(new_process_id);
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
851 } 851 }
852 852
853 void ServiceWorkerContextCore::OnRegistrationFinishedForCheckHasServiceWorker( 853 void ServiceWorkerContextCore::OnRegistrationFinishedForCheckHasServiceWorker(
854 const ServiceWorkerContext::CheckHasServiceWorkerCallback callback, 854 const ServiceWorkerContext::CheckHasServiceWorkerCallback callback,
855 const scoped_refptr<ServiceWorkerRegistration>& registration) { 855 const scoped_refptr<ServiceWorkerRegistration>& registration) {
856 callback.Run(registration->active_version() || 856 callback.Run(registration->active_version() ||
857 registration->waiting_version()); 857 registration->waiting_version());
858 } 858 }
859 859
860 } // namespace content 860 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698