Chromium Code Reviews| Index: Source/modules/serviceworkers/ServiceWorkerClients.cpp |
| diff --git a/Source/modules/serviceworkers/ServiceWorkerClients.cpp b/Source/modules/serviceworkers/ServiceWorkerClients.cpp |
| index 6e5ed30b07f19a82d15b58b073abde469a56bf41..0f1c68ceabcc080842497346ed2560054e95d2df 100644 |
| --- a/Source/modules/serviceworkers/ServiceWorkerClients.cpp |
| +++ b/Source/modules/serviceworkers/ServiceWorkerClients.cpp |
| @@ -73,4 +73,20 @@ ScriptPromise ServiceWorkerClients::getAll(ScriptState* scriptState, const Clien |
| return promise; |
| } |
| +ScriptPromise ServiceWorkerClients::claim(ScriptState* scriptState) |
| +{ |
| + ExecutionContext* executionContext = scriptState->executionContext(); |
| + |
| + // FIXME: short-term fix, see details at: https://codereview.chromium.org/535193002/. |
| + if (!executionContext) |
| + return ScriptPromise(); |
|
mlamouri (slow - plz ping)
2015/01/23 10:08:08
There are other places where such a check isn't do
jsbell
2015/01/24 00:42:16
Per that CL... yes. Any method called via bindings
falken
2015/01/26 04:55:11
http://crbug.com/413518 has more details, I've jus
xiang
2015/01/26 06:47:54
updated the comment.
|
| + |
| + RefPtrWillBeRawPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::create(scriptState); |
| + ScriptPromise promise = resolver->promise(); |
| + |
| + WebServiceWorkerClientsClaimCallbacks* callbacks = new CallbackPromiseAdapter<void, ServiceWorkerError>(resolver); |
| + ServiceWorkerGlobalScopeClient::from(executionContext)->claim(callbacks); |
| + return promise; |
| +} |
| + |
| } // namespace blink |