| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "ipc/ipc_message_utils.h" | 8 #include "ipc/ipc_message_utils.h" |
| 9 #include "ipc/ipc_platform_file.h" | 9 #include "ipc/ipc_platform_file.h" |
| 10 #include "ppapi/c/pp_completion_callback.h" | 10 #include "ppapi/c/pp_completion_callback.h" |
| 11 #include "ppapi/c/pp_input_event.h" | 11 #include "ppapi/c/pp_input_event.h" |
| 12 #include "ppapi/c/pp_rect.h" | 12 #include "ppapi/c/pp_rect.h" |
| 13 #include "ppapi/c/pp_var.h" | 13 #include "ppapi/c/pp_var.h" |
| 14 #include "ppapi/proxy/serialized_var.h" // TODO(brettw) eraseme. | |
| 15 | 14 |
| 16 struct PP_FileInfo_Dev; | 15 struct PP_FileInfo_Dev; |
| 17 struct PP_ObjectProperty; | 16 struct PP_ObjectProperty; |
| 18 | 17 |
| 19 namespace pp { | 18 namespace pp { |
| 20 namespace proxy { | 19 namespace proxy { |
| 20 |
| 21 struct PPBAudio_NotifyAudioStreamCreated_Params; |
| 21 struct PPBFlash_DrawGlyphs_Params; | 22 struct PPBFlash_DrawGlyphs_Params; |
| 22 struct PPBFont_DrawTextAt_Params; | 23 struct PPBFont_DrawTextAt_Params; |
| 24 struct PPBURLLoader_UpdateProgress_Params; |
| 23 struct SerializedDirEntry; | 25 struct SerializedDirEntry; |
| 24 struct SerializedFontDescription; | 26 struct SerializedFontDescription; |
| 27 class HostResource; |
| 25 class SerializedVar; | 28 class SerializedVar; |
| 26 } | 29 |
| 27 } | 30 } // namespace proxy |
| 31 } // namespace pp |
| 28 | 32 |
| 29 namespace IPC { | 33 namespace IPC { |
| 30 | 34 |
| 31 template<> | 35 template<> |
| 32 struct ParamTraits<PP_Bool> { | 36 struct ParamTraits<PP_Bool> { |
| 33 typedef PP_Bool param_type; | 37 typedef PP_Bool param_type; |
| 34 static void Write(Message* m, const param_type& p); | 38 static void Write(Message* m, const param_type& p); |
| 35 static bool Read(const Message* m, void** iter, param_type* r); | 39 static bool Read(const Message* m, void** iter, param_type* r); |
| 36 static void Log(const param_type& p, std::string* l); | 40 static void Log(const param_type& p, std::string* l); |
| 37 }; | 41 }; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 }; | 81 }; |
| 78 | 82 |
| 79 template<> | 83 template<> |
| 80 struct ParamTraits<PP_Size> { | 84 struct ParamTraits<PP_Size> { |
| 81 typedef PP_Size param_type; | 85 typedef PP_Size param_type; |
| 82 static void Write(Message* m, const param_type& p); | 86 static void Write(Message* m, const param_type& p); |
| 83 static bool Read(const Message* m, void** iter, param_type* r); | 87 static bool Read(const Message* m, void** iter, param_type* r); |
| 84 static void Log(const param_type& p, std::string* l); | 88 static void Log(const param_type& p, std::string* l); |
| 85 }; | 89 }; |
| 86 | 90 |
| 91 template<> struct ParamTraits< |
| 92 pp::proxy::PPBAudio_NotifyAudioStreamCreated_Params> { |
| 93 typedef pp::proxy::PPBAudio_NotifyAudioStreamCreated_Params param_type; |
| 94 static void Write(Message* m, const param_type& p); |
| 95 static bool Read(const Message* m, void** iter, param_type* r); |
| 96 static void Log(const param_type& p, std::string* l); |
| 97 }; |
| 98 |
| 87 template<> | 99 template<> |
| 88 struct ParamTraits<pp::proxy::PPBFlash_DrawGlyphs_Params> { | 100 struct ParamTraits<pp::proxy::PPBFlash_DrawGlyphs_Params> { |
| 89 typedef pp::proxy::PPBFlash_DrawGlyphs_Params param_type; | 101 typedef pp::proxy::PPBFlash_DrawGlyphs_Params param_type; |
| 90 static void Write(Message* m, const param_type& p); | 102 static void Write(Message* m, const param_type& p); |
| 91 static bool Read(const Message* m, void** iter, param_type* r); | 103 static bool Read(const Message* m, void** iter, param_type* r); |
| 92 static void Log(const param_type& p, std::string* l); | 104 static void Log(const param_type& p, std::string* l); |
| 93 }; | 105 }; |
| 94 | 106 |
| 95 template<> | 107 template<> |
| 96 struct ParamTraits<pp::proxy::PPBFont_DrawTextAt_Params> { | 108 struct ParamTraits<pp::proxy::PPBFont_DrawTextAt_Params> { |
| 97 typedef pp::proxy::PPBFont_DrawTextAt_Params param_type; | 109 typedef pp::proxy::PPBFont_DrawTextAt_Params param_type; |
| 98 static void Write(Message* m, const param_type& p); | 110 static void Write(Message* m, const param_type& p); |
| 99 static bool Read(const Message* m, void** iter, param_type* r); | 111 static bool Read(const Message* m, void** iter, param_type* r); |
| 100 static void Log(const param_type& p, std::string* l); | 112 static void Log(const param_type& p, std::string* l); |
| 101 }; | 113 }; |
| 102 | 114 |
| 103 template<> | 115 template<> |
| 116 struct ParamTraits<pp::proxy::PPBURLLoader_UpdateProgress_Params> { |
| 117 typedef pp::proxy::PPBURLLoader_UpdateProgress_Params param_type; |
| 118 static void Write(Message* m, const param_type& p); |
| 119 static bool Read(const Message* m, void** iter, param_type* r); |
| 120 static void Log(const param_type& p, std::string* l); |
| 121 }; |
| 122 |
| 123 template<> |
| 104 struct ParamTraits<pp::proxy::SerializedDirEntry> { | 124 struct ParamTraits<pp::proxy::SerializedDirEntry> { |
| 105 typedef pp::proxy::SerializedDirEntry param_type; | 125 typedef pp::proxy::SerializedDirEntry param_type; |
| 106 static void Write(Message* m, const param_type& p); | 126 static void Write(Message* m, const param_type& p); |
| 107 static bool Read(const Message* m, void** iter, param_type* r); | 127 static bool Read(const Message* m, void** iter, param_type* r); |
| 108 static void Log(const param_type& p, std::string* l); | 128 static void Log(const param_type& p, std::string* l); |
| 109 }; | 129 }; |
| 110 | 130 |
| 111 template<> | 131 template<> |
| 112 struct ParamTraits<pp::proxy::SerializedFontDescription> { | 132 struct ParamTraits<pp::proxy::SerializedFontDescription> { |
| 113 typedef pp::proxy::SerializedFontDescription param_type; | 133 typedef pp::proxy::SerializedFontDescription param_type; |
| 114 static void Write(Message* m, const param_type& p); | 134 static void Write(Message* m, const param_type& p); |
| 115 static bool Read(const Message* m, void** iter, param_type* r); | 135 static bool Read(const Message* m, void** iter, param_type* r); |
| 116 static void Log(const param_type& p, std::string* l); | 136 static void Log(const param_type& p, std::string* l); |
| 117 }; | 137 }; |
| 118 | 138 |
| 119 template<> | 139 template<> |
| 140 struct ParamTraits<pp::proxy::HostResource> { |
| 141 typedef pp::proxy::HostResource param_type; |
| 142 static void Write(Message* m, const param_type& p); |
| 143 static bool Read(const Message* m, void** iter, param_type* r); |
| 144 static void Log(const param_type& p, std::string* l); |
| 145 }; |
| 146 |
| 147 template<> |
| 120 struct ParamTraits<pp::proxy::SerializedVar> { | 148 struct ParamTraits<pp::proxy::SerializedVar> { |
| 121 typedef pp::proxy::SerializedVar param_type; | 149 typedef pp::proxy::SerializedVar param_type; |
| 122 static void Write(Message* m, const param_type& p); | 150 static void Write(Message* m, const param_type& p); |
| 123 static bool Read(const Message* m, void** iter, param_type* r); | 151 static bool Read(const Message* m, void** iter, param_type* r); |
| 124 static void Log(const param_type& p, std::string* l); | 152 static void Log(const param_type& p, std::string* l); |
| 125 }; | 153 }; |
| 126 | 154 |
| 127 template<> | 155 template<> |
| 128 struct ParamTraits< std::vector<pp::proxy::SerializedVar> > { | 156 struct ParamTraits< std::vector<pp::proxy::SerializedVar> > { |
| 129 typedef std::vector<pp::proxy::SerializedVar> param_type; | 157 typedef std::vector<pp::proxy::SerializedVar> param_type; |
| 130 static void Write(Message* m, const param_type& p); | 158 static void Write(Message* m, const param_type& p); |
| 131 static bool Read(const Message* m, void** iter, param_type* r); | 159 static bool Read(const Message* m, void** iter, param_type* r); |
| 132 static void Log(const param_type& p, std::string* l); | 160 static void Log(const param_type& p, std::string* l); |
| 133 }; | 161 }; |
| 134 | 162 |
| 135 } // namespace IPC | 163 } // namespace IPC |
| 136 | 164 |
| 137 #endif // PPAPI_PROXY_PPAPI_PARAM_TRAITS_H_ | 165 #endif // PPAPI_PROXY_PPAPI_PARAM_TRAITS_H_ |
| OLD | NEW |