Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(79)

Unified Diff: extensions/common/manifest_parser_struct_traits.h

Issue 2699663003: Convert utility process extension ParseUpdate IPC to mojo (Closed)
Patch Set: Sync to ToT, see if git apply issue and try jobs are happy. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « extensions/common/manifest_parser.typemap ('k') | extensions/common/manifest_parser_struct_traits.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/common/manifest_parser_struct_traits.h
diff --git a/extensions/common/manifest_parser_struct_traits.h b/extensions/common/manifest_parser_struct_traits.h
new file mode 100644
index 0000000000000000000000000000000000000000..abe4c6516266e5ae84896defe2ae6385ef3660af
--- /dev/null
+++ b/extensions/common/manifest_parser_struct_traits.h
@@ -0,0 +1,81 @@
+// Copyright 2017 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 EXTENSIONS_COMMON_MANIFEST_PARSER_STRUCT_TRAITS_H
+#define EXTENSIONS_COMMON_MANIFEST_PARSER_STRUCT_TRAITS_H
+
+#include "extensions/common/manifest_parser.mojom.h"
+#include "extensions/common/update_manifest.h"
+
+namespace mojo {
+
+template <>
+struct StructTraits<::extensions::mojom::UpdateManifestResults::DataView,
+ ::UpdateManifest::Results> {
+ static const std::vector<::UpdateManifest::Result>& list(
+ const ::UpdateManifest::Results& input) {
+ return input.list;
+ }
+
+ static int daystart_elapsed_seconds(const ::UpdateManifest::Results& input) {
+ return input.daystart_elapsed_seconds;
+ }
+
+ static bool Read(::extensions::mojom::UpdateManifestResults::DataView input,
+ ::UpdateManifest::Results* output);
+};
+
+template <>
+struct StructTraits<::extensions::mojom::UpdateManifestResult::DataView,
+ ::UpdateManifest::Result> {
+ static const std::string& extension_id(
+ const ::UpdateManifest::Result& input) {
+ return input.extension_id;
+ }
+
+ static const std::string& version(const ::UpdateManifest::Result& input) {
+ return input.version;
+ }
+
+ static const std::string& browser_min_version(
+ const ::UpdateManifest::Result& input) {
+ return input.browser_min_version;
+ }
+
+ static const GURL& crx_url(const ::UpdateManifest::Result& input) {
+ return input.crx_url;
+ }
+
+ static const std::string& package_hash(
+ const ::UpdateManifest::Result& input) {
+ return input.package_hash;
+ }
+
+ static int size(const ::UpdateManifest::Result& input) { return input.size; }
+
+ static const std::string& package_fingerprint(
+ const ::UpdateManifest::Result& input) {
+ return input.package_fingerprint;
+ }
+
+ static const GURL& diff_crx_url(const ::UpdateManifest::Result& input) {
+ return input.diff_crx_url;
+ }
+
+ static const std::string& diff_package_hash(
+ const ::UpdateManifest::Result& input) {
+ return input.diff_package_hash;
+ }
+
+ static int diff_size(const ::UpdateManifest::Result& input) {
+ return input.diff_size;
+ }
+
+ static bool Read(::extensions::mojom::UpdateManifestResult::DataView input,
+ ::UpdateManifest::Result* output);
+};
+
+} // namespace mojo
+
+#endif // EXTENSIONS_COMMON_MANIFEST_PARSER_STRUCT_TRAITS_H
« no previous file with comments | « extensions/common/manifest_parser.typemap ('k') | extensions/common/manifest_parser_struct_traits.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698