| 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 delete registration; | 94 delete registration; |
| 95 } | 95 } |
| 96 | 96 |
| 97 String ServiceWorkerRegistration::scope() const | 97 String ServiceWorkerRegistration::scope() const |
| 98 { | 98 { |
| 99 return m_outerRegistration->scope().string(); | 99 return m_outerRegistration->scope().string(); |
| 100 } | 100 } |
| 101 | 101 |
| 102 ScriptPromise ServiceWorkerRegistration::unregister(ScriptState* scriptState) | 102 ScriptPromise ServiceWorkerRegistration::unregister(ScriptState* scriptState) |
| 103 { | 103 { |
| 104 RefPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::create(scrip
tState); | 104 RefPtrWillBeRawPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::
create(scriptState); |
| 105 ScriptPromise promise = resolver->promise(); | 105 ScriptPromise promise = resolver->promise(); |
| 106 | 106 |
| 107 if (!m_provider) { | 107 if (!m_provider) { |
| 108 resolver->reject(DOMException::create(InvalidStateError, "No associated
provider is available")); | 108 resolver->reject(DOMException::create(InvalidStateError, "No associated
provider is available")); |
| 109 return promise; | 109 return promise; |
| 110 } | 110 } |
| 111 | 111 |
| 112 RefPtr<SecurityOrigin> documentOrigin = scriptState->executionContext()->sec
urityOrigin(); | 112 RefPtr<SecurityOrigin> documentOrigin = scriptState->executionContext()->sec
urityOrigin(); |
| 113 KURL scopeURL = scriptState->executionContext()->completeURL(scope()); | 113 KURL scopeURL = scriptState->executionContext()->completeURL(scope()); |
| 114 scopeURL.removeFragmentIdentifier(); | 114 scopeURL.removeFragmentIdentifier(); |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 | 168 |
| 169 void ServiceWorkerRegistration::stop() | 169 void ServiceWorkerRegistration::stop() |
| 170 { | 170 { |
| 171 if (m_stopped) | 171 if (m_stopped) |
| 172 return; | 172 return; |
| 173 m_stopped = true; | 173 m_stopped = true; |
| 174 m_outerRegistration->proxyStopped(); | 174 m_outerRegistration->proxyStopped(); |
| 175 } | 175 } |
| 176 | 176 |
| 177 } // namespace blink | 177 } // namespace blink |
| OLD | NEW |