| 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" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 struct InterfaceMapElement { | 51 struct InterfaceMapElement { |
| 52 const char* name; | 52 const char* name; |
| 53 const void* ppb_interface; | 53 const void* ppb_interface; |
| 54 bool needs_browser_check; | 54 bool needs_browser_check; |
| 55 }; | 55 }; |
| 56 | 56 |
| 57 // List of interfaces that have at least partial proxy support. | 57 // List of interfaces that have at least partial proxy support. |
| 58 InterfaceMapElement interface_map[] = { | 58 InterfaceMapElement interface_map[] = { |
| 59 { PPB_AUDIO_INTERFACE, PluginAudio::GetInterface(), true }, | 59 { PPB_AUDIO_INTERFACE, PluginAudio::GetInterface(), true }, |
| 60 { PPB_AUDIO_CONFIG_INTERFACE, PluginAudioConfig::GetInterface(), true }, | 60 { PPB_AUDIO_CONFIG_INTERFACE, PluginAudioConfig::GetInterface(), true }, |
| 61 { PPB_AUDIO_CONFIG_INTERFACE_1_0, PluginAudioConfig::GetInterface1_0(), |
| 62 true }, |
| 61 { PPB_CORE_INTERFACE, PluginCore::GetInterface(), true }, | 63 { PPB_CORE_INTERFACE, PluginCore::GetInterface(), true }, |
| 62 { PPB_CURSOR_CONTROL_DEV_INTERFACE, PluginCursorControl::GetInterface(), | 64 { PPB_CURSOR_CONTROL_DEV_INTERFACE, PluginCursorControl::GetInterface(), |
| 63 true }, | 65 true }, |
| 64 { PPB_FILEIO_INTERFACE, PluginFileIO::GetInterface(), true }, | 66 { PPB_FILEIO_INTERFACE, PluginFileIO::GetInterface(), true }, |
| 65 { PPB_FILEREF_INTERFACE, PluginFileRef::GetInterface(), true }, | 67 { PPB_FILEREF_INTERFACE, PluginFileRef::GetInterface(), true }, |
| 66 { PPB_FILESYSTEM_INTERFACE, PluginFileSystem::GetInterface(), true }, | 68 { PPB_FILESYSTEM_INTERFACE, PluginFileSystem::GetInterface(), true }, |
| 67 { PPB_FIND_DEV_INTERFACE, PluginFind::GetInterface(), true }, | 69 { PPB_FIND_DEV_INTERFACE, PluginFind::GetInterface(), true }, |
| 68 { PPB_FONT_DEV_INTERFACE, PluginFont::GetInterface(), true }, | 70 { PPB_FONT_DEV_INTERFACE, PluginFont::GetInterface(), true }, |
| 69 { PPB_FULLSCREEN_INTERFACE, PluginFullscreen::GetInterface(), true }, | 71 { PPB_FULLSCREEN_INTERFACE, PluginFullscreen::GetInterface(), true }, |
| 70 { PPB_GAMEPAD_DEV_INTERFACE, PluginGamepad::GetInterface(), true }, | 72 { PPB_GAMEPAD_DEV_INTERFACE, PluginGamepad::GetInterface(), true }, |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 interface_name, NaClSrpcErrorString(srpc_result)); | 150 interface_name, NaClSrpcErrorString(srpc_result)); |
| 149 if (srpc_result != NACL_SRPC_RESULT_OK || !browser_exports_interface) { | 151 if (srpc_result != NACL_SRPC_RESULT_OK || !browser_exports_interface) { |
| 150 interface_map[index].ppb_interface = NULL; | 152 interface_map[index].ppb_interface = NULL; |
| 151 ppb_interface = NULL; | 153 ppb_interface = NULL; |
| 152 } | 154 } |
| 153 interface_map[index].needs_browser_check = false; | 155 interface_map[index].needs_browser_check = false; |
| 154 return ppb_interface; | 156 return ppb_interface; |
| 155 } | 157 } |
| 156 | 158 |
| 157 } // namespace ppapi_proxy | 159 } // namespace ppapi_proxy |
| OLD | NEW |