Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(61)

Side by Side Diff: Source/modules/serviceworkers/ServiceWorkerClients.cpp

Issue 783423003: Make ScriptPromiseResolver RefCountedWillBeRefCountedGarbageCollected. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: WIP: 1st trial Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698