| 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> | 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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 int64_t WebServiceWorkerRegistrationImpl::registration_id() const { | 148 int64_t WebServiceWorkerRegistrationImpl::registration_id() const { |
| 149 return handle_ref_->registration_id(); | 149 return handle_ref_->registration_id(); |
| 150 } | 150 } |
| 151 | 151 |
| 152 // static | 152 // static |
| 153 std::unique_ptr<blink::WebServiceWorkerRegistration::Handle> | 153 std::unique_ptr<blink::WebServiceWorkerRegistration::Handle> |
| 154 WebServiceWorkerRegistrationImpl::CreateHandle( | 154 WebServiceWorkerRegistrationImpl::CreateHandle( |
| 155 const scoped_refptr<WebServiceWorkerRegistrationImpl>& registration) { | 155 const scoped_refptr<WebServiceWorkerRegistrationImpl>& registration) { |
| 156 if (!registration) | 156 if (!registration) |
| 157 return nullptr; | 157 return nullptr; |
| 158 return base::WrapUnique(new HandleImpl(registration)); | 158 return base::MakeUnique<HandleImpl>(registration); |
| 159 } | 159 } |
| 160 | 160 |
| 161 blink::WebServiceWorkerRegistration::Handle* | 161 blink::WebServiceWorkerRegistration::Handle* |
| 162 WebServiceWorkerRegistrationImpl::CreateLeakyHandle( | 162 WebServiceWorkerRegistrationImpl::CreateLeakyHandle( |
| 163 const scoped_refptr<WebServiceWorkerRegistrationImpl>& registration) { | 163 const scoped_refptr<WebServiceWorkerRegistrationImpl>& registration) { |
| 164 if (!registration) | 164 if (!registration) |
| 165 return nullptr; | 165 return nullptr; |
| 166 return new HandleImpl(registration); | 166 return new HandleImpl(registration); |
| 167 } | 167 } |
| 168 | 168 |
| 169 WebServiceWorkerRegistrationImpl::~WebServiceWorkerRegistrationImpl() { | 169 WebServiceWorkerRegistrationImpl::~WebServiceWorkerRegistrationImpl() { |
| 170 ServiceWorkerDispatcher* dispatcher = | 170 ServiceWorkerDispatcher* dispatcher = |
| 171 ServiceWorkerDispatcher::GetThreadSpecificInstance(); | 171 ServiceWorkerDispatcher::GetThreadSpecificInstance(); |
| 172 if (dispatcher) | 172 if (dispatcher) |
| 173 dispatcher->RemoveServiceWorkerRegistration(handle_ref_->handle_id()); | 173 dispatcher->RemoveServiceWorkerRegistration(handle_ref_->handle_id()); |
| 174 } | 174 } |
| 175 | 175 |
| 176 } // namespace content | 176 } // namespace content |
| OLD | NEW |