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

Side by Side Diff: content/child/service_worker/web_service_worker_provider_impl.cc

Issue 1191293002: Don't create ServiceWorkerProviderHost for sandboxed frames without allow-same-origin flag. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: incorporated kinuko's comment Created 5 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/child/service_worker/web_service_worker_provider_impl.h" 5 #include "content/child/service_worker/web_service_worker_provider_impl.h"
6 6
7 #include "content/child/service_worker/service_worker_dispatcher.h" 7 #include "content/child/service_worker/service_worker_dispatcher.h"
8 #include "content/child/service_worker/service_worker_handle_reference.h" 8 #include "content/child/service_worker/service_worker_handle_reference.h"
9 #include "content/child/service_worker/service_worker_provider_context.h" 9 #include "content/child/service_worker/service_worker_provider_context.h"
10 #include "content/child/service_worker/web_service_worker_impl.h" 10 #include "content/child/service_worker/web_service_worker_impl.h"
11 #include "content/child/thread_safe_sender.h" 11 #include "content/child/thread_safe_sender.h"
12 #include "third_party/WebKit/public/platform/WebServiceWorkerProviderClient.h" 12 #include "third_party/WebKit/public/platform/WebServiceWorkerProviderClient.h"
13 #include "third_party/WebKit/public/platform/WebURL.h" 13 #include "third_party/WebKit/public/platform/WebURL.h"
14 14
15 using blink::WebURL; 15 using blink::WebURL;
16 16
17 namespace content { 17 namespace content {
18 18
19 WebServiceWorkerProviderImpl::WebServiceWorkerProviderImpl( 19 WebServiceWorkerProviderImpl::WebServiceWorkerProviderImpl(
20 ThreadSafeSender* thread_safe_sender, 20 ThreadSafeSender* thread_safe_sender,
21 ServiceWorkerProviderContext* context) 21 ServiceWorkerProviderContext* context)
22 : thread_safe_sender_(thread_safe_sender), 22 : thread_safe_sender_(thread_safe_sender),
23 context_(context) { 23 context_(context) {
24 DCHECK(context_);
24 } 25 }
25 26
26 WebServiceWorkerProviderImpl::~WebServiceWorkerProviderImpl() { 27 WebServiceWorkerProviderImpl::~WebServiceWorkerProviderImpl() {
27 // Make sure the provider client is removed. 28 // Make sure the provider client is removed.
28 RemoveProviderClient(); 29 RemoveProviderClient();
29 } 30 }
30 31
31 void WebServiceWorkerProviderImpl::setClient( 32 void WebServiceWorkerProviderImpl::setClient(
32 blink::WebServiceWorkerProviderClient* client) { 33 blink::WebServiceWorkerProviderClient* client) {
33 if (!client) { 34 if (!client) {
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 if (dispatcher) 88 if (dispatcher)
88 dispatcher->RemoveProviderClient(context_->provider_id()); 89 dispatcher->RemoveProviderClient(context_->provider_id());
89 } 90 }
90 91
91 ServiceWorkerDispatcher* WebServiceWorkerProviderImpl::GetDispatcher() { 92 ServiceWorkerDispatcher* WebServiceWorkerProviderImpl::GetDispatcher() {
92 return ServiceWorkerDispatcher::GetOrCreateThreadSpecificInstance( 93 return ServiceWorkerDispatcher::GetOrCreateThreadSpecificInstance(
93 thread_safe_sender_.get()); 94 thread_safe_sender_.get());
94 } 95 }
95 96
96 } // namespace content 97 } // namespace content
OLDNEW
« no previous file with comments | « content/child/service_worker/service_worker_network_provider.cc ('k') | content/common/service_worker/service_worker_types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698