OLD | NEW |
1 // Copyright (c) 2011 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 #ifndef PPAPI_PROXY_PPAPI_PARAM_TRAITS_H_ | 5 #ifndef PPAPI_PROXY_PPAPI_PARAM_TRAITS_H_ |
6 #define PPAPI_PROXY_PPAPI_PARAM_TRAITS_H_ | 6 #define PPAPI_PROXY_PPAPI_PARAM_TRAITS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "ipc/ipc_message_utils.h" | 11 #include "ipc/ipc_message_utils.h" |
(...skipping 23 matching lines...) Expand all Loading... |
35 | 35 |
36 } // namespace proxy | 36 } // namespace proxy |
37 } // namespace ppapi | 37 } // namespace ppapi |
38 | 38 |
39 namespace IPC { | 39 namespace IPC { |
40 | 40 |
41 template<> | 41 template<> |
42 struct ParamTraits<PP_Bool> { | 42 struct ParamTraits<PP_Bool> { |
43 typedef PP_Bool param_type; | 43 typedef PP_Bool param_type; |
44 static void Write(Message* m, const param_type& p); | 44 static void Write(Message* m, const param_type& p); |
45 static bool Read(const Message* m, void** iter, param_type* r); | 45 static bool Read(const Message* m, PickleIterator* iter, param_type* r); |
46 static void Log(const param_type& p, std::string* l); | 46 static void Log(const param_type& p, std::string* l); |
47 }; | 47 }; |
48 | 48 |
49 template<> | 49 template<> |
50 struct ParamTraits<PP_FileInfo> { | 50 struct ParamTraits<PP_FileInfo> { |
51 typedef PP_FileInfo param_type; | 51 typedef PP_FileInfo param_type; |
52 static void Write(Message* m, const param_type& p); | 52 static void Write(Message* m, const param_type& p); |
53 static bool Read(const Message* m, void** iter, param_type* r); | 53 static bool Read(const Message* m, PickleIterator* iter, param_type* r); |
54 static void Log(const param_type& p, std::string* l); | 54 static void Log(const param_type& p, std::string* l); |
55 }; | 55 }; |
56 | 56 |
57 template <> | 57 template <> |
58 struct PPAPI_PROXY_EXPORT ParamTraits<PP_NetAddress_Private> { | 58 struct PPAPI_PROXY_EXPORT ParamTraits<PP_NetAddress_Private> { |
59 typedef PP_NetAddress_Private param_type; | 59 typedef PP_NetAddress_Private param_type; |
60 static void Write(Message* m, const param_type& p); | 60 static void Write(Message* m, const param_type& p); |
61 static bool Read(const Message* m, void** iter, param_type* p); | 61 static bool Read(const Message* m, PickleIterator* iter, param_type* p); |
62 static void Log(const param_type& p, std::string* l); | 62 static void Log(const param_type& p, std::string* l); |
63 }; | 63 }; |
64 | 64 |
65 template<> | 65 template<> |
66 struct ParamTraits<PP_ObjectProperty> { | 66 struct ParamTraits<PP_ObjectProperty> { |
67 typedef PP_ObjectProperty param_type; | 67 typedef PP_ObjectProperty param_type; |
68 static void Write(Message* m, const param_type& p); | 68 static void Write(Message* m, const param_type& p); |
69 static bool Read(const Message* m, void** iter, param_type* r); | 69 static bool Read(const Message* m, PickleIterator* iter, param_type* r); |
70 static void Log(const param_type& p, std::string* l); | 70 static void Log(const param_type& p, std::string* l); |
71 }; | 71 }; |
72 | 72 |
73 template<> | 73 template<> |
74 struct ParamTraits<ppapi::proxy::PPBFlash_DrawGlyphs_Params> { | 74 struct ParamTraits<ppapi::proxy::PPBFlash_DrawGlyphs_Params> { |
75 typedef ppapi::proxy::PPBFlash_DrawGlyphs_Params param_type; | 75 typedef ppapi::proxy::PPBFlash_DrawGlyphs_Params param_type; |
76 static void Write(Message* m, const param_type& p); | 76 static void Write(Message* m, const param_type& p); |
77 static bool Read(const Message* m, void** iter, param_type* r); | 77 static bool Read(const Message* m, PickleIterator* iter, param_type* r); |
78 static void Log(const param_type& p, std::string* l); | 78 static void Log(const param_type& p, std::string* l); |
79 }; | 79 }; |
80 | 80 |
81 template<> | 81 template<> |
82 struct ParamTraits<ppapi::PPB_FileRef_CreateInfo> { | 82 struct ParamTraits<ppapi::PPB_FileRef_CreateInfo> { |
83 typedef ppapi::PPB_FileRef_CreateInfo param_type; | 83 typedef ppapi::PPB_FileRef_CreateInfo param_type; |
84 static void Write(Message* m, const param_type& p); | 84 static void Write(Message* m, const param_type& p); |
85 static bool Read(const Message* m, void** iter, param_type* r); | 85 static bool Read(const Message* m, PickleIterator* iter, param_type* r); |
86 static void Log(const param_type& p, std::string* l); | 86 static void Log(const param_type& p, std::string* l); |
87 }; | 87 }; |
88 | 88 |
89 template<> | 89 template<> |
90 struct ParamTraits<ppapi::proxy::PPBURLLoader_UpdateProgress_Params> { | 90 struct ParamTraits<ppapi::proxy::PPBURLLoader_UpdateProgress_Params> { |
91 typedef ppapi::proxy::PPBURLLoader_UpdateProgress_Params param_type; | 91 typedef ppapi::proxy::PPBURLLoader_UpdateProgress_Params param_type; |
92 static void Write(Message* m, const param_type& p); | 92 static void Write(Message* m, const param_type& p); |
93 static bool Read(const Message* m, void** iter, param_type* r); | 93 static bool Read(const Message* m, PickleIterator* iter, param_type* r); |
94 static void Log(const param_type& p, std::string* l); | 94 static void Log(const param_type& p, std::string* l); |
95 }; | 95 }; |
96 | 96 |
97 template<> | 97 template<> |
98 struct ParamTraits<ppapi::proxy::SerializedDirEntry> { | 98 struct ParamTraits<ppapi::proxy::SerializedDirEntry> { |
99 typedef ppapi::proxy::SerializedDirEntry param_type; | 99 typedef ppapi::proxy::SerializedDirEntry param_type; |
100 static void Write(Message* m, const param_type& p); | 100 static void Write(Message* m, const param_type& p); |
101 static bool Read(const Message* m, void** iter, param_type* r); | 101 static bool Read(const Message* m, PickleIterator* iter, param_type* r); |
102 static void Log(const param_type& p, std::string* l); | 102 static void Log(const param_type& p, std::string* l); |
103 }; | 103 }; |
104 | 104 |
105 template<> | 105 template<> |
106 struct ParamTraits<ppapi::proxy::SerializedFontDescription> { | 106 struct ParamTraits<ppapi::proxy::SerializedFontDescription> { |
107 typedef ppapi::proxy::SerializedFontDescription param_type; | 107 typedef ppapi::proxy::SerializedFontDescription param_type; |
108 static void Write(Message* m, const param_type& p); | 108 static void Write(Message* m, const param_type& p); |
109 static bool Read(const Message* m, void** iter, param_type* r); | 109 static bool Read(const Message* m, PickleIterator* iter, param_type* r); |
110 static void Log(const param_type& p, std::string* l); | 110 static void Log(const param_type& p, std::string* l); |
111 }; | 111 }; |
112 | 112 |
113 template<> | 113 template<> |
114 struct ParamTraits<ppapi::HostResource> { | 114 struct ParamTraits<ppapi::HostResource> { |
115 typedef ppapi::HostResource param_type; | 115 typedef ppapi::HostResource param_type; |
116 static void Write(Message* m, const param_type& p); | 116 static void Write(Message* m, const param_type& p); |
117 static bool Read(const Message* m, void** iter, param_type* r); | 117 static bool Read(const Message* m, PickleIterator* iter, param_type* r); |
118 static void Log(const param_type& p, std::string* l); | 118 static void Log(const param_type& p, std::string* l); |
119 }; | 119 }; |
120 | 120 |
121 template<> | 121 template<> |
122 struct ParamTraits<ppapi::proxy::SerializedVar> { | 122 struct ParamTraits<ppapi::proxy::SerializedVar> { |
123 typedef ppapi::proxy::SerializedVar param_type; | 123 typedef ppapi::proxy::SerializedVar param_type; |
124 static void Write(Message* m, const param_type& p); | 124 static void Write(Message* m, const param_type& p); |
125 static bool Read(const Message* m, void** iter, param_type* r); | 125 static bool Read(const Message* m, PickleIterator* iter, param_type* r); |
126 static void Log(const param_type& p, std::string* l); | 126 static void Log(const param_type& p, std::string* l); |
127 }; | 127 }; |
128 | 128 |
129 template<> | 129 template<> |
130 struct ParamTraits< std::vector<ppapi::proxy::SerializedVar> > { | 130 struct ParamTraits< std::vector<ppapi::proxy::SerializedVar> > { |
131 typedef std::vector<ppapi::proxy::SerializedVar> param_type; | 131 typedef std::vector<ppapi::proxy::SerializedVar> param_type; |
132 static void Write(Message* m, const param_type& p); | 132 static void Write(Message* m, const param_type& p); |
133 static bool Read(const Message* m, void** iter, param_type* r); | 133 static bool Read(const Message* m, PickleIterator* iter, param_type* r); |
134 static void Log(const param_type& p, std::string* l); | 134 static void Log(const param_type& p, std::string* l); |
135 }; | 135 }; |
136 | 136 |
137 template<> | 137 template<> |
138 struct ParamTraits< std::vector<ppapi::PPB_FileRef_CreateInfo> > { | 138 struct ParamTraits< std::vector<ppapi::PPB_FileRef_CreateInfo> > { |
139 typedef std::vector<ppapi::PPB_FileRef_CreateInfo> param_type; | 139 typedef std::vector<ppapi::PPB_FileRef_CreateInfo> param_type; |
140 static void Write(Message* m, const param_type& p); | 140 static void Write(Message* m, const param_type& p); |
141 static bool Read(const Message* m, void** iter, param_type* r); | 141 static bool Read(const Message* m, PickleIterator* iter, param_type* r); |
142 static void Log(const param_type& p, std::string* l); | 142 static void Log(const param_type& p, std::string* l); |
143 }; | 143 }; |
144 | 144 |
145 template<> | 145 template<> |
146 struct ParamTraits<ppapi::proxy::SerializedFlashMenu> { | 146 struct ParamTraits<ppapi::proxy::SerializedFlashMenu> { |
147 typedef ppapi::proxy::SerializedFlashMenu param_type; | 147 typedef ppapi::proxy::SerializedFlashMenu param_type; |
148 static void Write(Message* m, const param_type& p); | 148 static void Write(Message* m, const param_type& p); |
149 static bool Read(const Message* m, void** iter, param_type* r); | 149 static bool Read(const Message* m, PickleIterator* iter, param_type* r); |
150 static void Log(const param_type& p, std::string* l); | 150 static void Log(const param_type& p, std::string* l); |
151 }; | 151 }; |
152 | 152 |
153 } // namespace IPC | 153 } // namespace IPC |
154 | 154 |
155 #endif // PPAPI_PROXY_PPAPI_PARAM_TRAITS_H_ | 155 #endif // PPAPI_PROXY_PPAPI_PARAM_TRAITS_H_ |
OLD | NEW |