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

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

Issue 897493002: [ServiceWorker] Update .focus() to return a WindowClient instead of bool. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@sw_client_focus_reject
Patch Set: Created 5 years, 11 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/ServiceWorkerWindowClient.cpp
diff --git a/Source/modules/serviceworkers/ServiceWorkerWindowClient.cpp b/Source/modules/serviceworkers/ServiceWorkerWindowClient.cpp
index 0ac2d1ae05308d4274e090fce2a7897de6176e3a..ef68824cde4d0336ef13de2b4283b7add179863d 100644
--- a/Source/modules/serviceworkers/ServiceWorkerWindowClient.cpp
+++ b/Source/modules/serviceworkers/ServiceWorkerWindowClient.cpp
@@ -17,6 +17,16 @@
namespace blink {
+ServiceWorkerWindowClient* ServiceWorkerWindowClient::take(ScriptPromiseResolver*, ServiceWorkerWindowClient::WebType* webClientRaw)
+{
+ return ServiceWorkerWindowClient::create(*webClientRaw);
+}
+
+void ServiceWorkerWindowClient::dispose(ServiceWorkerWindowClient::WebType* webClientRaw)
+{
+ delete webClientRaw;
+}
+
ServiceWorkerWindowClient* ServiceWorkerWindowClient::create(const WebServiceWorkerClientInfo& info)
{
return new ServiceWorkerWindowClient(info);
@@ -72,7 +82,7 @@ ScriptPromise ServiceWorkerWindowClient::focus(ScriptState* scriptState)
}
scriptState->executionContext()->consumeWindowFocus();
- ServiceWorkerGlobalScopeClient::from(scriptState->executionContext())->focus(id(), new CallbackPromiseAdapter<bool, ServiceWorkerError>(resolver));
+ ServiceWorkerGlobalScopeClient::from(scriptState->executionContext())->focus(id(), new CallbackPromiseAdapter<ServiceWorkerWindowClient, ServiceWorkerError>(resolver));
return promise;
}

Powered by Google App Engine
This is Rietveld 408576698