| OLD | NEW |
| 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/child/service_worker/service_worker_provider_context.h" | 5 #include "content/child/service_worker/service_worker_provider_context.h" |
| 6 | 6 |
| 7 #include "base/thread_task_runner_handle.h" | 7 #include "base/thread_task_runner_handle.h" |
| 8 #include "content/child/child_thread_impl.h" | 8 #include "content/child/child_thread_impl.h" |
| 9 #include "content/child/service_worker/service_worker_dispatcher.h" | 9 #include "content/child/service_worker/service_worker_dispatcher.h" |
| 10 #include "content/child/service_worker/service_worker_handle_reference.h" | 10 #include "content/child/service_worker/service_worker_handle_reference.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 } | 50 } |
| 51 | 51 |
| 52 void DisassociateRegistration() override { | 52 void DisassociateRegistration() override { |
| 53 controller_.reset(); | 53 controller_.reset(); |
| 54 registration_.reset(); | 54 registration_.reset(); |
| 55 } | 55 } |
| 56 | 56 |
| 57 void SetController( | 57 void SetController( |
| 58 scoped_ptr<ServiceWorkerHandleReference> controller) override { | 58 scoped_ptr<ServiceWorkerHandleReference> controller) override { |
| 59 DCHECK(registration_); | 59 DCHECK(registration_); |
| 60 DCHECK(!controller || |
| 61 controller->handle_id() != kInvalidServiceWorkerHandleId); |
| 60 controller_ = controller.Pass(); | 62 controller_ = controller.Pass(); |
| 61 } | 63 } |
| 62 | 64 |
| 63 void GetAssociatedRegistration( | 65 void GetAssociatedRegistration( |
| 64 ServiceWorkerRegistrationObjectInfo* info, | 66 ServiceWorkerRegistrationObjectInfo* info, |
| 65 ServiceWorkerVersionAttributes* attrs) override { | 67 ServiceWorkerVersionAttributes* attrs) override { |
| 66 NOTREACHED(); | 68 NOTREACHED(); |
| 67 } | 69 } |
| 68 | 70 |
| 69 ServiceWorkerHandleReference* controller() override { | 71 ServiceWorkerHandleReference* controller() override { |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 | 199 |
| 198 void ServiceWorkerProviderContext::DestructOnMainThread() const { | 200 void ServiceWorkerProviderContext::DestructOnMainThread() const { |
| 199 if (!main_thread_task_runner_->RunsTasksOnCurrentThread() && | 201 if (!main_thread_task_runner_->RunsTasksOnCurrentThread() && |
| 200 main_thread_task_runner_->DeleteSoon(FROM_HERE, this)) { | 202 main_thread_task_runner_->DeleteSoon(FROM_HERE, this)) { |
| 201 return; | 203 return; |
| 202 } | 204 } |
| 203 delete this; | 205 delete this; |
| 204 } | 206 } |
| 205 | 207 |
| 206 } // namespace content | 208 } // namespace content |
| OLD | NEW |