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 EXTENSIONS_COMMON_MANIFEST_PARSER_STRUCT_TRAITS_H |
| 6 #define EXTENSIONS_COMMON_MANIFEST_PARSER_STRUCT_TRAITS_H |
| 7 |
| 8 #include "extensions/common/manifest_parser.mojom.h" |
| 9 #include "extensions/common/update_manifest.h" |
| 10 |
| 11 namespace mojo { |
| 12 |
| 13 template <> |
| 14 struct StructTraits<::extensions::mojom::UpdateManifestResults::DataView, |
| 15 ::UpdateManifest::Results> { |
| 16 static const std::vector<::UpdateManifest::Result>& list( |
| 17 const ::UpdateManifest::Results& input) { |
| 18 return input.list; |
| 19 } |
| 20 |
| 21 static int daystart_elapsed_seconds(const ::UpdateManifest::Results& input) { |
| 22 return input.daystart_elapsed_seconds; |
| 23 } |
| 24 |
| 25 static bool Read(::extensions::mojom::UpdateManifestResults::DataView input, |
| 26 ::UpdateManifest::Results* output); |
| 27 }; |
| 28 |
| 29 template <> |
| 30 struct StructTraits<::extensions::mojom::UpdateManifestResult::DataView, |
| 31 ::UpdateManifest::Result> { |
| 32 static const std::string& extension_id( |
| 33 const ::UpdateManifest::Result& input) { |
| 34 return input.extension_id; |
| 35 } |
| 36 |
| 37 static const std::string& version(const ::UpdateManifest::Result& input) { |
| 38 return input.version; |
| 39 } |
| 40 |
| 41 static const std::string& browser_min_version( |
| 42 const ::UpdateManifest::Result& input) { |
| 43 return input.browser_min_version; |
| 44 } |
| 45 |
| 46 static const GURL& crx_url(const ::UpdateManifest::Result& input) { |
| 47 return input.crx_url; |
| 48 } |
| 49 |
| 50 static const std::string& package_hash( |
| 51 const ::UpdateManifest::Result& input) { |
| 52 return input.package_hash; |
| 53 } |
| 54 |
| 55 static int size(const ::UpdateManifest::Result& input) { return input.size; } |
| 56 |
| 57 static const std::string& package_fingerprint( |
| 58 const ::UpdateManifest::Result& input) { |
| 59 return input.package_fingerprint; |
| 60 } |
| 61 |
| 62 static const GURL& diff_crx_url(const ::UpdateManifest::Result& input) { |
| 63 return input.diff_crx_url; |
| 64 } |
| 65 |
| 66 static const std::string& diff_package_hash( |
| 67 const ::UpdateManifest::Result& input) { |
| 68 return input.diff_package_hash; |
| 69 } |
| 70 |
| 71 static int diff_size(const ::UpdateManifest::Result& input) { |
| 72 return input.diff_size; |
| 73 } |
| 74 |
| 75 static bool Read(::extensions::mojom::UpdateManifestResult::DataView input, |
| 76 ::UpdateManifest::Result* output); |
| 77 }; |
| 78 |
| 79 } // namespace mojo |
| 80 |
| 81 #endif // EXTENSIONS_COMMON_MANIFEST_PARSER_STRUCT_TRAITS_H |
OLD | NEW |