Chromium Code Reviews| 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_errors.h" | 5 #include "ppapi/c/pp_errors.h" |
| 6 #include "ppapi/c/private/ppb_flash.h" | 6 #include "ppapi/c/private/ppb_flash.h" |
| 7 #include "ppapi/shared_impl/ppapi_globals.h" | 7 #include "ppapi/shared_impl/ppapi_globals.h" |
| 8 #include "ppapi/shared_impl/proxy_lock.h" | 8 #include "ppapi/shared_impl/proxy_lock.h" |
| 9 #include "ppapi/shared_impl/var.h" | 9 #include "ppapi/shared_impl/var.h" |
| 10 #include "ppapi/thunk/enter.h" | 10 #include "ppapi/thunk/enter.h" |
| 11 #include "ppapi/thunk/ppb_flash_api.h" | 11 #include "ppapi/thunk/ppb_flash_api.h" |
| 12 #include "ppapi/thunk/ppb_flash_functions_api.h" | |
| 12 #include "ppapi/thunk/ppb_instance_api.h" | 13 #include "ppapi/thunk/ppb_instance_api.h" |
| 13 #include "ppapi/thunk/thunk.h" | 14 #include "ppapi/thunk/thunk.h" |
| 14 | 15 |
| 16 struct PP_ArrayOutput; | |
|
yzshen1
2012/10/05 18:16:46
If the includes above doesn't have a definition of
raymes
2012/10/08 17:08:50
Done.
| |
| 17 | |
| 15 namespace ppapi { | 18 namespace ppapi { |
| 16 namespace thunk { | 19 namespace thunk { |
| 17 | 20 |
| 18 namespace { | 21 namespace { |
| 19 | 22 |
| 20 void SetInstanceAlwaysOnTop(PP_Instance instance, PP_Bool on_top) { | 23 void SetInstanceAlwaysOnTop(PP_Instance instance, PP_Bool on_top) { |
| 21 EnterInstance enter(instance); | 24 EnterInstance enter(instance); |
| 22 if (enter.failed()) | 25 if (enter.failed()) |
| 23 return; | 26 return; |
| 24 enter.functions()->GetFlashAPI()->SetInstanceAlwaysOnTop(instance, on_top); | 27 enter.functions()->GetFlashAPI()->SetInstanceAlwaysOnTop(instance, on_top); |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 146 | 149 |
| 147 PP_Bool SetCrashData(PP_Instance instance, | 150 PP_Bool SetCrashData(PP_Instance instance, |
| 148 PP_FlashCrashKey key, | 151 PP_FlashCrashKey key, |
| 149 PP_Var value) { | 152 PP_Var value) { |
| 150 EnterInstance enter(instance); | 153 EnterInstance enter(instance); |
| 151 if (enter.failed()) | 154 if (enter.failed()) |
| 152 return PP_FALSE; | 155 return PP_FALSE; |
| 153 return enter.functions()->GetFlashAPI()->SetCrashData(instance, key, value); | 156 return enter.functions()->GetFlashAPI()->SetCrashData(instance, key, value); |
| 154 } | 157 } |
| 155 | 158 |
| 159 int32_t EnumerateVideoDevicesSync(PP_Instance instance, | |
| 160 PP_Resource video_capture, | |
| 161 PP_ArrayOutput devices) { | |
| 162 EnterInstance enter(instance); | |
| 163 if (enter.succeeded()) { | |
| 164 PPB_Flash_Functions_API* api = | |
| 165 enter.functions()->GetFlashFunctionsAPI(instance); | |
| 166 if (api) { | |
| 167 return api->EnumerateVideoDevicesSync(instance, video_capture, | |
| 168 devices); | |
| 169 } else { | |
| 170 return PP_ERROR_NOINTERFACE; | |
| 171 } | |
| 172 } | |
| 173 return PP_ERROR_BADRESOURCE; | |
|
yzshen1
2012/10/05 18:16:46
The comment of this new method doesn't mentioned a
raymes
2012/10/08 17:08:50
Done.
| |
| 174 } | |
| 175 | |
| 156 const PPB_Flash_12_0 g_ppb_flash_12_0_thunk = { | 176 const PPB_Flash_12_0 g_ppb_flash_12_0_thunk = { |
| 157 &SetInstanceAlwaysOnTop, | 177 &SetInstanceAlwaysOnTop, |
| 158 &DrawGlyphs, | 178 &DrawGlyphs, |
| 159 &GetProxyForURL, | 179 &GetProxyForURL, |
| 160 &Navigate, | 180 &Navigate, |
| 161 &RunMessageLoop, | 181 &RunMessageLoop, |
| 162 &QuitMessageLoop, | 182 &QuitMessageLoop, |
| 163 &GetLocalTimeZoneOffset, | 183 &GetLocalTimeZoneOffset, |
| 164 &GetCommandLineArgs, | 184 &GetCommandLineArgs, |
| 165 &PreLoadFontWin | 185 &PreLoadFontWin |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 243 &PreLoadFontWin, | 263 &PreLoadFontWin, |
| 244 &IsRectTopmost, | 264 &IsRectTopmost, |
| 245 &InvokePrinting, | 265 &InvokePrinting, |
| 246 &UpdateActivity, | 266 &UpdateActivity, |
| 247 &GetDeviceID, | 267 &GetDeviceID, |
| 248 &GetSettingInt, | 268 &GetSettingInt, |
| 249 &GetSetting, | 269 &GetSetting, |
| 250 &SetCrashData | 270 &SetCrashData |
| 251 }; | 271 }; |
| 252 | 272 |
| 273 const PPB_Flash_12_6 g_ppb_flash_12_6_thunk = { | |
| 274 &SetInstanceAlwaysOnTop, | |
| 275 &DrawGlyphs, | |
| 276 &GetProxyForURL, | |
| 277 &Navigate, | |
| 278 &RunMessageLoop, | |
| 279 &QuitMessageLoop, | |
| 280 &GetLocalTimeZoneOffset, | |
| 281 &GetCommandLineArgs, | |
| 282 &PreLoadFontWin, | |
| 283 &IsRectTopmost, | |
| 284 &InvokePrinting, | |
| 285 &UpdateActivity, | |
| 286 &GetDeviceID, | |
| 287 &GetSettingInt, | |
| 288 &GetSetting, | |
| 289 &SetCrashData, | |
| 290 &EnumerateVideoDevicesSync | |
| 291 }; | |
| 292 | |
| 253 } // namespace | 293 } // namespace |
| 254 | 294 |
| 255 const PPB_Flash_12_0* GetPPB_Flash_12_0_Thunk() { | 295 const PPB_Flash_12_0* GetPPB_Flash_12_0_Thunk() { |
| 256 return &g_ppb_flash_12_0_thunk; | 296 return &g_ppb_flash_12_0_thunk; |
| 257 } | 297 } |
| 258 | 298 |
| 259 const PPB_Flash_12_1* GetPPB_Flash_12_1_Thunk() { | 299 const PPB_Flash_12_1* GetPPB_Flash_12_1_Thunk() { |
| 260 return &g_ppb_flash_12_1_thunk; | 300 return &g_ppb_flash_12_1_thunk; |
| 261 } | 301 } |
| 262 | 302 |
| 263 const PPB_Flash_12_2* GetPPB_Flash_12_2_Thunk() { | 303 const PPB_Flash_12_2* GetPPB_Flash_12_2_Thunk() { |
| 264 return &g_ppb_flash_12_2_thunk; | 304 return &g_ppb_flash_12_2_thunk; |
| 265 } | 305 } |
| 266 | 306 |
| 267 const PPB_Flash_12_3* GetPPB_Flash_12_3_Thunk() { | 307 const PPB_Flash_12_3* GetPPB_Flash_12_3_Thunk() { |
| 268 return &g_ppb_flash_12_3_thunk; | 308 return &g_ppb_flash_12_3_thunk; |
| 269 } | 309 } |
| 270 | 310 |
| 271 const PPB_Flash_12_4* GetPPB_Flash_12_4_Thunk() { | 311 const PPB_Flash_12_4* GetPPB_Flash_12_4_Thunk() { |
| 272 return &g_ppb_flash_12_4_thunk; | 312 return &g_ppb_flash_12_4_thunk; |
| 273 } | 313 } |
| 274 | 314 |
| 275 const PPB_Flash_12_5* GetPPB_Flash_12_5_Thunk() { | 315 const PPB_Flash_12_5* GetPPB_Flash_12_5_Thunk() { |
| 276 return &g_ppb_flash_12_5_thunk; | 316 return &g_ppb_flash_12_5_thunk; |
| 277 } | 317 } |
| 278 | 318 |
| 319 const PPB_Flash_12_6* GetPPB_Flash_12_6_Thunk() { | |
| 320 return &g_ppb_flash_12_6_thunk; | |
| 321 } | |
| 322 | |
| 279 } // namespace thunk | 323 } // namespace thunk |
| 280 } // namespace ppapi | 324 } // namespace ppapi |
| OLD | NEW |