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

Side by Side Diff: ppapi/proxy/ppb_instance_proxy.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
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/proxy/ppb_instance_proxy.h" 5 #include "ppapi/proxy/ppb_instance_proxy.h"
6 6
7 #include "ppapi/c/pp_errors.h" 7 #include "ppapi/c/pp_errors.h"
8 #include "ppapi/c/pp_time.h" 8 #include "ppapi/c/pp_time.h"
9 #include "ppapi/c/pp_var.h" 9 #include "ppapi/c/pp_var.h"
10 #include "ppapi/c/ppb_audio_config.h" 10 #include "ppapi/c/ppb_audio_config.h"
11 #include "ppapi/c/ppb_instance.h" 11 #include "ppapi/c/ppb_instance.h"
12 #include "ppapi/c/ppb_messaging.h" 12 #include "ppapi/c/ppb_messaging.h"
13 #include "ppapi/c/ppb_mouse_lock.h" 13 #include "ppapi/c/ppb_mouse_lock.h"
14 #include "ppapi/c/private/pp_content_decryptor.h" 14 #include "ppapi/c/private/pp_content_decryptor.h"
15 #include "ppapi/proxy/content_decryptor_private_serializer.h" 15 #include "ppapi/proxy/content_decryptor_private_serializer.h"
16 #include "ppapi/proxy/enter_proxy.h" 16 #include "ppapi/proxy/enter_proxy.h"
17 #include "ppapi/proxy/flash_resource.h"
17 #include "ppapi/proxy/gamepad_resource.h" 18 #include "ppapi/proxy/gamepad_resource.h"
18 #include "ppapi/proxy/host_dispatcher.h" 19 #include "ppapi/proxy/host_dispatcher.h"
19 #include "ppapi/proxy/plugin_dispatcher.h" 20 #include "ppapi/proxy/plugin_dispatcher.h"
20 #include "ppapi/proxy/plugin_proxy_delegate.h" 21 #include "ppapi/proxy/plugin_proxy_delegate.h"
21 #include "ppapi/proxy/ppapi_messages.h" 22 #include "ppapi/proxy/ppapi_messages.h"
22 #include "ppapi/proxy/ppb_flash_proxy.h" 23 #include "ppapi/proxy/ppb_flash_proxy.h"
23 #include "ppapi/proxy/serialized_var.h" 24 #include "ppapi/proxy/serialized_var.h"
24 #include "ppapi/shared_impl/ppapi_globals.h" 25 #include "ppapi/shared_impl/ppapi_globals.h"
25 #include "ppapi/shared_impl/ppb_url_util_shared.h" 26 #include "ppapi/shared_impl/ppb_url_util_shared.h"
26 #include "ppapi/shared_impl/ppb_view_shared.h" 27 #include "ppapi/shared_impl/ppb_view_shared.h"
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 dispatcher()->Send(new PpapiHostMsg_PPBInstance_GetScreenSize( 307 dispatcher()->Send(new PpapiHostMsg_PPBInstance_GetScreenSize(
307 API_ID_PPB_INSTANCE, instance, &result, size)); 308 API_ID_PPB_INSTANCE, instance, &result, size));
308 return result; 309 return result;
309 } 310 }
310 311
311 thunk::PPB_Flash_API* PPB_Instance_Proxy::GetFlashAPI() { 312 thunk::PPB_Flash_API* PPB_Instance_Proxy::GetFlashAPI() {
312 InterfaceProxy* ip = dispatcher()->GetInterfaceProxy(API_ID_PPB_FLASH); 313 InterfaceProxy* ip = dispatcher()->GetInterfaceProxy(API_ID_PPB_FLASH);
313 return static_cast<PPB_Flash_Proxy*>(ip); 314 return static_cast<PPB_Flash_Proxy*>(ip);
314 } 315 }
315 316
317 thunk::PPB_Flash_Functions_API* PPB_Instance_Proxy::GetFlashFunctionsAPI(
318 PP_Instance instance) {
319 InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())->
320 GetInstanceData(instance);
321 if (!data)
322 return NULL;
323
324 if (!data->flash_resource.get()) {
325 Connection connection(
326 PluginGlobals::Get()->plugin_proxy_delegate()->GetBrowserSender(),
327 dispatcher());
328 data->flash_resource = new FlashResource(connection, instance);
329 }
330 return data->flash_resource.get();
331 }
332
316 thunk::PPB_Gamepad_API* PPB_Instance_Proxy::GetGamepadAPI( 333 thunk::PPB_Gamepad_API* PPB_Instance_Proxy::GetGamepadAPI(
317 PP_Instance instance) { 334 PP_Instance instance) {
318 InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())-> 335 InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())->
319 GetInstanceData(instance); 336 GetInstanceData(instance);
320 if (!data) 337 if (!data)
321 return NULL; 338 return NULL;
322 339
323 if (!data->gamepad_resource.get()) { 340 if (!data->gamepad_resource.get()) {
324 Connection connection( 341 Connection connection(
325 PluginGlobals::Get()->plugin_proxy_delegate()->GetBrowserSender(), 342 PluginGlobals::Get()->plugin_proxy_delegate()->GetBrowserSender(),
(...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after
1027 PP_Instance instance) { 1044 PP_Instance instance) {
1028 InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())-> 1045 InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())->
1029 GetInstanceData(instance); 1046 GetInstanceData(instance);
1030 if (!data) 1047 if (!data)
1031 return; // Instance was probably deleted. 1048 return; // Instance was probably deleted.
1032 data->should_do_request_surrounding_text = false; 1049 data->should_do_request_surrounding_text = false;
1033 } 1050 }
1034 1051
1035 } // namespace proxy 1052 } // namespace proxy
1036 } // namespace ppapi 1053 } // namespace ppapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698