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_impl.h" | 5 #include "content/child/service_worker/web_service_worker_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 thread_safe_sender_->Send( | 128 thread_safe_sender_->Send( |
129 new ServiceWorkerHostMsg_TerminateWorker(handle_ref_->handle_id())); | 129 new ServiceWorkerHostMsg_TerminateWorker(handle_ref_->handle_id())); |
130 } | 130 } |
131 | 131 |
132 // static | 132 // static |
133 std::unique_ptr<blink::WebServiceWorker::Handle> | 133 std::unique_ptr<blink::WebServiceWorker::Handle> |
134 WebServiceWorkerImpl::CreateHandle( | 134 WebServiceWorkerImpl::CreateHandle( |
135 const scoped_refptr<WebServiceWorkerImpl>& worker) { | 135 const scoped_refptr<WebServiceWorkerImpl>& worker) { |
136 if (!worker) | 136 if (!worker) |
137 return nullptr; | 137 return nullptr; |
138 return base::WrapUnique(new HandleImpl(worker)); | 138 return base::MakeUnique<HandleImpl>(worker); |
139 } | 139 } |
140 | 140 |
141 WebServiceWorkerImpl::~WebServiceWorkerImpl() { | 141 WebServiceWorkerImpl::~WebServiceWorkerImpl() { |
142 ServiceWorkerDispatcher* dispatcher = | 142 ServiceWorkerDispatcher* dispatcher = |
143 ServiceWorkerDispatcher::GetThreadSpecificInstance(); | 143 ServiceWorkerDispatcher::GetThreadSpecificInstance(); |
144 if (dispatcher) | 144 if (dispatcher) |
145 dispatcher->RemoveServiceWorker(handle_ref_->handle_id()); | 145 dispatcher->RemoveServiceWorker(handle_ref_->handle_id()); |
146 } | 146 } |
147 | 147 |
148 } // namespace content | 148 } // namespace content |
OLD | NEW |