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

Side by Side 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 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 613 matching lines...) Expand 10 before | Expand all | Expand 10 after
624 const StatusCallback& callback) { 624 const StatusCallback& callback) {
625 job_coordinator_->AbortAll(); 625 job_coordinator_->AbortAll();
626 storage_->DeleteAndStartOver(callback); 626 storage_->DeleteAndStartOver(callback);
627 } 627 }
628 628
629 std::unique_ptr<ServiceWorkerProviderHost> 629 std::unique_ptr<ServiceWorkerProviderHost>
630 ServiceWorkerContextCore::TransferProviderHostOut(int process_id, 630 ServiceWorkerContextCore::TransferProviderHostOut(int process_id,
631 int provider_id) { 631 int provider_id) {
632 ProviderMap* map = GetProviderMapForProcess(process_id); 632 ProviderMap* map = GetProviderMapForProcess(process_id);
633 ServiceWorkerProviderHost* transferee = map->Lookup(provider_id); 633 ServiceWorkerProviderHost* transferee = map->Lookup(provider_id);
634 ServiceWorkerProviderHost* replacement = 634 ServiceWorkerProviderHost* replacement = new ServiceWorkerProviderHost(
635 new ServiceWorkerProviderHost(process_id, 635 process_id, transferee->frame_id(), provider_id,
636 transferee->frame_id(), 636 transferee->provider_type(),
637 provider_id, 637 transferee->is_parent_frame_secure()
638 transferee->provider_type(), 638 ? ServiceWorkerProviderHost::FrameSecurityLevel::SECURE
639 AsWeakPtr(), 639 : ServiceWorkerProviderHost::FrameSecurityLevel::INSECURE,
640 transferee->dispatcher_host()); 640 AsWeakPtr(), transferee->dispatcher_host());
641 map->Replace(provider_id, replacement); 641 map->Replace(provider_id, replacement);
642 transferee->PrepareForCrossSiteTransfer(); 642 transferee->PrepareForCrossSiteTransfer();
643 return base::WrapUnique(transferee); 643 return base::WrapUnique(transferee);
644 } 644 }
645 645
646 void ServiceWorkerContextCore::TransferProviderHostIn( 646 void ServiceWorkerContextCore::TransferProviderHostIn(
647 int new_process_id, 647 int new_process_id,
648 int new_provider_id, 648 int new_provider_id,
649 std::unique_ptr<ServiceWorkerProviderHost> transferee) { 649 std::unique_ptr<ServiceWorkerProviderHost> transferee) {
650 ProviderMap* map = GetProviderMapForProcess(new_process_id); 650 ProviderMap* map = GetProviderMapForProcess(new_process_id);
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
850 } 850 }
851 851
852 void ServiceWorkerContextCore::OnRegistrationFinishedForCheckHasServiceWorker( 852 void ServiceWorkerContextCore::OnRegistrationFinishedForCheckHasServiceWorker(
853 const ServiceWorkerContext::CheckHasServiceWorkerCallback callback, 853 const ServiceWorkerContext::CheckHasServiceWorkerCallback callback,
854 const scoped_refptr<ServiceWorkerRegistration>& registration) { 854 const scoped_refptr<ServiceWorkerRegistration>& registration) {
855 callback.Run(registration->active_version() || 855 callback.Run(registration->active_version() ||
856 registration->waiting_version()); 856 registration->waiting_version());
857 } 857 }
858 858
859 } // namespace content 859 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698