Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1389)

Side by Side Diff: ppapi/proxy/ppapi_param_traits.h

Issue 6334016: Refactor PPAPI proxy resource handling to maintain which host they came from,... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "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. 14 #include "ppapi/proxy/serialized_var.h" // TODO(brettw) eraseme.
viettrungluu 2011/01/27 16:52:58 Why is this still here?
15 15
16 struct PP_FileInfo_Dev; 16 struct PP_FileInfo_Dev;
17 struct PP_ObjectProperty; 17 struct PP_ObjectProperty;
18 18
19 namespace pp { 19 namespace pp {
20 namespace proxy { 20 namespace proxy {
21
22 struct PPBAudio_NotifyAudioStreamCreated_Params;
21 struct PPBFlash_DrawGlyphs_Params; 23 struct PPBFlash_DrawGlyphs_Params;
22 struct PPBFont_DrawTextAt_Params; 24 struct PPBFont_DrawTextAt_Params;
25 struct PPBURLLoader_UpdateProgress_Params;
23 struct SerializedDirEntry; 26 struct SerializedDirEntry;
24 struct SerializedFontDescription; 27 struct SerializedFontDescription;
28 class SerializedResource;
25 class SerializedVar; 29 class SerializedVar;
26 } 30
27 } 31 } // namespace proxy
32 } // namespace pp
28 33
29 namespace IPC { 34 namespace IPC {
30 35
31 template<> 36 template<>
32 struct ParamTraits<PP_Bool> { 37 struct ParamTraits<PP_Bool> {
33 typedef PP_Bool param_type; 38 typedef PP_Bool param_type;
34 static void Write(Message* m, const param_type& p); 39 static void Write(Message* m, const param_type& p);
35 static bool Read(const Message* m, void** iter, param_type* r); 40 static bool Read(const Message* m, void** iter, param_type* r);
36 static void Log(const param_type& p, std::string* l); 41 static void Log(const param_type& p, std::string* l);
37 }; 42 };
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 }; 82 };
78 83
79 template<> 84 template<>
80 struct ParamTraits<PP_Size> { 85 struct ParamTraits<PP_Size> {
81 typedef PP_Size param_type; 86 typedef PP_Size param_type;
82 static void Write(Message* m, const param_type& p); 87 static void Write(Message* m, const param_type& p);
83 static bool Read(const Message* m, void** iter, param_type* r); 88 static bool Read(const Message* m, void** iter, param_type* r);
84 static void Log(const param_type& p, std::string* l); 89 static void Log(const param_type& p, std::string* l);
85 }; 90 };
86 91
92 template<> struct ParamTraits<
93 pp::proxy::PPBAudio_NotifyAudioStreamCreated_Params> {
94 typedef pp::proxy::PPBAudio_NotifyAudioStreamCreated_Params param_type;
95 static void Write(Message* m, const param_type& p);
96 static bool Read(const Message* m, void** iter, param_type* r);
97 static void Log(const param_type& p, std::string* l);
98 };
99
87 template<> 100 template<>
88 struct ParamTraits<pp::proxy::PPBFlash_DrawGlyphs_Params> { 101 struct ParamTraits<pp::proxy::PPBFlash_DrawGlyphs_Params> {
89 typedef pp::proxy::PPBFlash_DrawGlyphs_Params param_type; 102 typedef pp::proxy::PPBFlash_DrawGlyphs_Params param_type;
90 static void Write(Message* m, const param_type& p); 103 static void Write(Message* m, const param_type& p);
91 static bool Read(const Message* m, void** iter, param_type* r); 104 static bool Read(const Message* m, void** iter, param_type* r);
92 static void Log(const param_type& p, std::string* l); 105 static void Log(const param_type& p, std::string* l);
93 }; 106 };
94 107
95 template<> 108 template<>
96 struct ParamTraits<pp::proxy::PPBFont_DrawTextAt_Params> { 109 struct ParamTraits<pp::proxy::PPBFont_DrawTextAt_Params> {
97 typedef pp::proxy::PPBFont_DrawTextAt_Params param_type; 110 typedef pp::proxy::PPBFont_DrawTextAt_Params param_type;
98 static void Write(Message* m, const param_type& p); 111 static void Write(Message* m, const param_type& p);
99 static bool Read(const Message* m, void** iter, param_type* r); 112 static bool Read(const Message* m, void** iter, param_type* r);
100 static void Log(const param_type& p, std::string* l); 113 static void Log(const param_type& p, std::string* l);
101 }; 114 };
102 115
103 template<> 116 template<>
117 struct ParamTraits<pp::proxy::PPBURLLoader_UpdateProgress_Params> {
118 typedef pp::proxy::PPBURLLoader_UpdateProgress_Params param_type;
119 static void Write(Message* m, const param_type& p);
120 static bool Read(const Message* m, void** iter, param_type* r);
121 static void Log(const param_type& p, std::string* l);
122 };
123
124 template<>
104 struct ParamTraits<pp::proxy::SerializedDirEntry> { 125 struct ParamTraits<pp::proxy::SerializedDirEntry> {
105 typedef pp::proxy::SerializedDirEntry param_type; 126 typedef pp::proxy::SerializedDirEntry param_type;
106 static void Write(Message* m, const param_type& p); 127 static void Write(Message* m, const param_type& p);
107 static bool Read(const Message* m, void** iter, param_type* r); 128 static bool Read(const Message* m, void** iter, param_type* r);
108 static void Log(const param_type& p, std::string* l); 129 static void Log(const param_type& p, std::string* l);
109 }; 130 };
110 131
111 template<> 132 template<>
112 struct ParamTraits<pp::proxy::SerializedFontDescription> { 133 struct ParamTraits<pp::proxy::SerializedFontDescription> {
113 typedef pp::proxy::SerializedFontDescription param_type; 134 typedef pp::proxy::SerializedFontDescription param_type;
114 static void Write(Message* m, const param_type& p); 135 static void Write(Message* m, const param_type& p);
115 static bool Read(const Message* m, void** iter, param_type* r); 136 static bool Read(const Message* m, void** iter, param_type* r);
116 static void Log(const param_type& p, std::string* l); 137 static void Log(const param_type& p, std::string* l);
117 }; 138 };
118 139
119 template<> 140 template<>
141 struct ParamTraits<pp::proxy::SerializedResource> {
142 typedef pp::proxy::SerializedResource param_type;
143 static void Write(Message* m, const param_type& p);
144 static bool Read(const Message* m, void** iter, param_type* r);
145 static void Log(const param_type& p, std::string* l);
146 };
147
148 template<>
120 struct ParamTraits<pp::proxy::SerializedVar> { 149 struct ParamTraits<pp::proxy::SerializedVar> {
121 typedef pp::proxy::SerializedVar param_type; 150 typedef pp::proxy::SerializedVar param_type;
122 static void Write(Message* m, const param_type& p); 151 static void Write(Message* m, const param_type& p);
123 static bool Read(const Message* m, void** iter, param_type* r); 152 static bool Read(const Message* m, void** iter, param_type* r);
124 static void Log(const param_type& p, std::string* l); 153 static void Log(const param_type& p, std::string* l);
125 }; 154 };
126 155
127 template<> 156 template<>
128 struct ParamTraits< std::vector<pp::proxy::SerializedVar> > { 157 struct ParamTraits< std::vector<pp::proxy::SerializedVar> > {
129 typedef std::vector<pp::proxy::SerializedVar> param_type; 158 typedef std::vector<pp::proxy::SerializedVar> param_type;
130 static void Write(Message* m, const param_type& p); 159 static void Write(Message* m, const param_type& p);
131 static bool Read(const Message* m, void** iter, param_type* r); 160 static bool Read(const Message* m, void** iter, param_type* r);
132 static void Log(const param_type& p, std::string* l); 161 static void Log(const param_type& p, std::string* l);
133 }; 162 };
134 163
135 } // namespace IPC 164 } // namespace IPC
136 165
137 #endif // PPAPI_PROXY_PPAPI_PARAM_TRAITS_H_ 166 #endif // PPAPI_PROXY_PPAPI_PARAM_TRAITS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698