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/web_service_worker_registration_impl.h" | 5 #include "content/child/service_worker/web_service_worker_registration_impl.h" |
6 | 6 |
| 7 #include <utility> |
| 8 |
7 #include "base/macros.h" | 9 #include "base/macros.h" |
8 #include "content/child/service_worker/service_worker_dispatcher.h" | 10 #include "content/child/service_worker/service_worker_dispatcher.h" |
9 #include "content/child/service_worker/service_worker_registration_handle_refere
nce.h" | 11 #include "content/child/service_worker/service_worker_registration_handle_refere
nce.h" |
10 #include "content/child/service_worker/web_service_worker_impl.h" | 12 #include "content/child/service_worker/web_service_worker_impl.h" |
11 #include "content/child/service_worker/web_service_worker_provider_impl.h" | 13 #include "content/child/service_worker/web_service_worker_provider_impl.h" |
12 #include "content/common/service_worker/service_worker_types.h" | 14 #include "content/common/service_worker/service_worker_types.h" |
13 #include "third_party/WebKit/public/platform/modules/serviceworker/WebServiceWor
kerRegistrationProxy.h" | 15 #include "third_party/WebKit/public/platform/modules/serviceworker/WebServiceWor
kerRegistrationProxy.h" |
14 | 16 |
15 namespace content { | 17 namespace content { |
16 | 18 |
(...skipping 20 matching lines...) Expand all Loading... |
37 | 39 |
38 WebServiceWorkerRegistrationImpl::QueuedTask::QueuedTask( | 40 WebServiceWorkerRegistrationImpl::QueuedTask::QueuedTask( |
39 QueuedTaskType type, | 41 QueuedTaskType type, |
40 const scoped_refptr<WebServiceWorkerImpl>& worker) | 42 const scoped_refptr<WebServiceWorkerImpl>& worker) |
41 : type(type), worker(worker) {} | 43 : type(type), worker(worker) {} |
42 | 44 |
43 WebServiceWorkerRegistrationImpl::QueuedTask::~QueuedTask() {} | 45 WebServiceWorkerRegistrationImpl::QueuedTask::~QueuedTask() {} |
44 | 46 |
45 WebServiceWorkerRegistrationImpl::WebServiceWorkerRegistrationImpl( | 47 WebServiceWorkerRegistrationImpl::WebServiceWorkerRegistrationImpl( |
46 scoped_ptr<ServiceWorkerRegistrationHandleReference> handle_ref) | 48 scoped_ptr<ServiceWorkerRegistrationHandleReference> handle_ref) |
47 : handle_ref_(handle_ref.Pass()), proxy_(nullptr) { | 49 : handle_ref_(std::move(handle_ref)), proxy_(nullptr) { |
48 DCHECK(handle_ref_); | 50 DCHECK(handle_ref_); |
49 DCHECK_NE(kInvalidServiceWorkerRegistrationHandleId, | 51 DCHECK_NE(kInvalidServiceWorkerRegistrationHandleId, |
50 handle_ref_->handle_id()); | 52 handle_ref_->handle_id()); |
51 ServiceWorkerDispatcher* dispatcher = | 53 ServiceWorkerDispatcher* dispatcher = |
52 ServiceWorkerDispatcher::GetThreadSpecificInstance(); | 54 ServiceWorkerDispatcher::GetThreadSpecificInstance(); |
53 DCHECK(dispatcher); | 55 DCHECK(dispatcher); |
54 dispatcher->AddServiceWorkerRegistration(handle_ref_->handle_id(), this); | 56 dispatcher->AddServiceWorkerRegistration(handle_ref_->handle_id(), this); |
55 } | 57 } |
56 | 58 |
57 void WebServiceWorkerRegistrationImpl::SetInstalling( | 59 void WebServiceWorkerRegistrationImpl::SetInstalling( |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 } | 163 } |
162 | 164 |
163 WebServiceWorkerRegistrationImpl::~WebServiceWorkerRegistrationImpl() { | 165 WebServiceWorkerRegistrationImpl::~WebServiceWorkerRegistrationImpl() { |
164 ServiceWorkerDispatcher* dispatcher = | 166 ServiceWorkerDispatcher* dispatcher = |
165 ServiceWorkerDispatcher::GetThreadSpecificInstance(); | 167 ServiceWorkerDispatcher::GetThreadSpecificInstance(); |
166 if (dispatcher) | 168 if (dispatcher) |
167 dispatcher->RemoveServiceWorkerRegistration(handle_ref_->handle_id()); | 169 dispatcher->RemoveServiceWorkerRegistration(handle_ref_->handle_id()); |
168 } | 170 } |
169 | 171 |
170 } // namespace content | 172 } // namespace content |
OLD | NEW |