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

Side by Side Diff: ppapi/thunk/ppb_flash_thunk.cc

Issue 11039012: Implement plugin side of sync EnumerateVideoCaptureDevices (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 2 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
« no previous file with comments | « ppapi/thunk/ppb_flash_functions_api.h ('k') | ppapi/thunk/ppb_instance_api.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_errors.h" 6 #include "ppapi/c/pp_errors.h"
6 #include "ppapi/c/private/ppb_flash.h" 7 #include "ppapi/c/private/ppb_flash.h"
7 #include "ppapi/shared_impl/ppapi_globals.h" 8 #include "ppapi/shared_impl/ppapi_globals.h"
8 #include "ppapi/shared_impl/proxy_lock.h" 9 #include "ppapi/shared_impl/proxy_lock.h"
9 #include "ppapi/shared_impl/var.h" 10 #include "ppapi/shared_impl/var.h"
10 #include "ppapi/thunk/enter.h" 11 #include "ppapi/thunk/enter.h"
11 #include "ppapi/thunk/ppb_flash_api.h" 12 #include "ppapi/thunk/ppb_flash_api.h"
13 #include "ppapi/thunk/ppb_flash_functions_api.h"
12 #include "ppapi/thunk/ppb_instance_api.h" 14 #include "ppapi/thunk/ppb_instance_api.h"
13 #include "ppapi/thunk/thunk.h" 15 #include "ppapi/thunk/thunk.h"
14 16
15 namespace ppapi { 17 namespace ppapi {
16 namespace thunk { 18 namespace thunk {
17 19
18 namespace { 20 namespace {
19 21
20 void SetInstanceAlwaysOnTop(PP_Instance instance, PP_Bool on_top) { 22 void SetInstanceAlwaysOnTop(PP_Instance instance, PP_Bool on_top) {
21 EnterInstance enter(instance); 23 EnterInstance enter(instance);
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 148
147 PP_Bool SetCrashData(PP_Instance instance, 149 PP_Bool SetCrashData(PP_Instance instance,
148 PP_FlashCrashKey key, 150 PP_FlashCrashKey key,
149 PP_Var value) { 151 PP_Var value) {
150 EnterInstance enter(instance); 152 EnterInstance enter(instance);
151 if (enter.failed()) 153 if (enter.failed())
152 return PP_FALSE; 154 return PP_FALSE;
153 return enter.functions()->GetFlashAPI()->SetCrashData(instance, key, value); 155 return enter.functions()->GetFlashAPI()->SetCrashData(instance, key, value);
154 } 156 }
155 157
158 int32_t EnumerateVideoCaptureDevices(PP_Instance instance,
159 PP_Resource video_capture,
160 PP_ArrayOutput devices) {
161 EnterInstance enter(instance);
162 if (enter.succeeded()) {
163 PPB_Flash_Functions_API* api =
164 enter.functions()->GetFlashFunctionsAPI(instance);
165 if (api) {
166 return api->EnumerateVideoCaptureDevices(instance, video_capture,
167 devices);
168 } else {
169 return PP_ERROR_NOINTERFACE;
170 }
171 }
172 return PP_ERROR_BADRESOURCE;
173 }
174
156 const PPB_Flash_12_0 g_ppb_flash_12_0_thunk = { 175 const PPB_Flash_12_0 g_ppb_flash_12_0_thunk = {
157 &SetInstanceAlwaysOnTop, 176 &SetInstanceAlwaysOnTop,
158 &DrawGlyphs, 177 &DrawGlyphs,
159 &GetProxyForURL, 178 &GetProxyForURL,
160 &Navigate, 179 &Navigate,
161 &RunMessageLoop, 180 &RunMessageLoop,
162 &QuitMessageLoop, 181 &QuitMessageLoop,
163 &GetLocalTimeZoneOffset, 182 &GetLocalTimeZoneOffset,
164 &GetCommandLineArgs, 183 &GetCommandLineArgs,
165 &PreLoadFontWin 184 &PreLoadFontWin
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 &PreLoadFontWin, 262 &PreLoadFontWin,
244 &IsRectTopmost, 263 &IsRectTopmost,
245 &InvokePrinting, 264 &InvokePrinting,
246 &UpdateActivity, 265 &UpdateActivity,
247 &GetDeviceID, 266 &GetDeviceID,
248 &GetSettingInt, 267 &GetSettingInt,
249 &GetSetting, 268 &GetSetting,
250 &SetCrashData 269 &SetCrashData
251 }; 270 };
252 271
272 const PPB_Flash_12_6 g_ppb_flash_12_6_thunk = {
273 &SetInstanceAlwaysOnTop,
274 &DrawGlyphs,
275 &GetProxyForURL,
276 &Navigate,
277 &RunMessageLoop,
278 &QuitMessageLoop,
279 &GetLocalTimeZoneOffset,
280 &GetCommandLineArgs,
281 &PreLoadFontWin,
282 &IsRectTopmost,
283 &InvokePrinting,
284 &UpdateActivity,
285 &GetDeviceID,
286 &GetSettingInt,
287 &GetSetting,
288 &SetCrashData,
289 &EnumerateVideoCaptureDevices
290 };
291
253 } // namespace 292 } // namespace
254 293
255 const PPB_Flash_12_0* GetPPB_Flash_12_0_Thunk() { 294 const PPB_Flash_12_0* GetPPB_Flash_12_0_Thunk() {
256 return &g_ppb_flash_12_0_thunk; 295 return &g_ppb_flash_12_0_thunk;
257 } 296 }
258 297
259 const PPB_Flash_12_1* GetPPB_Flash_12_1_Thunk() { 298 const PPB_Flash_12_1* GetPPB_Flash_12_1_Thunk() {
260 return &g_ppb_flash_12_1_thunk; 299 return &g_ppb_flash_12_1_thunk;
261 } 300 }
262 301
263 const PPB_Flash_12_2* GetPPB_Flash_12_2_Thunk() { 302 const PPB_Flash_12_2* GetPPB_Flash_12_2_Thunk() {
264 return &g_ppb_flash_12_2_thunk; 303 return &g_ppb_flash_12_2_thunk;
265 } 304 }
266 305
267 const PPB_Flash_12_3* GetPPB_Flash_12_3_Thunk() { 306 const PPB_Flash_12_3* GetPPB_Flash_12_3_Thunk() {
268 return &g_ppb_flash_12_3_thunk; 307 return &g_ppb_flash_12_3_thunk;
269 } 308 }
270 309
271 const PPB_Flash_12_4* GetPPB_Flash_12_4_Thunk() { 310 const PPB_Flash_12_4* GetPPB_Flash_12_4_Thunk() {
272 return &g_ppb_flash_12_4_thunk; 311 return &g_ppb_flash_12_4_thunk;
273 } 312 }
274 313
275 const PPB_Flash_12_5* GetPPB_Flash_12_5_Thunk() { 314 const PPB_Flash_12_5* GetPPB_Flash_12_5_Thunk() {
276 return &g_ppb_flash_12_5_thunk; 315 return &g_ppb_flash_12_5_thunk;
277 } 316 }
278 317
318 const PPB_Flash_12_6* GetPPB_Flash_12_6_Thunk() {
319 return &g_ppb_flash_12_6_thunk;
320 }
321
279 } // namespace thunk 322 } // namespace thunk
280 } // namespace ppapi 323 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/thunk/ppb_flash_functions_api.h ('k') | ppapi/thunk/ppb_instance_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698