noel | 825202a | 2017-03-29 04:37:19 | [diff] [blame] | 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 | #include "extensions/common/manifest_parser_struct_traits.h" |
| 6 | #include "url/mojo/url_gurl_struct_traits.h" |
| 7 | |
| 8 | namespace mojo { |
| 9 | |
| 10 | // static |
| 11 | bool StructTraits<::extensions::mojom::UpdateManifestResults::DataView, |
| 12 | ::UpdateManifest::Results>:: |
| 13 | Read(::extensions::mojom::UpdateManifestResults::DataView input, |
| 14 | ::UpdateManifest::Results* output) { |
| 15 | if (!input.ReadList(&output->list)) |
| 16 | return false; |
| 17 | output->daystart_elapsed_seconds = input.daystart_elapsed_seconds(); |
| 18 | return true; |
| 19 | } |
| 20 | |
| 21 | // static |
| 22 | bool StructTraits<::extensions::mojom::UpdateManifestResult::DataView, |
| 23 | ::UpdateManifest::Result>:: |
| 24 | Read(::extensions::mojom::UpdateManifestResult::DataView input, |
| 25 | ::UpdateManifest::Result* output) { |
| 26 | if (!input.ReadExtensionId(&output->extension_id)) |
| 27 | return false; |
| 28 | if (!input.ReadVersion(&output->version)) |
| 29 | return false; |
| 30 | if (!input.ReadBrowserMinVersion(&output->browser_min_version)) |
| 31 | return false; |
| 32 | if (!input.ReadCrxUrl(&output->crx_url)) |
| 33 | return false; |
| 34 | if (!input.ReadPackageHash(&output->package_hash)) |
| 35 | return false; |
| 36 | output->size = input.size(); |
| 37 | if (!input.ReadPackageFingerprint(&output->package_fingerprint)) |
| 38 | return false; |
| 39 | if (!input.ReadDiffCrxUrl(&output->diff_crx_url)) |
| 40 | return false; |
| 41 | if (!input.ReadDiffPackageHash(&output->diff_package_hash)) |
| 42 | return false; |
| 43 | output->diff_size = input.diff_size(); |
| 44 | return true; |
| 45 | } |
| 46 | |
| 47 | } // namespace mojo |