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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 #include "webkit/plugins/ppapi/ppb_video_decoder_impl.h" | 80 #include "webkit/plugins/ppapi/ppb_video_decoder_impl.h" |
81 #include "webkit/plugins/ppapi/ppb_widget_impl.h" | 81 #include "webkit/plugins/ppapi/ppb_widget_impl.h" |
82 #include "webkit/plugins/ppapi/resource_tracker.h" | 82 #include "webkit/plugins/ppapi/resource_tracker.h" |
83 #include "webkit/plugins/ppapi/var.h" | 83 #include "webkit/plugins/ppapi/var.h" |
84 #include "webkit/plugins/ppapi/var_object_class.h" | 84 #include "webkit/plugins/ppapi/var_object_class.h" |
85 | 85 |
86 #ifdef ENABLE_GPU | 86 #ifdef ENABLE_GPU |
87 #include "webkit/plugins/ppapi/ppb_context_3d_impl.h" | 87 #include "webkit/plugins/ppapi/ppb_context_3d_impl.h" |
88 #include "webkit/plugins/ppapi/ppb_graphics_3d_impl.h" | 88 #include "webkit/plugins/ppapi/ppb_graphics_3d_impl.h" |
89 #include "webkit/plugins/ppapi/ppb_opengles_impl.h" | 89 #include "webkit/plugins/ppapi/ppb_opengles_impl.h" |
| 90 #include "webkit/plugins/ppapi/ppb_surface_3d_impl.h" |
90 #endif // ENABLE_GPU | 91 #endif // ENABLE_GPU |
91 | 92 |
92 namespace webkit { | 93 namespace webkit { |
93 namespace ppapi { | 94 namespace ppapi { |
94 | 95 |
95 namespace { | 96 namespace { |
96 | 97 |
97 // Maintains all currently loaded plugin libs for validating PP_Module | 98 // Maintains all currently loaded plugin libs for validating PP_Module |
98 // identifiers. | 99 // identifiers. |
99 typedef std::set<PluginModule*> PluginModuleSet; | 100 typedef std::set<PluginModule*> PluginModuleSet; |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 | 284 |
284 #ifdef ENABLE_GPU | 285 #ifdef ENABLE_GPU |
285 // This should really refer to switches::kDisable3DAPIs. | 286 // This should really refer to switches::kDisable3DAPIs. |
286 if (!CommandLine::ForCurrentProcess()->HasSwitch("disable-3d-apis")) { | 287 if (!CommandLine::ForCurrentProcess()->HasSwitch("disable-3d-apis")) { |
287 if (strcmp(name, PPB_GRAPHICS_3D_DEV_INTERFACE) == 0) | 288 if (strcmp(name, PPB_GRAPHICS_3D_DEV_INTERFACE) == 0) |
288 return PPB_Graphics3D_Impl::GetInterface(); | 289 return PPB_Graphics3D_Impl::GetInterface(); |
289 if (strcmp(name, PPB_CONTEXT_3D_DEV_INTERFACE) == 0) | 290 if (strcmp(name, PPB_CONTEXT_3D_DEV_INTERFACE) == 0) |
290 return PPB_Context3D_Impl::GetInterface(); | 291 return PPB_Context3D_Impl::GetInterface(); |
291 if (strcmp(name, PPB_OPENGLES2_DEV_INTERFACE) == 0) | 292 if (strcmp(name, PPB_OPENGLES2_DEV_INTERFACE) == 0) |
292 return PPB_OpenGLES_Impl::GetInterface(); | 293 return PPB_OpenGLES_Impl::GetInterface(); |
| 294 if (strcmp(name, PPB_SURFACE_3D_DEV_INTERFACE) == 0) |
| 295 return PPB_Surface3D_Impl::GetInterface(); |
293 } | 296 } |
294 #endif // ENABLE_GPU | 297 #endif // ENABLE_GPU |
295 | 298 |
296 // Only support the testing interface when the command line switch is | 299 // Only support the testing interface when the command line switch is |
297 // specified. This allows us to prevent people from (ab)using this interface | 300 // specified. This allows us to prevent people from (ab)using this interface |
298 // in production code. | 301 // in production code. |
299 if (strcmp(name, PPB_TESTING_DEV_INTERFACE) == 0) { | 302 if (strcmp(name, PPB_TESTING_DEV_INTERFACE) == 0) { |
300 if (CommandLine::ForCurrentProcess()->HasSwitch("enable-pepper-testing")) | 303 if (CommandLine::ForCurrentProcess()->HasSwitch("enable-pepper-testing")) |
301 return &testing_interface; | 304 return &testing_interface; |
302 } | 305 } |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
510 if (retval != 0) { | 513 if (retval != 0) { |
511 LOG(WARNING) << "PPP_InitializeModule returned failure " << retval; | 514 LOG(WARNING) << "PPP_InitializeModule returned failure " << retval; |
512 return false; | 515 return false; |
513 } | 516 } |
514 return true; | 517 return true; |
515 } | 518 } |
516 | 519 |
517 } // namespace ppapi | 520 } // namespace ppapi |
518 } // namespace webkit | 521 } // namespace webkit |
519 | 522 |
OLD | NEW |