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

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

Issue 1235803003: ServiceWorker: Introduce ExtendableMessageEvent to replace MessageEvent Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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"
(...skipping 28 matching lines...) Expand all
39 // TODO(kinuko): Here we could also register the current thread ID 39 // TODO(kinuko): Here we could also register the current thread ID
40 // on the provider context so that multiple WebServiceWorkerProviderImpl 40 // on the provider context so that multiple WebServiceWorkerProviderImpl
41 // (e.g. on document and on dedicated workers) can properly share 41 // (e.g. on document and on dedicated workers) can properly share
42 // the single provider context across threads. (http://crbug.com/366538 42 // the single provider context across threads. (http://crbug.com/366538
43 // for more context) 43 // for more context)
44 GetDispatcher()->AddProviderClient(context_->provider_id(), client); 44 GetDispatcher()->AddProviderClient(context_->provider_id(), client);
45 45
46 if (!context_->controller()) 46 if (!context_->controller())
47 return; 47 return;
48 client->setController( 48 client->setController(
49 GetDispatcher()->GetServiceWorker(context_->controller()->info(), false), 49 GetDispatcher()->GetServiceWorker(context_->controller()->info(),
50 context_->provider_id(), false),
50 false /* shouldNotifyControllerChange */); 51 false /* shouldNotifyControllerChange */);
51 } 52 }
52 53
53 void WebServiceWorkerProviderImpl::registerServiceWorker( 54 void WebServiceWorkerProviderImpl::registerServiceWorker(
54 const WebURL& pattern, 55 const WebURL& pattern,
55 const WebURL& script_url, 56 const WebURL& script_url,
56 WebServiceWorkerRegistrationCallbacks* callbacks) { 57 WebServiceWorkerRegistrationCallbacks* callbacks) {
57 GetDispatcher()->RegisterServiceWorker( 58 GetDispatcher()->RegisterServiceWorker(
58 context_->provider_id(), pattern, script_url, callbacks); 59 context_->provider_id(), pattern, script_url, callbacks);
59 } 60 }
(...skipping 28 matching lines...) Expand all
88 if (dispatcher) 89 if (dispatcher)
89 dispatcher->RemoveProviderClient(context_->provider_id()); 90 dispatcher->RemoveProviderClient(context_->provider_id());
90 } 91 }
91 92
92 ServiceWorkerDispatcher* WebServiceWorkerProviderImpl::GetDispatcher() { 93 ServiceWorkerDispatcher* WebServiceWorkerProviderImpl::GetDispatcher() {
93 return ServiceWorkerDispatcher::GetOrCreateThreadSpecificInstance( 94 return ServiceWorkerDispatcher::GetOrCreateThreadSpecificInstance(
94 thread_safe_sender_.get()); 95 thread_safe_sender_.get());
95 } 96 }
96 97
97 } // namespace content 98 } // namespace content
OLDNEW
« no previous file with comments | « content/child/service_worker/web_service_worker_impl.cc ('k') | content/common/service_worker/service_worker_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698