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

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

Issue 2893823004: [Payments] Implement openWindow for service worker based payment handler (Closed)
Patch Set: address comments Created 3 years, 7 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: third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerClients.cpp
diff --git a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerClients.cpp b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerClients.cpp
index ee7a500cb2535666ff10a57600bc71332f9a3560..e63b41463d1022e40464dcf82314e7c71cd3a981 100644
--- a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerClients.cpp
+++ b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerClients.cpp
@@ -160,6 +160,12 @@ ScriptPromise ServiceWorkerClients::claim(ScriptState* script_state) {
ScriptPromise ServiceWorkerClients::openWindow(ScriptState* script_state,
const String& url) {
+ return openWindow(script_state, String(), url);
+}
+
+ScriptPromise ServiceWorkerClients::openWindow(ScriptState* script_state,
+ const String& redirect_url,
+ const String& url) {
ScriptPromiseResolver* resolver = ScriptPromiseResolver::Create(script_state);
ScriptPromise promise = resolver->Promise();
ExecutionContext* context = ExecutionContext::From(script_state);
@@ -186,7 +192,8 @@ ScriptPromise ServiceWorkerClients::openWindow(ScriptState* script_state,
context->ConsumeWindowInteraction();
ServiceWorkerGlobalScopeClient::From(context)->OpenWindow(
- parsed_url, WTF::MakeUnique<NavigateClientCallback>(resolver));
+ KURL(kParsedURLString, redirect_url), parsed_url,
+ WTF::MakeUnique<NavigateClientCallback>(resolver));
return promise;
}

Powered by Google App Engine
This is Rietveld 408576698