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

Unified Diff: components/arc/common/arc_message_traits.cc

Issue 1475563002: arc-bridge: Implement IPC message for app launcher (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: move spliting arc_bridge_service to another CL Created 5 years, 1 month 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
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

Powered by Google App Engine
This is Rietveld 408576698