OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/common/pepper_file_messages.h" | 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 |
6 | 35 |
7 namespace IPC { | 36 namespace IPC { |
8 | 37 |
9 void ParamTraits<webkit::ppapi::PepperFilePath>::Write(Message* m, | 38 void ParamTraits<ppapi::PepperFilePath>::Write(Message* m, |
10 const param_type& p) { | 39 const param_type& p) { |
11 WriteParam(m, static_cast<unsigned>(p.domain())); | 40 WriteParam(m, static_cast<unsigned>(p.domain())); |
12 WriteParam(m, p.path()); | 41 WriteParam(m, p.path()); |
13 } | 42 } |
14 | 43 |
15 bool ParamTraits<webkit::ppapi::PepperFilePath>::Read(const Message* m, | 44 bool ParamTraits<ppapi::PepperFilePath>::Read(const Message* m, |
16 PickleIterator* iter, | 45 PickleIterator* iter, |
17 param_type* p) { | 46 param_type* p) { |
18 unsigned domain; | 47 unsigned domain; |
19 FilePath path; | 48 FilePath path; |
20 if (!ReadParam(m, iter, &domain) || !ReadParam(m, iter, &path)) | 49 if (!ReadParam(m, iter, &domain) || !ReadParam(m, iter, &path)) |
21 return false; | 50 return false; |
22 if (domain > webkit::ppapi::PepperFilePath::DOMAIN_MAX_VALID) | 51 if (domain > ppapi::PepperFilePath::DOMAIN_MAX_VALID) |
23 return false; | 52 return false; |
24 | 53 |
25 *p = webkit::ppapi::PepperFilePath( | 54 *p = ppapi::PepperFilePath( |
26 static_cast<webkit::ppapi::PepperFilePath::Domain>(domain), path); | 55 static_cast<ppapi::PepperFilePath::Domain>(domain), path); |
27 return true; | 56 return true; |
28 } | 57 } |
29 | 58 |
30 void ParamTraits<webkit::ppapi::PepperFilePath>::Log(const param_type& p, | 59 void ParamTraits<ppapi::PepperFilePath>::Log(const param_type& p, |
31 std::string* l) { | 60 std::string* l) { |
32 l->append("("); | 61 l->append("("); |
33 LogParam(static_cast<unsigned>(p.domain()), l); | 62 LogParam(static_cast<unsigned>(p.domain()), l); |
34 l->append(", "); | 63 l->append(", "); |
35 LogParam(p.path(), l); | 64 LogParam(p.path(), l); |
36 l->append(")"); | 65 l->append(")"); |
37 } | 66 } |
38 | 67 |
39 } // namespace IPC | 68 } // namespace IPC |
OLD | NEW |