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

Unified Diff: components/payments/payment_details_validation.h

Issue 2373103002: [Web Payments] Common Payments validation (Closed)
Patch Set: Split off moving Mojo file Created 4 years, 2 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: components/payments/payment_details_validation.h
diff --git a/components/payments/payment_details_validation.h b/components/payments/payment_details_validation.h
new file mode 100644
index 0000000000000000000000000000000000000000..a68b1358db561a2024aada589d9e1a6bb7f617d7
--- /dev/null
+++ b/components/payments/payment_details_validation.h
@@ -0,0 +1,32 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COMPONENTS_PAYMENTS_PAYMENT_DETAILS_VALIDATION_H_
+#define COMPONENTS_PAYMENTS_PAYMENT_DETAILS_VALIDATION_H_
+
+#include <string>
+
+#include "components/payments/payment_request.mojom.h"
+
+namespace payments {
+
+struct ExceptionState {
+ public:
+ void throwTypeError(const std::string& msg) { msg_ = msg; }
+
+ bool hadException() { return msg_.size() > 0; }
+
+ const std::string& message() { return msg_; }
+
+ private:
+ std::string msg_;
+};
+
+void validatePaymentDetails(const blink::mojom::PaymentDetailsPtr& details,
+ ExceptionState* state);
+bool validatePaymentDetails(const blink::mojom::PaymentDetailsPtr& details);
please use gerrit instead 2016/10/27 17:14:25 Instead of recreating the ExceptionState concept f
Kevin Bailey 2016/10/27 22:17:53 Done.
+
+} // namespace payments
+
+#endif // COMPONENTS_PAYMENTS_PAYMENT_DETAILS_VALIDATION_H_

Powered by Google App Engine
This is Rietveld 408576698