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 "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 Loading... | |
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 #if !defined(OS_NACL) && !defined(NACL_WIN64) | |
yzshen1
2012/10/09 17:17:47
Please include build/build_config.h
| |
320 InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())-> | |
321 GetInstanceData(instance); | |
322 if (!data) | |
323 return NULL; | |
324 | |
325 if (!data->flash_resource.get()) { | |
326 Connection connection( | |
327 PluginGlobals::Get()->plugin_proxy_delegate()->GetBrowserSender(), | |
328 dispatcher()); | |
329 data->flash_resource = new FlashResource(connection, instance); | |
330 } | |
331 return data->flash_resource.get(); | |
332 #else | |
333 // Flash functions aren't implemented for nacl. | |
334 NOTIMPLEMENTED(); | |
335 return NULL; | |
336 #endif // !defined(OS_NACL) && !defined(NACL_WIN64) | |
337 } | |
338 | |
316 thunk::PPB_Gamepad_API* PPB_Instance_Proxy::GetGamepadAPI( | 339 thunk::PPB_Gamepad_API* PPB_Instance_Proxy::GetGamepadAPI( |
317 PP_Instance instance) { | 340 PP_Instance instance) { |
318 InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())-> | 341 InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())-> |
319 GetInstanceData(instance); | 342 GetInstanceData(instance); |
320 if (!data) | 343 if (!data) |
321 return NULL; | 344 return NULL; |
322 | 345 |
323 if (!data->gamepad_resource.get()) { | 346 if (!data->gamepad_resource.get()) { |
324 Connection connection( | 347 Connection connection( |
325 PluginGlobals::Get()->plugin_proxy_delegate()->GetBrowserSender(), | 348 PluginGlobals::Get()->plugin_proxy_delegate()->GetBrowserSender(), |
(...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1027 PP_Instance instance) { | 1050 PP_Instance instance) { |
1028 InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())-> | 1051 InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())-> |
1029 GetInstanceData(instance); | 1052 GetInstanceData(instance); |
1030 if (!data) | 1053 if (!data) |
1031 return; // Instance was probably deleted. | 1054 return; // Instance was probably deleted. |
1032 data->should_do_request_surrounding_text = false; | 1055 data->should_do_request_surrounding_text = false; |
1033 } | 1056 } |
1034 | 1057 |
1035 } // namespace proxy | 1058 } // namespace proxy |
1036 } // namespace ppapi | 1059 } // namespace ppapi |
OLD | NEW |