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

Unified Diff: Source/modules/serviceworkers/ServiceWorkerClients.cpp

Issue 1040993003: ServiceWorker: Support non-window clients in Clients.matchAll (2/2 blink) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 9 months 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 side-by-side diff with in-line comments
Download patch
Index: Source/modules/serviceworkers/ServiceWorkerClients.cpp
diff --git a/Source/modules/serviceworkers/ServiceWorkerClients.cpp b/Source/modules/serviceworkers/ServiceWorkerClients.cpp
index 3ce5ead79f4acd6de3d2a98b4d78bc6d541cf30a..bb29874224a221a3136fcc7a288840ad80e9a0de 100644
--- a/Source/modules/serviceworkers/ServiceWorkerClients.cpp
+++ b/Source/modules/serviceworkers/ServiceWorkerClients.cpp
@@ -30,9 +30,11 @@ public:
OwnPtr<WebType> webClients = adoptPtr(webClientsRaw);
HeapVector<Member<ServiceWorkerClient>> clients;
for (size_t i = 0; i < webClients->clients.size(); ++i) {
- // FIXME: For now we only support getting "window" type clients.
- ASSERT(webClients->clients[i].clientType == WebServiceWorkerClientTypeWindow);
- clients.append(ServiceWorkerWindowClient::create(webClients->clients[i]));
+ WebServiceWorkerClientInfo& client = webClients->clients[i];
falken 2015/03/31 04:34:32 can this be const?
nhiroki 2015/04/01 04:51:34 Done.
+ if (client.clientType == WebServiceWorkerClientTypeWindow)
+ clients.append(ServiceWorkerWindowClient::create(client));
+ else
+ clients.append(ServiceWorkerClient::create(client));
}
return clients;
}
@@ -81,12 +83,6 @@ ScriptPromise ServiceWorkerClients::matchAll(ScriptState* scriptState, const Cli
RefPtrWillBeRawPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::create(scriptState);
ScriptPromise promise = resolver->promise();
- if (options.type() != "window") {
- // FIXME: Remove this when query options are supported in the embedder.
- resolver->reject(DOMException::create(NotSupportedError, "type parameter of getAll is not supported."));
- return promise;
- }
-
WebServiceWorkerClientQueryOptions webOptions;
webOptions.clientType = getClientType(options.type());
webOptions.includeUncontrolled = options.includeUncontrolled();

Powered by Google App Engine
This is Rietveld 408576698