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