| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_context_3d_dev.h" | |
| 21 #include "ppapi/c/dev/ppb_context_3d_trusted_dev.h" | |
| 22 #include "ppapi/c/dev/ppb_gles_chromium_texture_mapping_dev.h" | 20 #include "ppapi/c/dev/ppb_gles_chromium_texture_mapping_dev.h" |
| 23 #include "ppapi/c/dev/ppb_layer_compositor_dev.h" | 21 #include "ppapi/c/dev/ppb_layer_compositor_dev.h" |
| 24 #include "ppapi/c/dev/ppb_surface_3d_dev.h" | |
| 25 #include "ppapi/c/ppb_graphics_3d.h" | 22 #include "ppapi/c/ppb_graphics_3d.h" |
| 26 #include "ppapi/c/ppb_opengles2.h" | 23 #include "ppapi/c/ppb_opengles2.h" |
| 27 #include "ppapi/c/trusted/ppb_graphics_3d_trusted.h" | 24 #include "ppapi/c/trusted/ppb_graphics_3d_trusted.h" |
| 28 | 25 |
| 29 namespace ppapi_proxy { | 26 namespace ppapi_proxy { |
| 30 | 27 |
| 31 // 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, ...) |
| 32 // thread. | 29 // thread. |
| 33 | 30 |
| 34 const PP_Resource kInvalidResourceId = 0; | 31 const PP_Resource kInvalidResourceId = 0; |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 return NULL; | 179 return NULL; |
| 183 } | 180 } |
| 184 // If dev interface is not enabled, reject interfaces containing "(Dev)" | 181 // If dev interface is not enabled, reject interfaces containing "(Dev)" |
| 185 if (!enable_dev_interfaces && strstr(interface_name, "(Dev)") != NULL) { | 182 if (!enable_dev_interfaces && strstr(interface_name, "(Dev)") != NULL) { |
| 186 return NULL; | 183 return NULL; |
| 187 } | 184 } |
| 188 if (!enable_3d_interfaces) { | 185 if (!enable_3d_interfaces) { |
| 189 static const char* disabled_interface_names[] = { | 186 static const char* disabled_interface_names[] = { |
| 190 PPB_GRAPHICS_3D_INTERFACE, | 187 PPB_GRAPHICS_3D_INTERFACE, |
| 191 PPB_GRAPHICS_3D_TRUSTED_INTERFACE, | 188 PPB_GRAPHICS_3D_TRUSTED_INTERFACE, |
| 192 PPB_CONTEXT_3D_DEV_INTERFACE, | |
| 193 PPB_CONTEXT_3D_TRUSTED_DEV_INTERFACE, | |
| 194 PPB_GLES_CHROMIUM_TEXTURE_MAPPING_DEV_INTERFACE, | 189 PPB_GLES_CHROMIUM_TEXTURE_MAPPING_DEV_INTERFACE, |
| 195 PPB_OPENGLES2_INTERFACE, | 190 PPB_OPENGLES2_INTERFACE, |
| 196 PPB_SURFACE_3D_DEV_INTERFACE, | |
| 197 PPB_LAYER_COMPOSITOR_DEV_INTERFACE | 191 PPB_LAYER_COMPOSITOR_DEV_INTERFACE |
| 198 }; | 192 }; |
| 199 for (size_t i = 0; i < NACL_ARRAY_SIZE(disabled_interface_names); i++) { | 193 for (size_t i = 0; i < NACL_ARRAY_SIZE(disabled_interface_names); i++) { |
| 200 if (strcmp(interface_name, disabled_interface_names[i]) == 0) | 194 if (strcmp(interface_name, disabled_interface_names[i]) == 0) |
| 201 return NULL; | 195 return NULL; |
| 202 } | 196 } |
| 203 } | 197 } |
| 204 return (*get_interface)(interface_name); | 198 return (*get_interface)(interface_name); |
| 205 } | 199 } |
| 206 | 200 |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 410 | 404 |
| 411 // Private interfaces. | 405 // Private interfaces. |
| 412 const PPB_PDF* PPBPDFInterface() { | 406 const PPB_PDF* PPBPDFInterface() { |
| 413 static const PPB_PDF* ppb = | 407 static const PPB_PDF* ppb = |
| 414 static_cast<const PPB_PDF*>( | 408 static_cast<const PPB_PDF*>( |
| 415 GetBrowserInterfaceSafe(PPB_PDF_INTERFACE)); | 409 GetBrowserInterfaceSafe(PPB_PDF_INTERFACE)); |
| 416 return ppb; | 410 return ppb; |
| 417 } | 411 } |
| 418 | 412 |
| 419 } // namespace ppapi_proxy | 413 } // namespace ppapi_proxy |
| OLD | NEW |