| OLD | NEW |
| 1 // Copyright (c) 2011 The Native Client Authors. All rights reserved. | 1 // Copyright (c) 2011 The Native Client 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_context_3d.h" | 10 #include "native_client/src/shared/ppapi_proxy/plugin_context_3d.h" |
| 11 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_audio.h" | 11 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_audio.h" |
| 12 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_audio_config.h" | 12 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_audio_config.h" |
| 13 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_buffer.h" | 13 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_buffer.h" |
| 14 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_core.h" | 14 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_core.h" |
| 15 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_cursor_control.h" | 15 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_cursor_control.h" |
| 16 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_file_io.h" | 16 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_file_io.h" |
| 17 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_file_ref.h" | 17 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_file_ref.h" |
| 18 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_file_system.h" | 18 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_file_system.h" |
| 19 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_find.h" | 19 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_find.h" |
| 20 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_font.h" | 20 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_font.h" |
| 21 #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" |
| 22 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_graphics_3d.h" |
| 22 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_image_data.h" | 23 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_image_data.h" |
| 23 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_input_event.h" | 24 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_input_event.h" |
| 24 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_instance.h" | 25 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_instance.h" |
| 25 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_memory.h" | 26 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_memory.h" |
| 26 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_messaging.h" | 27 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_messaging.h" |
| 27 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_pdf.h" | 28 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_pdf.h" |
| 28 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_scrollbar.h" | 29 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_scrollbar.h" |
| 29 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_testing.h" | 30 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_testing.h" |
| 30 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_url_loader.h" | 31 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_url_loader.h" |
| 31 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_url_request_info.h" | 32 #include "native_client/src/shared/ppapi_proxy/plugin_ppb_url_request_info.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 54 { PPB_CORE_INTERFACE, PluginCore::GetInterface(), true }, | 55 { PPB_CORE_INTERFACE, PluginCore::GetInterface(), true }, |
| 55 { PPB_CURSOR_CONTROL_DEV_INTERFACE, PluginCursorControl::GetInterface(), | 56 { PPB_CURSOR_CONTROL_DEV_INTERFACE, PluginCursorControl::GetInterface(), |
| 56 true }, | 57 true }, |
| 57 { PPB_CONTEXT_3D_DEV_INTERFACE, PluginContext3D::GetInterface(), true }, | 58 { PPB_CONTEXT_3D_DEV_INTERFACE, PluginContext3D::GetInterface(), true }, |
| 58 { PPB_FILEIO_INTERFACE, PluginFileIO::GetInterface(), true }, | 59 { PPB_FILEIO_INTERFACE, PluginFileIO::GetInterface(), true }, |
| 59 { PPB_FILEREF_INTERFACE, PluginFileRef::GetInterface(), true }, | 60 { PPB_FILEREF_INTERFACE, PluginFileRef::GetInterface(), true }, |
| 60 { PPB_FILESYSTEM_INTERFACE, PluginFileSystem::GetInterface(), true }, | 61 { PPB_FILESYSTEM_INTERFACE, PluginFileSystem::GetInterface(), true }, |
| 61 { PPB_FIND_DEV_INTERFACE, PluginFind::GetInterface(), true }, | 62 { PPB_FIND_DEV_INTERFACE, PluginFind::GetInterface(), true }, |
| 62 { PPB_FONT_DEV_INTERFACE, PluginFont::GetInterface(), true }, | 63 { PPB_FONT_DEV_INTERFACE, PluginFont::GetInterface(), true }, |
| 63 { PPB_GRAPHICS_2D_INTERFACE, PluginGraphics2D::GetInterface(), true }, | 64 { PPB_GRAPHICS_2D_INTERFACE, PluginGraphics2D::GetInterface(), true }, |
| 65 { PPB_GRAPHICS_3D_DEV_INTERFACE, PluginGraphics3D::GetInterface(), true }, |
| 64 { PPB_IMAGEDATA_INTERFACE, PluginImageData::GetInterface(), true }, | 66 { PPB_IMAGEDATA_INTERFACE, PluginImageData::GetInterface(), true }, |
| 65 { PPB_INPUT_EVENT_INTERFACE, PluginInputEvent::GetInterface(), true }, | 67 { PPB_INPUT_EVENT_INTERFACE, PluginInputEvent::GetInterface(), true }, |
| 66 { PPB_INSTANCE_INTERFACE, PluginInstance::GetInterface(), true }, | 68 { PPB_INSTANCE_INTERFACE, PluginInstance::GetInterface(), true }, |
| 67 { PPB_KEYBOARD_INPUT_EVENT_INTERFACE, | 69 { PPB_KEYBOARD_INPUT_EVENT_INTERFACE, |
| 68 PluginInputEvent::GetKeyboardInterface(), true }, | 70 PluginInputEvent::GetKeyboardInterface(), true }, |
| 69 { PPB_MEMORY_DEV_INTERFACE, PluginMemory::GetInterface(), true }, | 71 { PPB_MEMORY_DEV_INTERFACE, PluginMemory::GetInterface(), true }, |
| 70 { PPB_MESSAGING_INTERFACE, PluginMessaging::GetInterface(), true }, | 72 { PPB_MESSAGING_INTERFACE, PluginMessaging::GetInterface(), true }, |
| 71 { PPB_MOUSE_INPUT_EVENT_INTERFACE, PluginInputEvent::GetMouseInterface(), | 73 { PPB_MOUSE_INPUT_EVENT_INTERFACE, PluginInputEvent::GetMouseInterface(), |
| 72 true }, | 74 true }, |
| 73 { PPB_OPENGLES2_DEV_INTERFACE, PluginContext3D::GetOpenGLESInterface(), | 75 { PPB_OPENGLES2_DEV_INTERFACE, PluginGraphics3D::GetOpenGLESInterface(), |
| 74 true }, | 76 true }, |
| 75 { PPB_PDF_INTERFACE, PluginPDF::GetInterface(), true }, | 77 { PPB_PDF_INTERFACE, PluginPDF::GetInterface(), true }, |
| 76 { PPB_SCROLLBAR_DEV_INTERFACE, PluginScrollbar::GetInterface(), true }, | 78 { PPB_SCROLLBAR_DEV_INTERFACE, PluginScrollbar::GetInterface(), true }, |
| 77 { PPB_SURFACE_3D_DEV_INTERFACE, PluginSurface3D::GetInterface(), true }, | 79 { PPB_SURFACE_3D_DEV_INTERFACE, PluginSurface3D::GetInterface(), true }, |
| 78 { PPB_TESTING_DEV_INTERFACE, PluginTesting::GetInterface(), true }, | 80 { PPB_TESTING_DEV_INTERFACE, PluginTesting::GetInterface(), true }, |
| 79 { PPB_URLLOADER_INTERFACE, PluginURLLoader::GetInterface(), true }, | 81 { PPB_URLLOADER_INTERFACE, PluginURLLoader::GetInterface(), true }, |
| 80 { PPB_URLREQUESTINFO_INTERFACE, PluginURLRequestInfo::GetInterface(), true }, | 82 { PPB_URLREQUESTINFO_INTERFACE, PluginURLRequestInfo::GetInterface(), true }, |
| 81 { PPB_URLRESPONSEINFO_INTERFACE, PluginURLResponseInfo::GetInterface(), | 83 { PPB_URLRESPONSEINFO_INTERFACE, PluginURLResponseInfo::GetInterface(), |
| 82 true }, | 84 true }, |
| 83 { PPB_VAR_INTERFACE, PluginVar::GetInterface(), true }, | 85 { PPB_VAR_INTERFACE, PluginVar::GetInterface(), true }, |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 interface_name, NaClSrpcErrorString(srpc_result)); | 124 interface_name, NaClSrpcErrorString(srpc_result)); |
| 123 if (srpc_result != NACL_SRPC_RESULT_OK || !browser_exports_interface) { | 125 if (srpc_result != NACL_SRPC_RESULT_OK || !browser_exports_interface) { |
| 124 interface_map[index].ppb_interface = NULL; | 126 interface_map[index].ppb_interface = NULL; |
| 125 ppb_interface = NULL; | 127 ppb_interface = NULL; |
| 126 } | 128 } |
| 127 interface_map[index].needs_browser_check = false; | 129 interface_map[index].needs_browser_check = false; |
| 128 return ppb_interface; | 130 return ppb_interface; |
| 129 } | 131 } |
| 130 | 132 |
| 131 } // namespace ppapi_proxy | 133 } // namespace ppapi_proxy |
| OLD | NEW |