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 "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 #include "ppapi/c/pp_errors.h" | 9 #include "ppapi/c/pp_errors.h" |
10 #include "ppapi/c/pp_time.h" | 10 #include "ppapi/c/pp_time.h" |
11 #include "ppapi/c/pp_var.h" | 11 #include "ppapi/c/pp_var.h" |
12 #include "ppapi/c/ppb_audio_config.h" | 12 #include "ppapi/c/ppb_audio_config.h" |
13 #include "ppapi/c/ppb_instance.h" | 13 #include "ppapi/c/ppb_instance.h" |
14 #include "ppapi/c/ppb_messaging.h" | 14 #include "ppapi/c/ppb_messaging.h" |
15 #include "ppapi/c/ppb_mouse_lock.h" | 15 #include "ppapi/c/ppb_mouse_lock.h" |
16 #include "ppapi/c/private/pp_content_decryptor.h" | 16 #include "ppapi/c/private/pp_content_decryptor.h" |
17 #include "ppapi/proxy/broker_resource.h" | 17 #include "ppapi/proxy/broker_resource.h" |
18 #include "ppapi/proxy/browser_font_singleton_resource.h" | 18 #include "ppapi/proxy/browser_font_singleton_resource.h" |
19 #include "ppapi/proxy/content_decryptor_private_serializer.h" | 19 #include "ppapi/proxy/content_decryptor_private_serializer.h" |
20 #include "ppapi/proxy/enter_proxy.h" | 20 #include "ppapi/proxy/enter_proxy.h" |
21 #include "ppapi/proxy/flash_clipboard_resource.h" | 21 #include "ppapi/proxy/flash_clipboard_resource.h" |
22 #include "ppapi/proxy/flash_file_resource.h" | 22 #include "ppapi/proxy/flash_file_resource.h" |
23 #include "ppapi/proxy/flash_fullscreen_resource.h" | 23 #include "ppapi/proxy/flash_fullscreen_resource.h" |
24 #include "ppapi/proxy/flash_resource.h" | 24 #include "ppapi/proxy/flash_resource.h" |
25 #include "ppapi/proxy/gamepad_resource.h" | 25 #include "ppapi/proxy/gamepad_resource.h" |
26 #include "ppapi/proxy/host_dispatcher.h" | 26 #include "ppapi/proxy/host_dispatcher.h" |
27 #include "ppapi/proxy/plugin_dispatcher.h" | 27 #include "ppapi/proxy/plugin_dispatcher.h" |
28 #include "ppapi/proxy/ppapi_messages.h" | 28 #include "ppapi/proxy/ppapi_messages.h" |
29 #include "ppapi/proxy/ppb_flash_proxy.h" | |
30 #include "ppapi/proxy/serialized_var.h" | 29 #include "ppapi/proxy/serialized_var.h" |
31 #include "ppapi/shared_impl/ppapi_globals.h" | 30 #include "ppapi/shared_impl/ppapi_globals.h" |
32 #include "ppapi/shared_impl/ppb_url_util_shared.h" | 31 #include "ppapi/shared_impl/ppb_url_util_shared.h" |
33 #include "ppapi/shared_impl/ppb_view_shared.h" | 32 #include "ppapi/shared_impl/ppb_view_shared.h" |
34 #include "ppapi/shared_impl/var.h" | 33 #include "ppapi/shared_impl/var.h" |
35 #include "ppapi/thunk/enter.h" | 34 #include "ppapi/thunk/enter.h" |
36 #include "ppapi/thunk/ppb_graphics_2d_api.h" | 35 #include "ppapi/thunk/ppb_graphics_2d_api.h" |
37 #include "ppapi/thunk/ppb_graphics_3d_api.h" | 36 #include "ppapi/thunk/ppb_graphics_3d_api.h" |
38 #include "ppapi/thunk/thunk.h" | 37 #include "ppapi/thunk/thunk.h" |
39 | 38 |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 } | 332 } |
334 | 333 |
335 PP_Bool PPB_Instance_Proxy::GetScreenSize(PP_Instance instance, | 334 PP_Bool PPB_Instance_Proxy::GetScreenSize(PP_Instance instance, |
336 PP_Size* size) { | 335 PP_Size* size) { |
337 PP_Bool result = PP_FALSE; | 336 PP_Bool result = PP_FALSE; |
338 dispatcher()->Send(new PpapiHostMsg_PPBInstance_GetScreenSize( | 337 dispatcher()->Send(new PpapiHostMsg_PPBInstance_GetScreenSize( |
339 API_ID_PPB_INSTANCE, instance, &result, size)); | 338 API_ID_PPB_INSTANCE, instance, &result, size)); |
340 return result; | 339 return result; |
341 } | 340 } |
342 | 341 |
343 thunk::PPB_Flash_API* PPB_Instance_Proxy::GetFlashAPI() { | |
344 InterfaceProxy* ip = dispatcher()->GetInterfaceProxy(API_ID_PPB_FLASH); | |
345 return static_cast<PPB_Flash_Proxy*>(ip); | |
346 } | |
347 | |
348 Resource* PPB_Instance_Proxy::GetSingletonResource(PP_Instance instance, | 342 Resource* PPB_Instance_Proxy::GetSingletonResource(PP_Instance instance, |
349 SingletonResourceID id) { | 343 SingletonResourceID id) { |
350 InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())-> | 344 InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())-> |
351 GetInstanceData(instance); | 345 GetInstanceData(instance); |
352 | 346 |
353 InstanceData::SingletonResourceMap::iterator it = | 347 InstanceData::SingletonResourceMap::iterator it = |
354 data->singleton_resources.find(id); | 348 data->singleton_resources.find(id); |
355 if (it != data->singleton_resources.end()) | 349 if (it != data->singleton_resources.end()) |
356 return it->second.get(); | 350 return it->second.get(); |
357 | 351 |
(...skipping 887 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1245 PP_Instance instance) { | 1239 PP_Instance instance) { |
1246 InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())-> | 1240 InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())-> |
1247 GetInstanceData(instance); | 1241 GetInstanceData(instance); |
1248 if (!data) | 1242 if (!data) |
1249 return; // Instance was probably deleted. | 1243 return; // Instance was probably deleted. |
1250 data->should_do_request_surrounding_text = false; | 1244 data->should_do_request_surrounding_text = false; |
1251 } | 1245 } |
1252 | 1246 |
1253 } // namespace proxy | 1247 } // namespace proxy |
1254 } // namespace ppapi | 1248 } // namespace ppapi |
OLD | NEW |