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/proxy/ppb_instance_proxy.h" | 5 #include "ppapi/proxy/ppb_instance_proxy.h" |
6 | 6 |
| 7 #include "build/build_config.h" |
7 #include "ppapi/c/pp_errors.h" | 8 #include "ppapi/c/pp_errors.h" |
8 #include "ppapi/c/pp_time.h" | 9 #include "ppapi/c/pp_time.h" |
9 #include "ppapi/c/pp_var.h" | 10 #include "ppapi/c/pp_var.h" |
10 #include "ppapi/c/ppb_audio_config.h" | 11 #include "ppapi/c/ppb_audio_config.h" |
11 #include "ppapi/c/ppb_instance.h" | 12 #include "ppapi/c/ppb_instance.h" |
12 #include "ppapi/c/ppb_messaging.h" | 13 #include "ppapi/c/ppb_messaging.h" |
13 #include "ppapi/c/ppb_mouse_lock.h" | 14 #include "ppapi/c/ppb_mouse_lock.h" |
14 #include "ppapi/c/private/pp_content_decryptor.h" | 15 #include "ppapi/c/private/pp_content_decryptor.h" |
15 #include "ppapi/proxy/content_decryptor_private_serializer.h" | 16 #include "ppapi/proxy/content_decryptor_private_serializer.h" |
16 #include "ppapi/proxy/enter_proxy.h" | 17 #include "ppapi/proxy/enter_proxy.h" |
| 18 #include "ppapi/proxy/flash_resource.h" |
17 #include "ppapi/proxy/gamepad_resource.h" | 19 #include "ppapi/proxy/gamepad_resource.h" |
18 #include "ppapi/proxy/host_dispatcher.h" | 20 #include "ppapi/proxy/host_dispatcher.h" |
19 #include "ppapi/proxy/plugin_dispatcher.h" | 21 #include "ppapi/proxy/plugin_dispatcher.h" |
20 #include "ppapi/proxy/plugin_proxy_delegate.h" | 22 #include "ppapi/proxy/plugin_proxy_delegate.h" |
21 #include "ppapi/proxy/ppapi_messages.h" | 23 #include "ppapi/proxy/ppapi_messages.h" |
22 #include "ppapi/proxy/ppb_flash_proxy.h" | 24 #include "ppapi/proxy/ppb_flash_proxy.h" |
23 #include "ppapi/proxy/serialized_var.h" | 25 #include "ppapi/proxy/serialized_var.h" |
24 #include "ppapi/shared_impl/ppapi_globals.h" | 26 #include "ppapi/shared_impl/ppapi_globals.h" |
25 #include "ppapi/shared_impl/ppb_url_util_shared.h" | 27 #include "ppapi/shared_impl/ppb_url_util_shared.h" |
26 #include "ppapi/shared_impl/ppb_view_shared.h" | 28 #include "ppapi/shared_impl/ppb_view_shared.h" |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 dispatcher()->Send(new PpapiHostMsg_PPBInstance_GetScreenSize( | 308 dispatcher()->Send(new PpapiHostMsg_PPBInstance_GetScreenSize( |
307 API_ID_PPB_INSTANCE, instance, &result, size)); | 309 API_ID_PPB_INSTANCE, instance, &result, size)); |
308 return result; | 310 return result; |
309 } | 311 } |
310 | 312 |
311 thunk::PPB_Flash_API* PPB_Instance_Proxy::GetFlashAPI() { | 313 thunk::PPB_Flash_API* PPB_Instance_Proxy::GetFlashAPI() { |
312 InterfaceProxy* ip = dispatcher()->GetInterfaceProxy(API_ID_PPB_FLASH); | 314 InterfaceProxy* ip = dispatcher()->GetInterfaceProxy(API_ID_PPB_FLASH); |
313 return static_cast<PPB_Flash_Proxy*>(ip); | 315 return static_cast<PPB_Flash_Proxy*>(ip); |
314 } | 316 } |
315 | 317 |
| 318 thunk::PPB_Flash_Functions_API* PPB_Instance_Proxy::GetFlashFunctionsAPI( |
| 319 PP_Instance instance) { |
| 320 #if !defined(OS_NACL) && !defined(NACL_WIN64) |
| 321 InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())-> |
| 322 GetInstanceData(instance); |
| 323 if (!data) |
| 324 return NULL; |
| 325 |
| 326 if (!data->flash_resource.get()) { |
| 327 Connection connection( |
| 328 PluginGlobals::Get()->plugin_proxy_delegate()->GetBrowserSender(), |
| 329 dispatcher()); |
| 330 data->flash_resource = new FlashResource(connection, instance); |
| 331 } |
| 332 return data->flash_resource.get(); |
| 333 #else |
| 334 // Flash functions aren't implemented for nacl. |
| 335 NOTIMPLEMENTED(); |
| 336 return NULL; |
| 337 #endif // !defined(OS_NACL) && !defined(NACL_WIN64) |
| 338 } |
| 339 |
316 thunk::PPB_Gamepad_API* PPB_Instance_Proxy::GetGamepadAPI( | 340 thunk::PPB_Gamepad_API* PPB_Instance_Proxy::GetGamepadAPI( |
317 PP_Instance instance) { | 341 PP_Instance instance) { |
318 InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())-> | 342 InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())-> |
319 GetInstanceData(instance); | 343 GetInstanceData(instance); |
320 if (!data) | 344 if (!data) |
321 return NULL; | 345 return NULL; |
322 | 346 |
323 if (!data->gamepad_resource.get()) { | 347 if (!data->gamepad_resource.get()) { |
324 Connection connection( | 348 Connection connection( |
325 PluginGlobals::Get()->plugin_proxy_delegate()->GetBrowserSender(), | 349 PluginGlobals::Get()->plugin_proxy_delegate()->GetBrowserSender(), |
(...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1027 PP_Instance instance) { | 1051 PP_Instance instance) { |
1028 InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())-> | 1052 InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())-> |
1029 GetInstanceData(instance); | 1053 GetInstanceData(instance); |
1030 if (!data) | 1054 if (!data) |
1031 return; // Instance was probably deleted. | 1055 return; // Instance was probably deleted. |
1032 data->should_do_request_surrounding_text = false; | 1056 data->should_do_request_surrounding_text = false; |
1033 } | 1057 } |
1034 | 1058 |
1035 } // namespace proxy | 1059 } // namespace proxy |
1036 } // namespace ppapi | 1060 } // namespace ppapi |
OLD | NEW |