| 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 #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 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 struct SerializedFontDescription; | 32 struct SerializedFontDescription; |
| 33 class SerializedFlashMenu; | 33 class SerializedFlashMenu; |
| 34 class SerializedVar; | 34 class SerializedVar; |
| 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 PPAPI_PROXY_EXPORT 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, PickleIterator* 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 PPAPI_PROXY_EXPORT 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, PickleIterator* 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, PickleIterator* 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 PPAPI_PROXY_EXPORT 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, PickleIterator* 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 PPAPI_PROXY_EXPORT ParamTraits< |
| 75 ppapi::proxy::PPBFlash_DrawGlyphs_Params> { |
| 75 typedef ppapi::proxy::PPBFlash_DrawGlyphs_Params param_type; | 76 typedef ppapi::proxy::PPBFlash_DrawGlyphs_Params param_type; |
| 76 static void Write(Message* m, const param_type& p); | 77 static void Write(Message* m, const param_type& p); |
| 77 static bool Read(const Message* m, PickleIterator* iter, param_type* r); | 78 static bool Read(const Message* m, PickleIterator* iter, param_type* r); |
| 78 static void Log(const param_type& p, std::string* l); | 79 static void Log(const param_type& p, std::string* l); |
| 79 }; | 80 }; |
| 80 | 81 |
| 81 template<> | 82 template<> |
| 82 struct ParamTraits<ppapi::PPB_FileRef_CreateInfo> { | 83 struct PPAPI_PROXY_EXPORT ParamTraits<ppapi::PPB_FileRef_CreateInfo> { |
| 83 typedef ppapi::PPB_FileRef_CreateInfo param_type; | 84 typedef ppapi::PPB_FileRef_CreateInfo param_type; |
| 84 static void Write(Message* m, const param_type& p); | 85 static void Write(Message* m, const param_type& p); |
| 85 static bool Read(const Message* m, PickleIterator* iter, param_type* r); | 86 static bool Read(const Message* m, PickleIterator* iter, param_type* r); |
| 86 static void Log(const param_type& p, std::string* l); | 87 static void Log(const param_type& p, std::string* l); |
| 87 }; | 88 }; |
| 88 | 89 |
| 89 template<> | 90 template<> |
| 90 struct ParamTraits<ppapi::proxy::PPBURLLoader_UpdateProgress_Params> { | 91 struct PPAPI_PROXY_EXPORT ParamTraits< |
| 92 ppapi::proxy::PPBURLLoader_UpdateProgress_Params> { |
| 91 typedef ppapi::proxy::PPBURLLoader_UpdateProgress_Params param_type; | 93 typedef ppapi::proxy::PPBURLLoader_UpdateProgress_Params param_type; |
| 92 static void Write(Message* m, const param_type& p); | 94 static void Write(Message* m, const param_type& p); |
| 93 static bool Read(const Message* m, PickleIterator* iter, param_type* r); | 95 static bool Read(const Message* m, PickleIterator* iter, param_type* r); |
| 94 static void Log(const param_type& p, std::string* l); | 96 static void Log(const param_type& p, std::string* l); |
| 95 }; | 97 }; |
| 96 | 98 |
| 97 template<> | 99 template<> |
| 98 struct ParamTraits<ppapi::proxy::SerializedDirEntry> { | 100 struct PPAPI_PROXY_EXPORT ParamTraits<ppapi::proxy::SerializedDirEntry> { |
| 99 typedef ppapi::proxy::SerializedDirEntry param_type; | 101 typedef ppapi::proxy::SerializedDirEntry param_type; |
| 100 static void Write(Message* m, const param_type& p); | 102 static void Write(Message* m, const param_type& p); |
| 101 static bool Read(const Message* m, PickleIterator* iter, param_type* r); | 103 static bool Read(const Message* m, PickleIterator* iter, param_type* r); |
| 102 static void Log(const param_type& p, std::string* l); | 104 static void Log(const param_type& p, std::string* l); |
| 103 }; | 105 }; |
| 104 | 106 |
| 105 template<> | 107 template<> |
| 106 struct ParamTraits<ppapi::proxy::SerializedFontDescription> { | 108 struct PPAPI_PROXY_EXPORT ParamTraits<ppapi::proxy::SerializedFontDescription> { |
| 107 typedef ppapi::proxy::SerializedFontDescription param_type; | 109 typedef ppapi::proxy::SerializedFontDescription param_type; |
| 108 static void Write(Message* m, const param_type& p); | 110 static void Write(Message* m, const param_type& p); |
| 109 static bool Read(const Message* m, PickleIterator* iter, param_type* r); | 111 static bool Read(const Message* m, PickleIterator* iter, param_type* r); |
| 110 static void Log(const param_type& p, std::string* l); | 112 static void Log(const param_type& p, std::string* l); |
| 111 }; | 113 }; |
| 112 | 114 |
| 113 template<> | 115 template<> |
| 114 struct ParamTraits<ppapi::HostResource> { | 116 struct PPAPI_PROXY_EXPORT ParamTraits<ppapi::HostResource> { |
| 115 typedef ppapi::HostResource param_type; | 117 typedef ppapi::HostResource param_type; |
| 116 static void Write(Message* m, const param_type& p); | 118 static void Write(Message* m, const param_type& p); |
| 117 static bool Read(const Message* m, PickleIterator* iter, param_type* r); | 119 static bool Read(const Message* m, PickleIterator* iter, param_type* r); |
| 118 static void Log(const param_type& p, std::string* l); | 120 static void Log(const param_type& p, std::string* l); |
| 119 }; | 121 }; |
| 120 | 122 |
| 121 template<> | 123 template<> |
| 122 struct ParamTraits<ppapi::proxy::SerializedVar> { | 124 struct PPAPI_PROXY_EXPORT ParamTraits<ppapi::proxy::SerializedVar> { |
| 123 typedef ppapi::proxy::SerializedVar param_type; | 125 typedef ppapi::proxy::SerializedVar param_type; |
| 124 static void Write(Message* m, const param_type& p); | 126 static void Write(Message* m, const param_type& p); |
| 125 static bool Read(const Message* m, PickleIterator* iter, param_type* r); | 127 static bool Read(const Message* m, PickleIterator* iter, param_type* r); |
| 126 static void Log(const param_type& p, std::string* l); | 128 static void Log(const param_type& p, std::string* l); |
| 127 }; | 129 }; |
| 128 | 130 |
| 129 template<> | 131 template<> |
| 130 struct ParamTraits< std::vector<ppapi::proxy::SerializedVar> > { | 132 struct PPAPI_PROXY_EXPORT ParamTraits< |
| 133 std::vector<ppapi::proxy::SerializedVar> > { |
| 131 typedef std::vector<ppapi::proxy::SerializedVar> param_type; | 134 typedef std::vector<ppapi::proxy::SerializedVar> param_type; |
| 132 static void Write(Message* m, const param_type& p); | 135 static void Write(Message* m, const param_type& p); |
| 133 static bool Read(const Message* m, PickleIterator* iter, param_type* r); | 136 static bool Read(const Message* m, PickleIterator* iter, param_type* r); |
| 134 static void Log(const param_type& p, std::string* l); | 137 static void Log(const param_type& p, std::string* l); |
| 135 }; | 138 }; |
| 136 | 139 |
| 137 template<> | 140 template<> |
| 138 struct ParamTraits< std::vector<ppapi::PPB_FileRef_CreateInfo> > { | 141 struct PPAPI_PROXY_EXPORT ParamTraits< std::vector< |
| 142 ppapi::PPB_FileRef_CreateInfo> > { |
| 139 typedef std::vector<ppapi::PPB_FileRef_CreateInfo> param_type; | 143 typedef std::vector<ppapi::PPB_FileRef_CreateInfo> param_type; |
| 140 static void Write(Message* m, const param_type& p); | 144 static void Write(Message* m, const param_type& p); |
| 141 static bool Read(const Message* m, PickleIterator* iter, param_type* r); | 145 static bool Read(const Message* m, PickleIterator* iter, param_type* r); |
| 142 static void Log(const param_type& p, std::string* l); | 146 static void Log(const param_type& p, std::string* l); |
| 143 }; | 147 }; |
| 144 | 148 |
| 145 template<> | 149 template<> |
| 146 struct ParamTraits<ppapi::proxy::SerializedFlashMenu> { | 150 struct PPAPI_PROXY_EXPORT ParamTraits<ppapi::proxy::SerializedFlashMenu> { |
| 147 typedef ppapi::proxy::SerializedFlashMenu param_type; | 151 typedef ppapi::proxy::SerializedFlashMenu param_type; |
| 148 static void Write(Message* m, const param_type& p); | 152 static void Write(Message* m, const param_type& p); |
| 149 static bool Read(const Message* m, PickleIterator* iter, param_type* r); | 153 static bool Read(const Message* m, PickleIterator* iter, param_type* r); |
| 150 static void Log(const param_type& p, std::string* l); | 154 static void Log(const param_type& p, std::string* l); |
| 151 }; | 155 }; |
| 152 | 156 |
| 153 } // namespace IPC | 157 } // namespace IPC |
| 154 | 158 |
| 155 #endif // PPAPI_PROXY_PPAPI_PARAM_TRAITS_H_ | 159 #endif // PPAPI_PROXY_PPAPI_PARAM_TRAITS_H_ |
| OLD | NEW |