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

Unified Diff: third_party/WebKit/Source/modules/payments/PaymentRequest.h

Issue 2192413002: Timeout if website never completes the transaction. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Marijn's comments Created 4 years, 5 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/payments/PaymentRequest.h
diff --git a/third_party/WebKit/Source/modules/payments/PaymentRequest.h b/third_party/WebKit/Source/modules/payments/PaymentRequest.h
index 178f05d6c98b1ebbb583ed41b0c6aa72f3d1c609..3290d3e2fd872d2fb6d19bc061d020ee6a6770c3 100644
--- a/third_party/WebKit/Source/modules/payments/PaymentRequest.h
+++ b/third_party/WebKit/Source/modules/payments/PaymentRequest.h
@@ -17,6 +17,7 @@
#include "modules/payments/PaymentOptions.h"
#include "modules/payments/PaymentUpdater.h"
#include "mojo/public/cpp/bindings/binding.h"
+#include "platform/Timer.h"
#include "platform/heap/Handle.h"
#include "public/platform/modules/payments/payment_request.mojom-blink.h"
#include "wtf/Compiler.h"
@@ -72,6 +73,8 @@ public:
DECLARE_TRACE();
+ void onCompleteTimeoutForTesting();
+
private:
PaymentRequest(ScriptState*, const HeapVector<PaymentMethodData>&, const PaymentDetails&, const PaymentOptions&, ExceptionState&);
@@ -89,6 +92,8 @@ private:
void OnComplete() override;
void OnAbort(bool abortedSuccessfully) override;
+ void onCompleteTimeout(TimerBase*);
+
// Clears the promise resolvers and closes the Mojo connection.
void clearResolversAndCloseMojoConnection();
@@ -102,6 +107,7 @@ private:
Member<ScriptPromiseResolver> m_abortResolver;
mojom::blink::PaymentRequestPtr m_paymentProvider;
mojo::Binding<mojom::blink::PaymentRequestClient> m_clientBinding;
+ Timer<PaymentRequest> m_completeTimer;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698