| 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 "config.h" | 5 #include "config.h" |
| 6 #include "ServiceWorkerRegistration.h" | 6 #include "ServiceWorkerRegistration.h" |
| 7 | 7 |
| 8 #include "bindings/core/v8/CallbackPromiseAdapter.h" | 8 #include "bindings/core/v8/CallbackPromiseAdapter.h" |
| 9 #include "bindings/core/v8/ScriptPromise.h" | 9 #include "bindings/core/v8/ScriptPromise.h" |
| 10 #include "bindings/core/v8/ScriptPromiseResolver.h" | 10 #include "bindings/core/v8/ScriptPromiseResolver.h" |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 return getOrCreate(executionContext, registration); | 83 return getOrCreate(executionContext, registration); |
| 84 } | 84 } |
| 85 | 85 |
| 86 ServiceWorkerRegistration* ServiceWorkerRegistration::take(ScriptPromiseResolver
* resolver, WebType* registration) | 86 ServiceWorkerRegistration* ServiceWorkerRegistration::take(ScriptPromiseResolver
* resolver, WebType* registration) |
| 87 { | 87 { |
| 88 return from(resolver->scriptState()->executionContext(), registration); | 88 return from(resolver->scriptState()->executionContext(), registration); |
| 89 } | 89 } |
| 90 | 90 |
| 91 void ServiceWorkerRegistration::dispose(WebType* registration) | 91 void ServiceWorkerRegistration::dispose(WebType* registration) |
| 92 { | 92 { |
| 93 delete registration; | 93 if (registration && !registration->proxy()) |
| 94 delete registration; |
| 94 } | 95 } |
| 95 | 96 |
| 96 String ServiceWorkerRegistration::scope() const | 97 String ServiceWorkerRegistration::scope() const |
| 97 { | 98 { |
| 98 return m_outerRegistration->scope().string(); | 99 return m_outerRegistration->scope().string(); |
| 99 } | 100 } |
| 100 | 101 |
| 101 ScriptPromise ServiceWorkerRegistration::unregister(ScriptState* scriptState) | 102 ScriptPromise ServiceWorkerRegistration::unregister(ScriptState* scriptState) |
| 102 { | 103 { |
| 103 RefPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::create(scrip
tState); | 104 RefPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::create(scrip
tState); |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 | 172 |
| 172 void ServiceWorkerRegistration::stop() | 173 void ServiceWorkerRegistration::stop() |
| 173 { | 174 { |
| 174 if (m_stopped) | 175 if (m_stopped) |
| 175 return; | 176 return; |
| 176 m_stopped = true; | 177 m_stopped = true; |
| 177 m_outerRegistration->proxyStopped(); | 178 m_outerRegistration->proxyStopped(); |
| 178 } | 179 } |
| 179 | 180 |
| 180 } // namespace blink | 181 } // namespace blink |
| OLD | NEW |