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 #include "base/logging.h" |
5 #include "ppapi/c/pp_array_output.h" | 6 #include "ppapi/c/pp_array_output.h" |
6 #include "ppapi/c/pp_errors.h" | 7 #include "ppapi/c/pp_errors.h" |
7 #include "ppapi/c/private/ppb_flash.h" | 8 #include "ppapi/c/private/ppb_flash.h" |
8 #include "ppapi/shared_impl/ppapi_globals.h" | 9 #include "ppapi/shared_impl/ppapi_globals.h" |
9 #include "ppapi/shared_impl/proxy_lock.h" | 10 #include "ppapi/shared_impl/proxy_lock.h" |
10 #include "ppapi/shared_impl/var.h" | 11 #include "ppapi/shared_impl/var.h" |
11 #include "ppapi/thunk/enter.h" | 12 #include "ppapi/thunk/enter.h" |
12 #include "ppapi/thunk/ppb_flash_api.h" | 13 #include "ppapi/thunk/ppb_flash_api.h" |
13 #include "ppapi/thunk/ppb_flash_functions_api.h" | 14 #include "ppapi/thunk/ppb_flash_functions_api.h" |
14 #include "ppapi/thunk/ppb_instance_api.h" | 15 #include "ppapi/thunk/ppb_instance_api.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 } | 68 } |
68 | 69 |
69 EnterInstance enter(instance); | 70 EnterInstance enter(instance); |
70 if (enter.failed()) | 71 if (enter.failed()) |
71 return PP_ERROR_BADARGUMENT; | 72 return PP_ERROR_BADARGUMENT; |
72 return enter.functions()->GetFlashAPI()->Navigate(instance, request_id, | 73 return enter.functions()->GetFlashAPI()->Navigate(instance, request_id, |
73 target, from_user_action); | 74 target, from_user_action); |
74 } | 75 } |
75 | 76 |
76 void RunMessageLoop(PP_Instance instance) { | 77 void RunMessageLoop(PP_Instance instance) { |
77 EnterInstance enter(instance); | 78 // Deprecated. |
78 if (enter.failed()) | 79 NOTREACHED(); |
79 return; | 80 return; |
80 enter.functions()->GetFlashAPI()->RunMessageLoop(instance); | |
81 } | 81 } |
82 | 82 |
83 void QuitMessageLoop(PP_Instance instance) { | 83 void QuitMessageLoop(PP_Instance instance) { |
84 EnterInstance enter(instance); | 84 // Deprecated. |
85 if (enter.failed()) | 85 NOTREACHED(); |
86 return; | 86 return; |
87 enter.functions()->GetFlashAPI()->QuitMessageLoop(instance); | |
88 } | 87 } |
89 | 88 |
90 double GetLocalTimeZoneOffset(PP_Instance instance, PP_Time t) { | 89 double GetLocalTimeZoneOffset(PP_Instance instance, PP_Time t) { |
91 EnterInstance enter(instance); | 90 EnterInstance enter(instance); |
92 if (enter.failed()) | 91 if (enter.failed()) |
93 return 0.0; | 92 return 0.0; |
94 return enter.functions()->GetFlashAPI()->GetLocalTimeZoneOffset(instance, t); | 93 return enter.functions()->GetFlashAPI()->GetLocalTimeZoneOffset(instance, t); |
95 } | 94 } |
96 | 95 |
97 PP_Var GetCommandLineArgs(PP_Module /* pp_module */) { | 96 PP_Var GetCommandLineArgs(PP_Module /* pp_module */) { |
(...skipping 22 matching lines...) Expand all Loading... |
120 } | 119 } |
121 | 120 |
122 void UpdateActivity(PP_Instance instance) { | 121 void UpdateActivity(PP_Instance instance) { |
123 EnterInstance enter(instance); | 122 EnterInstance enter(instance); |
124 if (enter.failed()) | 123 if (enter.failed()) |
125 return; | 124 return; |
126 enter.functions()->GetFlashAPI()->UpdateActivity(instance); | 125 enter.functions()->GetFlashAPI()->UpdateActivity(instance); |
127 } | 126 } |
128 | 127 |
129 PP_Var GetDeviceID(PP_Instance instance) { | 128 PP_Var GetDeviceID(PP_Instance instance) { |
130 EnterInstance enter(instance); | 129 // Deprecated. |
131 if (enter.failed()) | 130 NOTREACHED(); |
132 return PP_MakeUndefined(); | 131 return PP_MakeUndefined(); |
133 return enter.functions()->GetFlashAPI()->GetDeviceID(instance); | |
134 } | 132 } |
135 | 133 |
136 int32_t GetSettingInt(PP_Instance instance, PP_FlashSetting setting) { | 134 int32_t GetSettingInt(PP_Instance instance, PP_FlashSetting setting) { |
137 EnterInstance enter(instance); | 135 // Deprecated. |
138 if (enter.failed()) | 136 NOTREACHED(); |
139 return -1; | 137 return -1; |
140 return enter.functions()->GetFlashAPI()->GetSettingInt(instance, setting); | |
141 } | 138 } |
142 | 139 |
143 PP_Var GetSetting(PP_Instance instance, PP_FlashSetting setting) { | 140 PP_Var GetSetting(PP_Instance instance, PP_FlashSetting setting) { |
144 EnterInstance enter(instance); | 141 EnterInstance enter(instance); |
145 if (enter.failed()) | 142 if (enter.failed()) |
146 return PP_MakeUndefined(); | 143 return PP_MakeUndefined(); |
147 return enter.functions()->GetFlashAPI()->GetSetting(instance, setting); | 144 return enter.functions()->GetFlashAPI()->GetSetting(instance, setting); |
148 } | 145 } |
149 | 146 |
150 PP_Bool SetCrashData(PP_Instance instance, | 147 PP_Bool SetCrashData(PP_Instance instance, |
151 PP_FlashCrashKey key, | 148 PP_FlashCrashKey key, |
152 PP_Var value) { | 149 PP_Var value) { |
153 EnterInstance enter(instance); | 150 EnterInstance enter(instance); |
154 if (enter.failed()) | 151 if (enter.failed()) |
155 return PP_FALSE; | 152 return PP_FALSE; |
156 return enter.functions()->GetFlashAPI()->SetCrashData(instance, key, value); | 153 return enter.functions()->GetFlashAPI()->SetCrashData(instance, key, value); |
157 } | 154 } |
158 | 155 |
159 int32_t EnumerateVideoCaptureDevices(PP_Instance instance, | 156 int32_t EnumerateVideoCaptureDevices(PP_Instance instance, |
160 PP_Resource video_capture, | 157 PP_Resource video_capture, |
161 PP_ArrayOutput devices) { | 158 PP_ArrayOutput devices) { |
162 thunk::EnterResource<thunk::PPB_VideoCapture_API> enter(video_capture, true); | 159 thunk::EnterResource<thunk::PPB_VideoCapture_API> enter(video_capture, true); |
163 if (enter.failed()) | 160 if (enter.failed()) |
164 return enter.retval(); | 161 return enter.retval(); |
165 return enter.object()->EnumerateDevicesSync(devices); | 162 return enter.object()->EnumerateDevicesSync(devices); |
166 } | 163 } |
167 | 164 |
168 const PPB_Flash_12_0 g_ppb_flash_12_0_thunk = { | 165 const PPB_Flash_12_4 g_ppb_flash_12_4_thunk = { |
169 &SetInstanceAlwaysOnTop, | 166 &SetInstanceAlwaysOnTop, |
170 &DrawGlyphs, | 167 &DrawGlyphs, |
171 &GetProxyForURL, | 168 &GetProxyForURL, |
172 &Navigate, | |
173 &RunMessageLoop, | |
174 &QuitMessageLoop, | |
175 &GetLocalTimeZoneOffset, | |
176 &GetCommandLineArgs, | |
177 &PreLoadFontWin | |
178 }; | |
179 | |
180 const PPB_Flash_12_1 g_ppb_flash_12_1_thunk = { | |
181 &SetInstanceAlwaysOnTop, | |
182 &DrawGlyphs, | |
183 &GetProxyForURL, | |
184 &Navigate, | |
185 &RunMessageLoop, | |
186 &QuitMessageLoop, | |
187 &GetLocalTimeZoneOffset, | |
188 &GetCommandLineArgs, | |
189 &PreLoadFontWin, | |
190 &IsRectTopmost, | |
191 &InvokePrinting, | |
192 &UpdateActivity | |
193 }; | |
194 | |
195 const PPB_Flash_12_2 g_ppb_flash_12_2_thunk = { | |
196 &SetInstanceAlwaysOnTop, | |
197 &DrawGlyphs, | |
198 &GetProxyForURL, | |
199 &Navigate, | |
200 &RunMessageLoop, | |
201 &QuitMessageLoop, | |
202 &GetLocalTimeZoneOffset, | |
203 &GetCommandLineArgs, | |
204 &PreLoadFontWin, | |
205 &IsRectTopmost, | |
206 &InvokePrinting, | |
207 &UpdateActivity, | |
208 &GetDeviceID | |
209 }; | |
210 | |
211 const PPB_Flash_12_3 g_ppb_flash_12_3_thunk = { | |
212 &SetInstanceAlwaysOnTop, | |
213 &DrawGlyphs, | |
214 &GetProxyForURL, | |
215 &Navigate, | 169 &Navigate, |
216 &RunMessageLoop, | 170 &RunMessageLoop, |
217 &QuitMessageLoop, | 171 &QuitMessageLoop, |
218 &GetLocalTimeZoneOffset, | 172 &GetLocalTimeZoneOffset, |
219 &GetCommandLineArgs, | 173 &GetCommandLineArgs, |
220 &PreLoadFontWin, | 174 &PreLoadFontWin, |
221 &IsRectTopmost, | 175 &IsRectTopmost, |
222 &InvokePrinting, | 176 &InvokePrinting, |
223 &UpdateActivity, | 177 &UpdateActivity, |
224 &GetDeviceID, | 178 &GetDeviceID, |
225 &GetSettingInt | 179 &GetSettingInt, |
| 180 &GetSetting |
226 }; | 181 }; |
227 | 182 |
228 const PPB_Flash_12_4 g_ppb_flash_12_4_thunk = { | 183 const PPB_Flash_12_5 g_ppb_flash_12_5_thunk = { |
229 &SetInstanceAlwaysOnTop, | 184 &SetInstanceAlwaysOnTop, |
230 &DrawGlyphs, | 185 &DrawGlyphs, |
231 &GetProxyForURL, | 186 &GetProxyForURL, |
232 &Navigate, | 187 &Navigate, |
233 &RunMessageLoop, | 188 &RunMessageLoop, |
234 &QuitMessageLoop, | 189 &QuitMessageLoop, |
235 &GetLocalTimeZoneOffset, | 190 &GetLocalTimeZoneOffset, |
236 &GetCommandLineArgs, | 191 &GetCommandLineArgs, |
237 &PreLoadFontWin, | 192 &PreLoadFontWin, |
238 &IsRectTopmost, | 193 &IsRectTopmost, |
239 &InvokePrinting, | 194 &InvokePrinting, |
240 &UpdateActivity, | 195 &UpdateActivity, |
241 &GetDeviceID, | 196 &GetDeviceID, |
242 &GetSettingInt, | 197 &GetSettingInt, |
243 &GetSetting | 198 &GetSetting, |
| 199 &SetCrashData |
244 }; | 200 }; |
245 | 201 |
246 const PPB_Flash_12_5 g_ppb_flash_12_5_thunk = { | 202 const PPB_Flash_12_6 g_ppb_flash_12_6_thunk = { |
247 &SetInstanceAlwaysOnTop, | 203 &SetInstanceAlwaysOnTop, |
248 &DrawGlyphs, | 204 &DrawGlyphs, |
249 &GetProxyForURL, | 205 &GetProxyForURL, |
250 &Navigate, | 206 &Navigate, |
251 &RunMessageLoop, | 207 &RunMessageLoop, |
252 &QuitMessageLoop, | 208 &QuitMessageLoop, |
253 &GetLocalTimeZoneOffset, | 209 &GetLocalTimeZoneOffset, |
254 &GetCommandLineArgs, | 210 &GetCommandLineArgs, |
255 &PreLoadFontWin, | 211 &PreLoadFontWin, |
256 &IsRectTopmost, | 212 &IsRectTopmost, |
257 &InvokePrinting, | 213 &InvokePrinting, |
258 &UpdateActivity, | 214 &UpdateActivity, |
259 &GetDeviceID, | 215 &GetDeviceID, |
260 &GetSettingInt, | 216 &GetSettingInt, |
261 &GetSetting, | 217 &GetSetting, |
262 &SetCrashData | |
263 }; | |
264 | |
265 const PPB_Flash_12_6 g_ppb_flash_12_6_thunk = { | |
266 &SetInstanceAlwaysOnTop, | |
267 &DrawGlyphs, | |
268 &GetProxyForURL, | |
269 &Navigate, | |
270 &RunMessageLoop, | |
271 &QuitMessageLoop, | |
272 &GetLocalTimeZoneOffset, | |
273 &GetCommandLineArgs, | |
274 &PreLoadFontWin, | |
275 &IsRectTopmost, | |
276 &InvokePrinting, | |
277 &UpdateActivity, | |
278 &GetDeviceID, | |
279 &GetSettingInt, | |
280 &GetSetting, | |
281 &SetCrashData, | 218 &SetCrashData, |
282 &EnumerateVideoCaptureDevices | 219 &EnumerateVideoCaptureDevices |
| 220 }; |
| 221 |
| 222 const PPB_Flash_13_0 g_ppb_flash_13_0_thunk = { |
| 223 &SetInstanceAlwaysOnTop, |
| 224 &DrawGlyphs, |
| 225 &GetProxyForURL, |
| 226 &Navigate, |
| 227 &GetLocalTimeZoneOffset, |
| 228 &GetCommandLineArgs, |
| 229 &PreLoadFontWin, |
| 230 &IsRectTopmost, |
| 231 &UpdateActivity, |
| 232 &GetSetting, |
| 233 &SetCrashData, |
| 234 &EnumerateVideoCaptureDevices |
283 }; | 235 }; |
284 | 236 |
285 } // namespace | 237 } // namespace |
286 | 238 |
287 const PPB_Flash_12_0* GetPPB_Flash_12_0_Thunk() { | |
288 return &g_ppb_flash_12_0_thunk; | |
289 } | |
290 | |
291 const PPB_Flash_12_1* GetPPB_Flash_12_1_Thunk() { | |
292 return &g_ppb_flash_12_1_thunk; | |
293 } | |
294 | |
295 const PPB_Flash_12_2* GetPPB_Flash_12_2_Thunk() { | |
296 return &g_ppb_flash_12_2_thunk; | |
297 } | |
298 | |
299 const PPB_Flash_12_3* GetPPB_Flash_12_3_Thunk() { | |
300 return &g_ppb_flash_12_3_thunk; | |
301 } | |
302 | |
303 const PPB_Flash_12_4* GetPPB_Flash_12_4_Thunk() { | 239 const PPB_Flash_12_4* GetPPB_Flash_12_4_Thunk() { |
304 return &g_ppb_flash_12_4_thunk; | 240 return &g_ppb_flash_12_4_thunk; |
305 } | 241 } |
306 | 242 |
307 const PPB_Flash_12_5* GetPPB_Flash_12_5_Thunk() { | 243 const PPB_Flash_12_5* GetPPB_Flash_12_5_Thunk() { |
308 return &g_ppb_flash_12_5_thunk; | 244 return &g_ppb_flash_12_5_thunk; |
309 } | 245 } |
310 | 246 |
311 const PPB_Flash_12_6* GetPPB_Flash_12_6_Thunk() { | 247 const PPB_Flash_12_6* GetPPB_Flash_12_6_Thunk() { |
312 return &g_ppb_flash_12_6_thunk; | 248 return &g_ppb_flash_12_6_thunk; |
313 } | 249 } |
314 | 250 |
| 251 const PPB_Flash_13_0* GetPPB_Flash_13_0_Thunk() { |
| 252 return &g_ppb_flash_13_0_thunk; |
| 253 } |
| 254 |
315 } // namespace thunk | 255 } // namespace thunk |
316 } // namespace ppapi | 256 } // namespace ppapi |
OLD | NEW |