| 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), |
| 79 false /* shouldNotifyControllerChange */); |
| 79 } | 80 } |
| 80 } | 81 } |
| 81 | 82 |
| 82 void WebServiceWorkerProviderImpl::registerServiceWorker( | 83 void WebServiceWorkerProviderImpl::registerServiceWorker( |
| 83 const WebURL& pattern, | 84 const WebURL& pattern, |
| 84 const WebURL& script_url, | 85 const WebURL& script_url, |
| 85 WebServiceWorkerRegistrationCallbacks* callbacks) { | 86 WebServiceWorkerRegistrationCallbacks* callbacks) { |
| 86 GetDispatcher()->RegisterServiceWorker( | 87 GetDispatcher()->RegisterServiceWorker( |
| 87 provider_id_, pattern, script_url, callbacks); | 88 provider_id_, pattern, script_url, callbacks); |
| 88 } | 89 } |
| (...skipping 19 matching lines...) Expand all Loading... |
| 108 if (dispatcher) | 109 if (dispatcher) |
| 109 dispatcher->RemoveScriptClient(provider_id_); | 110 dispatcher->RemoveScriptClient(provider_id_); |
| 110 } | 111 } |
| 111 | 112 |
| 112 ServiceWorkerDispatcher* WebServiceWorkerProviderImpl::GetDispatcher() { | 113 ServiceWorkerDispatcher* WebServiceWorkerProviderImpl::GetDispatcher() { |
| 113 return ServiceWorkerDispatcher::GetOrCreateThreadSpecificInstance( | 114 return ServiceWorkerDispatcher::GetOrCreateThreadSpecificInstance( |
| 114 thread_safe_sender_.get()); | 115 thread_safe_sender_.get()); |
| 115 } | 116 } |
| 116 | 117 |
| 117 } // namespace content | 118 } // namespace content |
| OLD | NEW |