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

Side by Side Diff: content/renderer/service_worker/service_worker_context_client.cc

Issue 2061203002: WIP Reland: service worker: Don't control a subframe of an insecure context Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: maybe fix drmemory 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/renderer/service_worker/service_worker_context_client.h" 5 #include "content/renderer/service_worker/service_worker_context_client.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after
567 567
568 blink::WebServiceWorkerNetworkProvider* 568 blink::WebServiceWorkerNetworkProvider*
569 ServiceWorkerContextClient::createServiceWorkerNetworkProvider( 569 ServiceWorkerContextClient::createServiceWorkerNetworkProvider(
570 blink::WebDataSource* data_source) { 570 blink::WebDataSource* data_source) {
571 DCHECK(main_thread_task_runner_->RunsTasksOnCurrentThread()); 571 DCHECK(main_thread_task_runner_->RunsTasksOnCurrentThread());
572 572
573 // Create a content::ServiceWorkerNetworkProvider for this data source so 573 // Create a content::ServiceWorkerNetworkProvider for this data source so
574 // we can observe its requests. 574 // we can observe its requests.
575 std::unique_ptr<ServiceWorkerNetworkProvider> provider( 575 std::unique_ptr<ServiceWorkerNetworkProvider> provider(
576 new ServiceWorkerNetworkProvider(MSG_ROUTING_NONE, 576 new ServiceWorkerNetworkProvider(MSG_ROUTING_NONE,
577 SERVICE_WORKER_PROVIDER_FOR_CONTROLLER)); 577 SERVICE_WORKER_PROVIDER_FOR_CONTROLLER,
578 true /* is_parent_frame_secure */));
578 provider_context_ = provider->context(); 579 provider_context_ = provider->context();
579 580
580 // Tell the network provider about which version to load. 581 // Tell the network provider about which version to load.
581 provider->SetServiceWorkerVersionId(service_worker_version_id_); 582 provider->SetServiceWorkerVersionId(service_worker_version_id_);
582 583
583 // The provider is kept around for the lifetime of the DataSource 584 // The provider is kept around for the lifetime of the DataSource
584 // and ownership is transferred to the DataSource. 585 // and ownership is transferred to the DataSource.
585 DataSourceExtraData* extra_data = new DataSourceExtraData(); 586 DataSourceExtraData* extra_data = new DataSourceExtraData();
586 data_source->setExtraData(extra_data); 587 data_source->setExtraData(extra_data);
587 ServiceWorkerNetworkProvider::AttachToDocumentState(extra_data, 588 ServiceWorkerNetworkProvider::AttachToDocumentState(extra_data,
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after
1017 } 1018 }
1018 1019
1019 base::WeakPtr<ServiceWorkerContextClient> 1020 base::WeakPtr<ServiceWorkerContextClient>
1020 ServiceWorkerContextClient::GetWeakPtr() { 1021 ServiceWorkerContextClient::GetWeakPtr() {
1021 DCHECK(worker_task_runner_->RunsTasksOnCurrentThread()); 1022 DCHECK(worker_task_runner_->RunsTasksOnCurrentThread());
1022 DCHECK(context_); 1023 DCHECK(context_);
1023 return context_->weak_factory.GetWeakPtr(); 1024 return context_->weak_factory.GetWeakPtr();
1024 } 1025 }
1025 1026
1026 } // namespace content 1027 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/render_frame_impl.cc ('k') | content/renderer/shared_worker/embedded_shared_worker_stub.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698