Chromium Code Reviews| OLD | NEW | 
|---|---|
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef COMPONENTS_PAYMENTS_PAYMENT_DETAILS_VALIDATION_H_ | |
| 6 #define COMPONENTS_PAYMENTS_PAYMENT_DETAILS_VALIDATION_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "components/payments/payment_request.mojom.h" | |
| 11 | |
| 12 namespace payments { | |
| 13 | |
| 14 struct ExceptionState { | |
| 15 public: | |
| 16 void throwTypeError(const std::string& msg) { msg_ = msg; } | |
| 17 | |
| 18 bool hadException() { return msg_.size() > 0; } | |
| 19 | |
| 20 const std::string& message() { return msg_; } | |
| 21 | |
| 22 private: | |
| 23 std::string msg_; | |
| 24 }; | |
| 25 | |
| 26 void validatePaymentDetails(const blink::mojom::PaymentDetailsPtr& details, | |
| 27 ExceptionState* state); | |
| 28 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.
 
 | |
| 29 | |
| 30 } // namespace payments | |
| 31 | |
| 32 #endif // COMPONENTS_PAYMENTS_PAYMENT_DETAILS_VALIDATION_H_ | |
| OLD | NEW |