OLD | NEW |
---|---|
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 "base/atomic_sequence_num.h" | 7 #include "base/atomic_sequence_num.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "content/child/child_thread.h" | 9 #include "content/child/child_thread.h" |
10 #include "content/child/service_worker/service_worker_dispatcher.h" | 10 #include "content/child/service_worker/service_worker_dispatcher.h" |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
68 registration->SetWaiting( | 68 registration->SetWaiting( |
69 GetDispatcher()->GetServiceWorker(attrs.waiting, false)); | 69 GetDispatcher()->GetServiceWorker(attrs.waiting, false)); |
70 registration->SetActive( | 70 registration->SetActive( |
71 GetDispatcher()->GetServiceWorker(attrs.active, false)); | 71 GetDispatcher()->GetServiceWorker(attrs.active, false)); |
72 } | 72 } |
73 client->setReadyRegistration(registration); | 73 client->setReadyRegistration(registration); |
74 } | 74 } |
75 | 75 |
76 if (context_->controller_handle_id() != kInvalidServiceWorkerHandleId) { | 76 if (context_->controller_handle_id() != kInvalidServiceWorkerHandleId) { |
77 client->setController(GetDispatcher()->GetServiceWorker( | 77 client->setController(GetDispatcher()->GetServiceWorker( |
78 context_->controller()->info(), false)); | 78 context_->controller()->info(), false), false); |
falken
2014/12/01 02:29:59
nit: add /* shouldNotifyControllerChange */ next t
xiang
2014/12/01 07:20:07
Done.
| |
79 } | 79 } |
80 } | 80 } |
81 | 81 |
82 void WebServiceWorkerProviderImpl::registerServiceWorker( | 82 void WebServiceWorkerProviderImpl::registerServiceWorker( |
83 const WebURL& pattern, | 83 const WebURL& pattern, |
84 const WebURL& script_url, | 84 const WebURL& script_url, |
85 WebServiceWorkerRegistrationCallbacks* callbacks) { | 85 WebServiceWorkerRegistrationCallbacks* callbacks) { |
86 GetDispatcher()->RegisterServiceWorker( | 86 GetDispatcher()->RegisterServiceWorker( |
87 provider_id_, pattern, script_url, callbacks); | 87 provider_id_, pattern, script_url, callbacks); |
88 } | 88 } |
(...skipping 19 matching lines...) Expand all Loading... | |
108 if (dispatcher) | 108 if (dispatcher) |
109 dispatcher->RemoveScriptClient(provider_id_); | 109 dispatcher->RemoveScriptClient(provider_id_); |
110 } | 110 } |
111 | 111 |
112 ServiceWorkerDispatcher* WebServiceWorkerProviderImpl::GetDispatcher() { | 112 ServiceWorkerDispatcher* WebServiceWorkerProviderImpl::GetDispatcher() { |
113 return ServiceWorkerDispatcher::GetOrCreateThreadSpecificInstance( | 113 return ServiceWorkerDispatcher::GetOrCreateThreadSpecificInstance( |
114 thread_safe_sender_.get()); | 114 thread_safe_sender_.get()); |
115 } | 115 } |
116 | 116 |
117 } // namespace content | 117 } // namespace content |
OLD | NEW |