ScriptPromise ServiceWorkerClients::matchAll(ScriptState* scriptState, const ClientQueryOptions& options) { ExecutionContext* executionContext = scriptState->executionContext(); // FIXME: May be null due to worker termination: http://crbug.com/413518. if (!executionContext) return ScriptPromise(); ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState); ScriptPromise promise = resolver->promise(); WebServiceWorkerClientQueryOptions webOptions; webOptions.clientType = getClientType(options.type()); webOptions.includeUncontrolled = options.includeUncontrolled(); ServiceWorkerGlobalScopeClient::from(executionContext)->getClients(webOptions, new CallbackPromiseAdapter<ClientArray, ServiceWorkerError>(resolver)); return promise; }
//------------------------------------------------------------------------------------- PyObject* Proxy::pyGetClientType() { return PyLong_FromLong((long)getClientType()); }