| 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 "modules/serviceworkers/ServiceWorkerRegistration.h" | 5 #include "modules/serviceworkers/ServiceWorkerRegistration.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/CallbackPromiseAdapter.h" | 7 #include "bindings/core/v8/CallbackPromiseAdapter.h" |
| 8 #include "bindings/core/v8/ScriptPromise.h" | 8 #include "bindings/core/v8/ScriptPromise.h" |
| 9 #include "bindings/core/v8/ScriptState.h" | 9 #include "bindings/core/v8/ScriptState.h" |
| 10 #include "core/dom/DOMException.h" | 10 #include "core/dom/DOMException.h" |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 m_handle->registration()->unregister( | 125 m_handle->registration()->unregister( |
| 126 client->provider(), | 126 client->provider(), |
| 127 WTF::makeUnique<CallbackPromiseAdapter<bool, ServiceWorkerError>>( | 127 WTF::makeUnique<CallbackPromiseAdapter<bool, ServiceWorkerError>>( |
| 128 resolver)); | 128 resolver)); |
| 129 return promise; | 129 return promise; |
| 130 } | 130 } |
| 131 | 131 |
| 132 ServiceWorkerRegistration::ServiceWorkerRegistration( | 132 ServiceWorkerRegistration::ServiceWorkerRegistration( |
| 133 ExecutionContext* executionContext, | 133 ExecutionContext* executionContext, |
| 134 std::unique_ptr<WebServiceWorkerRegistration::Handle> handle) | 134 std::unique_ptr<WebServiceWorkerRegistration::Handle> handle) |
| 135 : ActiveScriptWrappable(this), | 135 : ActiveScriptWrappable<ServiceWorkerRegistration>(this), |
| 136 SuspendableObject(executionContext), | 136 SuspendableObject(executionContext), |
| 137 m_handle(std::move(handle)), | 137 m_handle(std::move(handle)), |
| 138 m_stopped(false) { | 138 m_stopped(false) { |
| 139 ASSERT(m_handle); | 139 ASSERT(m_handle); |
| 140 ASSERT(!m_handle->registration()->proxy()); | 140 ASSERT(!m_handle->registration()->proxy()); |
| 141 | 141 |
| 142 if (!executionContext) | 142 if (!executionContext) |
| 143 return; | 143 return; |
| 144 m_handle->registration()->setProxy(this); | 144 m_handle->registration()->setProxy(this); |
| 145 } | 145 } |
| (...skipping 17 matching lines...) Expand all Loading... |
| 163 } | 163 } |
| 164 | 164 |
| 165 void ServiceWorkerRegistration::contextDestroyed() { | 165 void ServiceWorkerRegistration::contextDestroyed() { |
| 166 if (m_stopped) | 166 if (m_stopped) |
| 167 return; | 167 return; |
| 168 m_stopped = true; | 168 m_stopped = true; |
| 169 m_handle->registration()->proxyStopped(); | 169 m_handle->registration()->proxyStopped(); |
| 170 } | 170 } |
| 171 | 171 |
| 172 } // namespace blink | 172 } // namespace blink |
| OLD | NEW |