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

Side by Side Diff: content/renderer/shared_worker/embedded_shared_worker_stub.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/shared_worker/embedded_shared_worker_stub.h" 5 #include "content/renderer/shared_worker/embedded_shared_worker_stub.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/threading/thread_task_runner_handle.h" 10 #include "base/threading/thread_task_runner_handle.h"
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 ChildThreadImpl::current()->thread_safe_sender()); 234 ChildThreadImpl::current()->thread_safe_sender());
235 } 235 }
236 236
237 blink::WebServiceWorkerNetworkProvider* 237 blink::WebServiceWorkerNetworkProvider*
238 EmbeddedSharedWorkerStub::createServiceWorkerNetworkProvider( 238 EmbeddedSharedWorkerStub::createServiceWorkerNetworkProvider(
239 blink::WebDataSource* data_source) { 239 blink::WebDataSource* data_source) {
240 // Create a content::ServiceWorkerNetworkProvider for this data source so 240 // Create a content::ServiceWorkerNetworkProvider for this data source so
241 // we can observe its requests. 241 // we can observe its requests.
242 std::unique_ptr<ServiceWorkerNetworkProvider> provider( 242 std::unique_ptr<ServiceWorkerNetworkProvider> provider(
243 new ServiceWorkerNetworkProvider( 243 new ServiceWorkerNetworkProvider(
244 route_id_, SERVICE_WORKER_PROVIDER_FOR_SHARED_WORKER)); 244 route_id_, SERVICE_WORKER_PROVIDER_FOR_SHARED_WORKER,
245 true /* is_parent_frame_secure */));
245 246
246 // The provider is kept around for the lifetime of the DataSource 247 // The provider is kept around for the lifetime of the DataSource
247 // and ownership is transferred to the DataSource. 248 // and ownership is transferred to the DataSource.
248 DataSourceExtraData* extra_data = new DataSourceExtraData(); 249 DataSourceExtraData* extra_data = new DataSourceExtraData();
249 data_source->setExtraData(extra_data); 250 data_source->setExtraData(extra_data);
250 ServiceWorkerNetworkProvider::AttachToDocumentState(extra_data, 251 ServiceWorkerNetworkProvider::AttachToDocumentState(extra_data,
251 std::move(provider)); 252 std::move(provider));
252 253
253 // Blink is responsible for deleting the returned object. 254 // Blink is responsible for deleting the returned object.
254 return new WebServiceWorkerNetworkProviderImpl(); 255 return new WebServiceWorkerNetworkProviderImpl();
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 } 297 }
297 } 298 }
298 299
299 void EmbeddedSharedWorkerStub::OnTerminateWorkerContext() { 300 void EmbeddedSharedWorkerStub::OnTerminateWorkerContext() {
300 // After this we wouldn't get any IPC for this stub. 301 // After this we wouldn't get any IPC for this stub.
301 running_ = false; 302 running_ = false;
302 impl_->terminateWorkerContext(); 303 impl_->terminateWorkerContext();
303 } 304 }
304 305
305 } // namespace content 306 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698