| OLD | NEW |
| (Empty) |
| 1 // Copyright 2017 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_CONTENT_ANDROID_UTILITY_PAYMENT_MANIFEST_PARSER_H_ | |
| 6 #define COMPONENTS_PAYMENTS_CONTENT_ANDROID_UTILITY_PAYMENT_MANIFEST_PARSER_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 #include <vector> | |
| 10 | |
| 11 #include "base/macros.h" | |
| 12 #include "components/payments/content/android/payment_manifest_parser.mojom.h" | |
| 13 | |
| 14 namespace payments { | |
| 15 | |
| 16 // Parser for payment manifests. Should be used only in a utility process. | |
| 17 // | |
| 18 // Example valid manifest structure: | |
| 19 // | |
| 20 // { | |
| 21 // "android": [{ | |
| 22 // "package": "com.bobpay.app", | |
| 23 // "version": 1, | |
| 24 // "sha256_cert_fingerprints": ["12:34:56:78:90:AB:CD:EF"] | |
| 25 // }] | |
| 26 // } | |
| 27 // | |
| 28 // Spec: | |
| 29 // https://docs.google.com/document/d/1izV4uC-tiRJG3JLooqY3YRLU22tYOsLTNq0P_InPJ
eE/edit#heading=h.cjp3jlnl47h5 | |
| 30 class PaymentManifestParser : public mojom::PaymentManifestParser { | |
| 31 public: | |
| 32 static void Create(mojom::PaymentManifestParserRequest request); | |
| 33 | |
| 34 // The return value is move-only, so no copying occurs. | |
| 35 static std::vector<mojom::PaymentManifestSectionPtr> ParseIntoVector( | |
| 36 const std::string& input); | |
| 37 | |
| 38 PaymentManifestParser(); | |
| 39 ~PaymentManifestParser() override; | |
| 40 | |
| 41 // mojom::PaymentManifestParser | |
| 42 void Parse(const std::string& content, | |
| 43 const ParseCallback& callback) override; | |
| 44 | |
| 45 private: | |
| 46 DISALLOW_COPY_AND_ASSIGN(PaymentManifestParser); | |
| 47 }; | |
| 48 | |
| 49 } // namespace payments | |
| 50 | |
| 51 #endif // COMPONENTS_PAYMENTS_CONTENT_ANDROID_UTILITY_PAYMENT_MANIFEST_PARSER_H
_ | |
| OLD | NEW |