| 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 "native_client/src/shared/ppapi_proxy/browser_globals.h" | 5 #include "native_client/src/shared/ppapi_proxy/browser_globals.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdio.h> | 8 #include <stdio.h> |
| 9 #include <stdlib.h> | 9 #include <stdlib.h> |
| 10 #include <string.h> | 10 #include <string.h> |
| 11 | 11 |
| 12 #include <map> | 12 #include <map> |
| 13 | 13 |
| 14 #include "native_client/src/include/nacl_macros.h" | 14 #include "native_client/src/include/nacl_macros.h" |
| 15 #include "native_client/src/shared/platform/nacl_check.h" | 15 #include "native_client/src/shared/platform/nacl_check.h" |
| 16 #include "native_client/src/shared/ppapi_proxy/browser_ppp.h" | 16 #include "native_client/src/shared/ppapi_proxy/browser_ppp.h" |
| 17 #include "native_client/src/shared/ppapi_proxy/utility.h" | 17 #include "native_client/src/shared/ppapi_proxy/utility.h" |
| 18 #include "native_client/src/shared/srpc/nacl_srpc.h" | 18 #include "native_client/src/shared/srpc/nacl_srpc.h" |
| 19 #include "native_client/src/trusted/plugin/plugin.h" | 19 #include "native_client/src/trusted/plugin/plugin.h" |
| 20 #include "ppapi/c/dev/ppb_gles_chromium_texture_mapping_dev.h" | |
| 21 #include "ppapi/c/dev/ppb_layer_compositor_dev.h" | 20 #include "ppapi/c/dev/ppb_layer_compositor_dev.h" |
| 21 #include "ppapi/c/dev/ppb_opengles2ext_dev.h" |
| 22 #include "ppapi/c/ppb_graphics_3d.h" | 22 #include "ppapi/c/ppb_graphics_3d.h" |
| 23 #include "ppapi/c/ppb_opengles2.h" | 23 #include "ppapi/c/ppb_opengles2.h" |
| 24 #include "ppapi/c/trusted/ppb_graphics_3d_trusted.h" | 24 #include "ppapi/c/trusted/ppb_graphics_3d_trusted.h" |
| 25 | 25 |
| 26 namespace ppapi_proxy { | 26 namespace ppapi_proxy { |
| 27 | 27 |
| 28 // All of these methods are called from the browser main (UI, JavaScript, ...) | 28 // All of these methods are called from the browser main (UI, JavaScript, ...) |
| 29 // thread. | 29 // thread. |
| 30 | 30 |
| 31 const PP_Resource kInvalidResourceId = 0; | 31 const PP_Resource kInvalidResourceId = 0; |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 return NULL; | 179 return NULL; |
| 180 } | 180 } |
| 181 // If dev interface is not enabled, reject interfaces containing "(Dev)" | 181 // If dev interface is not enabled, reject interfaces containing "(Dev)" |
| 182 if (!enable_dev_interfaces && strstr(interface_name, "(Dev)") != NULL) { | 182 if (!enable_dev_interfaces && strstr(interface_name, "(Dev)") != NULL) { |
| 183 return NULL; | 183 return NULL; |
| 184 } | 184 } |
| 185 if (!enable_3d_interfaces) { | 185 if (!enable_3d_interfaces) { |
| 186 static const char* disabled_interface_names[] = { | 186 static const char* disabled_interface_names[] = { |
| 187 PPB_GRAPHICS_3D_INTERFACE, | 187 PPB_GRAPHICS_3D_INTERFACE, |
| 188 PPB_GRAPHICS_3D_TRUSTED_INTERFACE, | 188 PPB_GRAPHICS_3D_TRUSTED_INTERFACE, |
| 189 PPB_GLES_CHROMIUM_TEXTURE_MAPPING_DEV_INTERFACE, | |
| 190 PPB_OPENGLES2_INTERFACE, | 189 PPB_OPENGLES2_INTERFACE, |
| 190 PPB_OPENGLES2_INSTANCEDARRAYS_DEV_INTERFACE, |
| 191 PPB_OPENGLES2_FRAMEBUFFERBLIT_DEV_INTERFACE, |
| 192 PPB_OPENGLES2_FRAMEBUFFERMULTISAMPLE_DEV_INTERFACE, |
| 193 PPB_OPENGLES2_CHROMIUMENABLEFEATURE_DEV_INTERFACE, |
| 194 PPB_OPENGLES2_CHROMIUMMAPSUB_DEV_INTERFACE, |
| 191 PPB_LAYER_COMPOSITOR_DEV_INTERFACE | 195 PPB_LAYER_COMPOSITOR_DEV_INTERFACE |
| 192 }; | 196 }; |
| 193 for (size_t i = 0; i < NACL_ARRAY_SIZE(disabled_interface_names); i++) { | 197 for (size_t i = 0; i < NACL_ARRAY_SIZE(disabled_interface_names); i++) { |
| 194 if (strcmp(interface_name, disabled_interface_names[i]) == 0) | 198 if (strcmp(interface_name, disabled_interface_names[i]) == 0) |
| 195 return NULL; | 199 return NULL; |
| 196 } | 200 } |
| 197 } | 201 } |
| 198 return (*get_interface)(interface_name); | 202 return (*get_interface)(interface_name); |
| 199 } | 203 } |
| 200 | 204 |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 453 } | 457 } |
| 454 | 458 |
| 455 const PPB_UDPSocket_Private* PPBUDPSocketPrivateInterface() { | 459 const PPB_UDPSocket_Private* PPBUDPSocketPrivateInterface() { |
| 456 static const PPB_UDPSocket_Private* ppb = | 460 static const PPB_UDPSocket_Private* ppb = |
| 457 static_cast<const PPB_UDPSocket_Private*>( | 461 static_cast<const PPB_UDPSocket_Private*>( |
| 458 GetBrowserInterfaceSafe(PPB_UDPSOCKET_PRIVATE_INTERFACE)); | 462 GetBrowserInterfaceSafe(PPB_UDPSOCKET_PRIVATE_INTERFACE)); |
| 459 return ppb; | 463 return ppb; |
| 460 } | 464 } |
| 461 | 465 |
| 462 } // namespace ppapi_proxy | 466 } // namespace ppapi_proxy |
| OLD | NEW |