OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2012 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 |
| 6 // Get basic type definitions. |
| 7 #define IPC_MESSAGE_IMPL |
| 8 #include "ppapi/proxy/pepper_file_messages.h" |
| 9 |
| 10 // Generate constructors. |
| 11 #include "ipc/struct_constructor_macros.h" |
| 12 #include "ppapi/proxy/pepper_file_messages.h" |
| 13 |
| 14 // Generate destructors. |
| 15 #include "ipc/struct_destructor_macros.h" |
| 16 #include "ppapi/proxy/pepper_file_messages.h" |
| 17 |
| 18 // Generate param traits write methods. |
| 19 #include "ipc/param_traits_write_macros.h" |
| 20 namespace IPC { |
| 21 #include "ppapi/proxy/pepper_file_messages.h" |
| 22 } // namespace IPC |
| 23 |
| 24 // Generate param traits read methods. |
| 25 #include "ipc/param_traits_read_macros.h" |
| 26 namespace IPC { |
| 27 #include "ppapi/proxy/pepper_file_messages.h" |
| 28 } // namespace IPC |
| 29 |
| 30 // Generate param traits log methods. |
| 31 #include "ipc/param_traits_log_macros.h" |
| 32 namespace IPC { |
| 33 #include "ppapi/proxy/pepper_file_messages.h" |
| 34 } // namespace IPC |
| 35 |
| 36 namespace IPC { |
| 37 |
| 38 void ParamTraits<ppapi::PepperFilePath>::Write(Message* m, |
| 39 const param_type& p) { |
| 40 WriteParam(m, static_cast<unsigned>(p.domain())); |
| 41 WriteParam(m, p.path()); |
| 42 } |
| 43 |
| 44 bool ParamTraits<ppapi::PepperFilePath>::Read(const Message* m, |
| 45 PickleIterator* iter, |
| 46 param_type* p) { |
| 47 unsigned domain; |
| 48 FilePath path; |
| 49 if (!ReadParam(m, iter, &domain) || !ReadParam(m, iter, &path)) |
| 50 return false; |
| 51 if (domain > ppapi::PepperFilePath::DOMAIN_MAX_VALID) |
| 52 return false; |
| 53 |
| 54 *p = ppapi::PepperFilePath( |
| 55 static_cast<ppapi::PepperFilePath::Domain>(domain), path); |
| 56 return true; |
| 57 } |
| 58 |
| 59 void ParamTraits<ppapi::PepperFilePath>::Log(const param_type& p, |
| 60 std::string* l) { |
| 61 l->append("("); |
| 62 LogParam(static_cast<unsigned>(p.domain()), l); |
| 63 l->append(", "); |
| 64 LogParam(p.path(), l); |
| 65 l->append(")"); |
| 66 } |
| 67 |
| 68 } // namespace IPC |
OLD | NEW |