| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "ppapi/c/pp_completion_callback.h" | 10 #include "ppapi/c/pp_completion_callback.h" |
| 10 #include "ppapi/c/pp_input_event.h" | 11 #include "ppapi/c/pp_input_event.h" |
| 11 #include "ppapi/c/pp_rect.h" | 12 #include "ppapi/c/pp_rect.h" |
| 12 #include "ppapi/c/pp_var.h" | 13 #include "ppapi/c/pp_var.h" |
| 13 #include "ppapi/proxy/serialized_var.h" // TODO(brettw) eraseme. | 14 #include "ppapi/proxy/serialized_var.h" // TODO(brettw) eraseme. |
| 14 | 15 |
| 16 struct PP_FileInfo_Dev; |
| 15 struct PP_ObjectProperty; | 17 struct PP_ObjectProperty; |
| 16 | 18 |
| 17 namespace pp { | 19 namespace pp { |
| 18 namespace proxy { | 20 namespace proxy { |
| 21 struct PPBFlash_DrawGlyphs_Params; |
| 19 struct PPBFont_DrawTextAt_Params; | 22 struct PPBFont_DrawTextAt_Params; |
| 23 struct SerializedDirEntry; |
| 20 struct SerializedFontDescription; | 24 struct SerializedFontDescription; |
| 21 class SerializedVar; | 25 class SerializedVar; |
| 22 } | 26 } |
| 23 } | 27 } |
| 24 | 28 |
| 25 namespace IPC { | 29 namespace IPC { |
| 26 | 30 |
| 27 template<> | 31 template<> |
| 28 struct ParamTraits<PP_Bool> { | 32 struct ParamTraits<PP_Bool> { |
| 29 typedef PP_Bool param_type; | 33 typedef PP_Bool param_type; |
| 30 static void Write(Message* m, const param_type& p); | 34 static void Write(Message* m, const param_type& p); |
| 31 static bool Read(const Message* m, void** iter, param_type* r); | 35 static bool Read(const Message* m, void** iter, param_type* r); |
| 32 static void Log(const param_type& p, std::string* l); | 36 static void Log(const param_type& p, std::string* l); |
| 33 }; | 37 }; |
| 34 | 38 |
| 35 template<> | 39 template<> |
| 40 struct ParamTraits<PP_FileInfo_Dev> { |
| 41 typedef PP_FileInfo_Dev param_type; |
| 42 static void Write(Message* m, const param_type& p); |
| 43 static bool Read(const Message* m, void** iter, param_type* r); |
| 44 static void Log(const param_type& p, std::string* l); |
| 45 }; |
| 46 |
| 47 template<> |
| 36 struct ParamTraits<PP_InputEvent> { | 48 struct ParamTraits<PP_InputEvent> { |
| 37 typedef PP_InputEvent param_type; | 49 typedef PP_InputEvent param_type; |
| 38 static void Write(Message* m, const param_type& p); | 50 static void Write(Message* m, const param_type& p); |
| 39 static bool Read(const Message* m, void** iter, param_type* r); | 51 static bool Read(const Message* m, void** iter, param_type* r); |
| 40 static void Log(const param_type& p, std::string* l); | 52 static void Log(const param_type& p, std::string* l); |
| 41 }; | 53 }; |
| 42 | 54 |
| 43 template<> | 55 template<> |
| 44 struct ParamTraits<PP_ObjectProperty> { | 56 struct ParamTraits<PP_ObjectProperty> { |
| 45 typedef PP_ObjectProperty param_type; | 57 typedef PP_ObjectProperty param_type; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 66 | 78 |
| 67 template<> | 79 template<> |
| 68 struct ParamTraits<PP_Size> { | 80 struct ParamTraits<PP_Size> { |
| 69 typedef PP_Size param_type; | 81 typedef PP_Size param_type; |
| 70 static void Write(Message* m, const param_type& p); | 82 static void Write(Message* m, const param_type& p); |
| 71 static bool Read(const Message* m, void** iter, param_type* r); | 83 static bool Read(const Message* m, void** iter, param_type* r); |
| 72 static void Log(const param_type& p, std::string* l); | 84 static void Log(const param_type& p, std::string* l); |
| 73 }; | 85 }; |
| 74 | 86 |
| 75 template<> | 87 template<> |
| 88 struct ParamTraits<pp::proxy::PPBFlash_DrawGlyphs_Params> { |
| 89 typedef pp::proxy::PPBFlash_DrawGlyphs_Params param_type; |
| 90 static void Write(Message* m, const param_type& p); |
| 91 static bool Read(const Message* m, void** iter, param_type* r); |
| 92 static void Log(const param_type& p, std::string* l); |
| 93 }; |
| 94 |
| 95 template<> |
| 76 struct ParamTraits<pp::proxy::PPBFont_DrawTextAt_Params> { | 96 struct ParamTraits<pp::proxy::PPBFont_DrawTextAt_Params> { |
| 77 typedef pp::proxy::PPBFont_DrawTextAt_Params param_type; | 97 typedef pp::proxy::PPBFont_DrawTextAt_Params param_type; |
| 78 static void Write(Message* m, const param_type& p); | 98 static void Write(Message* m, const param_type& p); |
| 79 static bool Read(const Message* m, void** iter, param_type* r); | 99 static bool Read(const Message* m, void** iter, param_type* r); |
| 80 static void Log(const param_type& p, std::string* l); | 100 static void Log(const param_type& p, std::string* l); |
| 81 }; | 101 }; |
| 82 | 102 |
| 83 template<> | 103 template<> |
| 104 struct ParamTraits<pp::proxy::SerializedDirEntry> { |
| 105 typedef pp::proxy::SerializedDirEntry param_type; |
| 106 static void Write(Message* m, const param_type& p); |
| 107 static bool Read(const Message* m, void** iter, param_type* r); |
| 108 static void Log(const param_type& p, std::string* l); |
| 109 }; |
| 110 |
| 111 template<> |
| 84 struct ParamTraits<pp::proxy::SerializedFontDescription> { | 112 struct ParamTraits<pp::proxy::SerializedFontDescription> { |
| 85 typedef pp::proxy::SerializedFontDescription param_type; | 113 typedef pp::proxy::SerializedFontDescription param_type; |
| 86 static void Write(Message* m, const param_type& p); | 114 static void Write(Message* m, const param_type& p); |
| 87 static bool Read(const Message* m, void** iter, param_type* r); | 115 static bool Read(const Message* m, void** iter, param_type* r); |
| 88 static void Log(const param_type& p, std::string* l); | 116 static void Log(const param_type& p, std::string* l); |
| 89 }; | 117 }; |
| 90 | 118 |
| 91 template<> | 119 template<> |
| 92 struct ParamTraits<pp::proxy::SerializedVar> { | 120 struct ParamTraits<pp::proxy::SerializedVar> { |
| 93 typedef pp::proxy::SerializedVar param_type; | 121 typedef pp::proxy::SerializedVar param_type; |
| 94 static void Write(Message* m, const param_type& p); | 122 static void Write(Message* m, const param_type& p); |
| 95 static bool Read(const Message* m, void** iter, param_type* r); | 123 static bool Read(const Message* m, void** iter, param_type* r); |
| 96 static void Log(const param_type& p, std::string* l); | 124 static void Log(const param_type& p, std::string* l); |
| 97 }; | 125 }; |
| 98 | 126 |
| 99 template<> | 127 template<> |
| 100 struct ParamTraits< std::vector<pp::proxy::SerializedVar> > { | 128 struct ParamTraits< std::vector<pp::proxy::SerializedVar> > { |
| 101 typedef std::vector<pp::proxy::SerializedVar> param_type; | 129 typedef std::vector<pp::proxy::SerializedVar> param_type; |
| 102 static void Write(Message* m, const param_type& p); | 130 static void Write(Message* m, const param_type& p); |
| 103 static bool Read(const Message* m, void** iter, param_type* r); | 131 static bool Read(const Message* m, void** iter, param_type* r); |
| 104 static void Log(const param_type& p, std::string* l); | 132 static void Log(const param_type& p, std::string* l); |
| 105 }; | 133 }; |
| 106 | 134 |
| 107 } // namespace IPC | 135 } // namespace IPC |
| 108 | 136 |
| 109 #endif // PPAPI_PROXY_PPAPI_PARAM_TRAITS_H_ | 137 #endif // PPAPI_PROXY_PPAPI_PARAM_TRAITS_H_ |
| OLD | NEW |