OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 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 "components/arc/common/arc_message_traits.h" |
| 6 |
| 7 #include "ipc/param_traits_write_macros.h" |
| 8 #include "ipc/param_traits_read_macros.h" |
| 9 #include "ipc/param_traits_log_macros.h" |
| 10 |
| 11 namespace IPC { |
| 12 |
| 13 // static |
| 14 void ParamTraits<arc::AppInfo>::Write(Message* m, const param_type& p) { |
| 15 WriteParam(m, p.name); |
| 16 WriteParam(m, p.package); |
| 17 WriteParam(m, p.activity); |
| 18 } |
| 19 |
| 20 // static |
| 21 bool ParamTraits<arc::AppInfo>::Read(const Message* m, |
| 22 base::PickleIterator* iter, |
| 23 param_type* r) { |
| 24 if (!ReadParam(m, iter, &r->name) || |
| 25 !ReadParam(m, iter, &r->package) || |
| 26 !ReadParam(m, iter, &r->activity)) { |
| 27 return false; |
| 28 } |
| 29 |
| 30 return true; |
| 31 } |
| 32 |
| 33 // static |
| 34 void ParamTraits<arc::AppInfo>::Log(const param_type& p, std::string* l) { |
| 35 LogParam(p.name, l); |
| 36 l->append(" ("); |
| 37 LogParam(p.package, l); |
| 38 l->append("/"); |
| 39 LogParam(p.activity, l); |
| 40 l->append(")"); |
| 41 } |
| 42 |
| 43 } // namespace IPC |
OLD | NEW |