Index: components/arc/common/arc_message_traits.cc |
diff --git a/components/arc/common/arc_message_traits.cc b/components/arc/common/arc_message_traits.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..1af848eb98a91bb53147d480b15823e4b59b9454 |
--- /dev/null |
+++ b/components/arc/common/arc_message_traits.cc |
@@ -0,0 +1,43 @@ |
+// Copyright 2015 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. |
+ |
+#include "components/arc/common/arc_message_traits.h" |
+ |
+#include "ipc/param_traits_write_macros.h" |
+#include "ipc/param_traits_read_macros.h" |
+#include "ipc/param_traits_log_macros.h" |
+ |
+namespace IPC { |
+ |
+// static |
+void ParamTraits<arc::AppInfo>::Write(Message* m, const param_type& p) { |
+ WriteParam(m, p.name); |
+ WriteParam(m, p.package); |
+ WriteParam(m, p.activity); |
+} |
+ |
+// static |
+bool ParamTraits<arc::AppInfo>::Read(const Message* m, |
+ base::PickleIterator* iter, |
+ param_type* r) { |
+ if (!ReadParam(m, iter, &r->name) || |
+ !ReadParam(m, iter, &r->package) || |
+ !ReadParam(m, iter, &r->activity)) { |
+ return false; |
+ } |
+ |
+ return true; |
+} |
+ |
+// static |
+void ParamTraits<arc::AppInfo>::Log(const param_type& p, std::string* l) { |
+ LogParam(p.name, l); |
+ l->append(" ("); |
+ LogParam(p.package, l); |
+ l->append("/"); |
+ LogParam(p.activity, l); |
+ l->append(")"); |
+} |
+ |
+} // namespace IPC |