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 // Implements the untrusted side of the PPB_GetInterface method. | 5 // Implements the untrusted side of the PPB_GetInterface method. |
6 | 6 |
7 #include "native_client/src/shared/ppapi_proxy/plugin_globals.h" | 7 #include "native_client/src/shared/ppapi_proxy/plugin_globals.h" |
8 #include <stdlib.h> | 8 #include <stdlib.h> |
9 #include <string.h> | 9 #include <string.h> |
10 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_audio.h" | 10 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_audio.h" |
11 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_audio_config.h" | 11 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_audio_config.h" |
12 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_buffer.h" | 12 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_buffer.h" |
13 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_core.h" | 13 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_core.h" |
14 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_cursor_control.h" | |
15 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_file_io.h" | 14 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_file_io.h" |
16 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_file_ref.h" | 15 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_file_ref.h" |
17 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_file_system.h" | 16 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_file_system.h" |
18 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_find.h" | 17 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_find.h" |
19 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_font.h" | 18 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_font.h" |
20 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_fullscreen.h" | 19 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_fullscreen.h" |
21 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_gamepad.h" | 20 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_gamepad.h" |
22 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_graphics_2d.h" | 21 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_graphics_2d.h" |
23 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_graphics_3d.h" | 22 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_graphics_3d.h" |
24 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_host_resolver_private.
h" | 23 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_host_resolver_private.
h" |
25 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_image_data.h" | 24 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_image_data.h" |
26 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_input_event.h" | 25 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_input_event.h" |
27 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_instance.h" | 26 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_instance.h" |
28 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_memory.h" | 27 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_memory.h" |
29 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_messaging.h" | 28 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_messaging.h" |
| 29 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_mouse_cursor.h" |
30 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_mouse_lock.h" | 30 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_mouse_lock.h" |
31 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_net_address_private.h" | 31 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_net_address_private.h" |
32 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_pdf.h" | 32 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_pdf.h" |
33 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_scrollbar.h" | 33 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_scrollbar.h" |
34 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_tcp_server_socket_priv
ate.h" | 34 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_tcp_server_socket_priv
ate.h" |
35 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_tcp_socket_private.h" | 35 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_tcp_socket_private.h" |
36 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_testing.h" | 36 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_testing.h" |
37 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_udp_socket_private.h" | 37 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_udp_socket_private.h" |
38 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_url_loader.h" | 38 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_url_loader.h" |
39 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_url_request_info.h" | 39 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_url_request_info.h" |
(...skipping 16 matching lines...) Expand all Loading... |
56 bool needs_browser_check; | 56 bool needs_browser_check; |
57 }; | 57 }; |
58 | 58 |
59 // List of interfaces that have at least partial proxy support. | 59 // List of interfaces that have at least partial proxy support. |
60 InterfaceMapElement interface_map[] = { | 60 InterfaceMapElement interface_map[] = { |
61 { PPB_AUDIO_INTERFACE, PluginAudio::GetInterface(), true }, | 61 { PPB_AUDIO_INTERFACE, PluginAudio::GetInterface(), true }, |
62 { PPB_AUDIO_CONFIG_INTERFACE, PluginAudioConfig::GetInterface(), true }, | 62 { PPB_AUDIO_CONFIG_INTERFACE, PluginAudioConfig::GetInterface(), true }, |
63 { PPB_AUDIO_CONFIG_INTERFACE_1_0, PluginAudioConfig::GetInterface1_0(), | 63 { PPB_AUDIO_CONFIG_INTERFACE_1_0, PluginAudioConfig::GetInterface1_0(), |
64 true }, | 64 true }, |
65 { PPB_CORE_INTERFACE, PluginCore::GetInterface(), true }, | 65 { PPB_CORE_INTERFACE, PluginCore::GetInterface(), true }, |
66 { PPB_CURSOR_CONTROL_DEV_INTERFACE, PluginCursorControl::GetInterface(), | 66 { PPB_MOUSECURSOR_INTERFACE_1_0, PluginMouseCursor::GetInterface(), |
67 true }, | 67 true }, |
68 { PPB_FILEIO_INTERFACE, PluginFileIO::GetInterface(), true }, | 68 { PPB_FILEIO_INTERFACE, PluginFileIO::GetInterface(), true }, |
69 { PPB_FILEREF_INTERFACE, PluginFileRef::GetInterface(), true }, | 69 { PPB_FILEREF_INTERFACE, PluginFileRef::GetInterface(), true }, |
70 { PPB_FILESYSTEM_INTERFACE, PluginFileSystem::GetInterface(), true }, | 70 { PPB_FILESYSTEM_INTERFACE, PluginFileSystem::GetInterface(), true }, |
71 { PPB_FIND_DEV_INTERFACE, PluginFind::GetInterface(), true }, | 71 { PPB_FIND_DEV_INTERFACE, PluginFind::GetInterface(), true }, |
72 { PPB_FONT_DEV_INTERFACE, PluginFont::GetInterface(), true }, | 72 { PPB_FONT_DEV_INTERFACE, PluginFont::GetInterface(), true }, |
73 { PPB_FULLSCREEN_INTERFACE, PluginFullscreen::GetInterface(), true }, | 73 { PPB_FULLSCREEN_INTERFACE, PluginFullscreen::GetInterface(), true }, |
74 { PPB_GAMEPAD_INTERFACE, PluginGamepad::GetInterface(), true }, | 74 { PPB_GAMEPAD_INTERFACE, PluginGamepad::GetInterface(), true }, |
75 { PPB_GRAPHICS_2D_INTERFACE, PluginGraphics2D::GetInterface(), true }, | 75 { PPB_GRAPHICS_2D_INTERFACE, PluginGraphics2D::GetInterface(), true }, |
76 { PPB_GRAPHICS_3D_INTERFACE, PluginGraphics3D::GetInterface(), true }, | 76 { PPB_GRAPHICS_3D_INTERFACE, PluginGraphics3D::GetInterface(), true }, |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 interface_name, NaClSrpcErrorString(srpc_result)); | 181 interface_name, NaClSrpcErrorString(srpc_result)); |
182 if (srpc_result != NACL_SRPC_RESULT_OK || !browser_exports_interface) { | 182 if (srpc_result != NACL_SRPC_RESULT_OK || !browser_exports_interface) { |
183 interface_map[index].ppb_interface = NULL; | 183 interface_map[index].ppb_interface = NULL; |
184 ppb_interface = NULL; | 184 ppb_interface = NULL; |
185 } | 185 } |
186 interface_map[index].needs_browser_check = false; | 186 interface_map[index].needs_browser_check = false; |
187 return ppb_interface; | 187 return ppb_interface; |
188 } | 188 } |
189 | 189 |
190 } // namespace ppapi_proxy | 190 } // namespace ppapi_proxy |
OLD | NEW |