Commit 51373839 authored by Rouslan Solomakhin's avatar Rouslan Solomakhin Committed by Commit Bot

[Web Payment] Implicit event type in CreateForInvoke().

Before this patch, the only call site for
RespondWithCallbacks::CreateForInvoke() always specified PAYMENT_REQUEST
as the event type, which is redundant, because only PAYMENT_REQUEST
event can invoke a payment app.

This patch removes the event_type parameter from the CreateForInvoke()
static method.

After this patch, calling into RespondWithCallbacks::CreateForInvoke()
does not require to specify an event type.

Bug: 1005076
Change-Id: I9eb33b9c08585534c5ec451574ee5563efa3b52d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2090802
Commit-Queue: Rouslan Solomakhin <rouslan@chromium.org>
Reviewed-by: default avatarDanyao Wang <danyao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#748769}
parent d7c4fd36
......@@ -124,11 +124,11 @@ class RespondWithCallbacks : public PaymentHandlerResponseCallback {
public:
static RespondWithCallbacks* CreateForInvoke(
BrowserContext* browser_context,
ServiceWorkerMetrics::EventType event_type,
scoped_refptr<ServiceWorkerVersion> service_worker_version,
PaymentAppProvider::InvokePaymentAppCallback callback) {
RespondWithCallbacks* callbacks = new RespondWithCallbacks(
browser_context, event_type, service_worker_version,
browser_context, ServiceWorkerMetrics::EventType::PAYMENT_REQUEST,
service_worker_version,
/*invoke_callback=*/std::move(callback),
PaymentAppProvider::PaymentEventResultCallback());
InvokePaymentAppCallbackRepository::GetInstance()->SetCallback(
......@@ -391,9 +391,8 @@ void DispatchPaymentRequestEvent(
// This object self-deletes after either success or error callback is
// invoked.
RespondWithCallbacks* invocation_callbacks =
RespondWithCallbacks::CreateForInvoke(
browser_context, ServiceWorkerMetrics::EventType::PAYMENT_REQUEST,
active_version, std::move(callback));
RespondWithCallbacks::CreateForInvoke(browser_context, active_version,
std::move(callback));
active_version->endpoint()->DispatchPaymentRequestEvent(
std::move(event_data), invocation_callbacks->BindNewPipeAndPassRemote(),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment