OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "webkit/plugins/ppapi/plugin_module.h" | 5 #include "webkit/plugins/ppapi/plugin_module.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 if (strcmp(name, PPB_VAR_INTERFACE) == 0) | 271 if (strcmp(name, PPB_VAR_INTERFACE) == 0) |
272 return Var::GetInterface(); | 272 return Var::GetInterface(); |
273 if (strcmp(name, PPB_VIDEODECODER_DEV_INTERFACE) == 0) | 273 if (strcmp(name, PPB_VIDEODECODER_DEV_INTERFACE) == 0) |
274 return PPB_VideoDecoder_Impl::GetInterface(); | 274 return PPB_VideoDecoder_Impl::GetInterface(); |
275 if (strcmp(name, PPB_WIDGET_DEV_INTERFACE) == 0) | 275 if (strcmp(name, PPB_WIDGET_DEV_INTERFACE) == 0) |
276 return PPB_Widget_Impl::GetInterface(); | 276 return PPB_Widget_Impl::GetInterface(); |
277 if (strcmp(name, PPB_ZOOM_DEV_INTERFACE) == 0) | 277 if (strcmp(name, PPB_ZOOM_DEV_INTERFACE) == 0) |
278 return PluginInstance::GetZoomInterface(); | 278 return PluginInstance::GetZoomInterface(); |
279 | 279 |
280 #ifdef ENABLE_GPU | 280 #ifdef ENABLE_GPU |
281 if (strcmp(name, PPB_GRAPHICS_3D_DEV_INTERFACE) == 0) | 281 // This should really refer to switches::kDisable3DAPIs. |
282 return PPB_Graphics3D_Impl::GetInterface(); | 282 if (!CommandLine::ForCurrentProcess()->HasSwitch("disable-3d-apis")) { |
283 if (strcmp(name, PPB_OPENGLES_DEV_INTERFACE) == 0) | 283 if (strcmp(name, PPB_GRAPHICS_3D_DEV_INTERFACE) == 0) |
284 return PPB_Graphics3D_Impl::GetOpenGLESInterface(); | 284 return PPB_Graphics3D_Impl::GetInterface(); |
| 285 if (strcmp(name, PPB_OPENGLES_DEV_INTERFACE) == 0) |
| 286 return PPB_Graphics3D_Impl::GetOpenGLESInterface(); |
| 287 } |
285 #endif // ENABLE_GPU | 288 #endif // ENABLE_GPU |
286 | 289 |
287 // Only support the testing interface when the command line switch is | 290 // Only support the testing interface when the command line switch is |
288 // specified. This allows us to prevent people from (ab)using this interface | 291 // specified. This allows us to prevent people from (ab)using this interface |
289 // in production code. | 292 // in production code. |
290 if (strcmp(name, PPB_TESTING_DEV_INTERFACE) == 0) { | 293 if (strcmp(name, PPB_TESTING_DEV_INTERFACE) == 0) { |
291 if (CommandLine::ForCurrentProcess()->HasSwitch("enable-pepper-testing")) | 294 if (CommandLine::ForCurrentProcess()->HasSwitch("enable-pepper-testing")) |
292 return &testing_interface; | 295 return &testing_interface; |
293 } | 296 } |
294 return NULL; | 297 return NULL; |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
493 if (retval != 0) { | 496 if (retval != 0) { |
494 LOG(WARNING) << "PPP_InitializeModule returned failure " << retval; | 497 LOG(WARNING) << "PPP_InitializeModule returned failure " << retval; |
495 return false; | 498 return false; |
496 } | 499 } |
497 return true; | 500 return true; |
498 } | 501 } |
499 | 502 |
500 } // namespace ppapi | 503 } // namespace ppapi |
501 } // namespace webkit | 504 } // namespace webkit |
502 | 505 |
OLD | NEW |