Chromium Code Reviews| 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_ |