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" |
20 #include "ppapi/c/dev/ppb_layer_compositor_dev.h" | 21 #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, |
189 PPB_OPENGLES2_INTERFACE, | 190 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, | |
195 PPB_LAYER_COMPOSITOR_DEV_INTERFACE | 191 PPB_LAYER_COMPOSITOR_DEV_INTERFACE |
196 }; | 192 }; |
197 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++) { |
198 if (strcmp(interface_name, disabled_interface_names[i]) == 0) | 194 if (strcmp(interface_name, disabled_interface_names[i]) == 0) |
199 return NULL; | 195 return NULL; |
200 } | 196 } |
201 } | 197 } |
202 return (*get_interface)(interface_name); | 198 return (*get_interface)(interface_name); |
203 } | 199 } |
204 | 200 |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
457 } | 453 } |
458 | 454 |
459 const PPB_UDPSocket_Private* PPBUDPSocketPrivateInterface() { | 455 const PPB_UDPSocket_Private* PPBUDPSocketPrivateInterface() { |
460 static const PPB_UDPSocket_Private* ppb = | 456 static const PPB_UDPSocket_Private* ppb = |
461 static_cast<const PPB_UDPSocket_Private*>( | 457 static_cast<const PPB_UDPSocket_Private*>( |
462 GetBrowserInterfaceSafe(PPB_UDPSOCKET_PRIVATE_INTERFACE)); | 458 GetBrowserInterfaceSafe(PPB_UDPSOCKET_PRIVATE_INTERFACE)); |
463 return ppb; | 459 return ppb; |
464 } | 460 } |
465 | 461 |
466 } // namespace ppapi_proxy | 462 } // namespace ppapi_proxy |
OLD | NEW |