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 "modules/serviceworkers/ServiceWorkerClients.h" | 6 #include "modules/serviceworkers/ServiceWorkerClients.h" |
7 | 7 |
8 #include "bindings/core/v8/CallbackPromiseAdapter.h" | 8 #include "bindings/core/v8/CallbackPromiseAdapter.h" |
9 #include "bindings/core/v8/ScriptPromiseResolver.h" | 9 #include "bindings/core/v8/ScriptPromiseResolver.h" |
10 #include "core/dom/ExceptionCode.h" | 10 #include "core/dom/ExceptionCode.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 { | 50 { |
51 return new ServiceWorkerClients(); | 51 return new ServiceWorkerClients(); |
52 } | 52 } |
53 | 53 |
54 ServiceWorkerClients::ServiceWorkerClients() | 54 ServiceWorkerClients::ServiceWorkerClients() |
55 { | 55 { |
56 } | 56 } |
57 | 57 |
58 ScriptPromise ServiceWorkerClients::getAll(ScriptState* scriptState, const Servi
ceWorkerClientQueryOptions& options) | 58 ScriptPromise ServiceWorkerClients::getAll(ScriptState* scriptState, const Servi
ceWorkerClientQueryOptions& options) |
59 { | 59 { |
60 RefPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::create(scrip
tState); | 60 RefPtrWillBeRawPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::
create(scriptState); |
61 ScriptPromise promise = resolver->promise(); | 61 ScriptPromise promise = resolver->promise(); |
62 | 62 |
63 if (options.includeUncontrolled()) { | 63 if (options.includeUncontrolled()) { |
64 // FIXME: Currently we don't support includeUncontrolled=true. | 64 // FIXME: Currently we don't support includeUncontrolled=true. |
65 resolver->reject(DOMException::create(NotSupportedError, "includeUncontr
olled parameter of getAll is not supported.")); | 65 resolver->reject(DOMException::create(NotSupportedError, "includeUncontr
olled parameter of getAll is not supported.")); |
66 return promise; | 66 return promise; |
67 } | 67 } |
68 | 68 |
69 ServiceWorkerGlobalScopeClient::from(scriptState->executionContext())->getCl
ients(new CallbackPromiseAdapter<ClientArray, ServiceWorkerError>(resolver)); | 69 ServiceWorkerGlobalScopeClient::from(scriptState->executionContext())->getCl
ients(new CallbackPromiseAdapter<ClientArray, ServiceWorkerError>(resolver)); |
70 return promise; | 70 return promise; |
71 } | 71 } |
72 | 72 |
73 } // namespace blink | 73 } // namespace blink |
OLD | NEW |