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" |
11 #include "base/message_loop_proxy.h" | 11 #include "base/message_loop_proxy.h" |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
13 #include "base/scoped_ptr.h" | 13 #include "base/scoped_ptr.h" |
14 #include "base/time.h" | 14 #include "base/time.h" |
15 #include "ppapi/c/dev/ppb_buffer_dev.h" | 15 #include "ppapi/c/dev/ppb_buffer_dev.h" |
16 #include "ppapi/c/dev/ppb_char_set_dev.h" | 16 #include "ppapi/c/dev/ppb_char_set_dev.h" |
| 17 #include "ppapi/c/dev/ppb_context_3d_dev.h" |
17 #include "ppapi/c/dev/ppb_cursor_control_dev.h" | 18 #include "ppapi/c/dev/ppb_cursor_control_dev.h" |
18 #include "ppapi/c/dev/ppb_directory_reader_dev.h" | 19 #include "ppapi/c/dev/ppb_directory_reader_dev.h" |
19 #include "ppapi/c/dev/ppb_file_io_dev.h" | 20 #include "ppapi/c/dev/ppb_file_io_dev.h" |
20 #include "ppapi/c/dev/ppb_file_io_trusted_dev.h" | 21 #include "ppapi/c/dev/ppb_file_io_trusted_dev.h" |
21 #include "ppapi/c/dev/ppb_file_system_dev.h" | 22 #include "ppapi/c/dev/ppb_file_system_dev.h" |
22 #include "ppapi/c/dev/ppb_find_dev.h" | 23 #include "ppapi/c/dev/ppb_find_dev.h" |
23 #include "ppapi/c/dev/ppb_font_dev.h" | 24 #include "ppapi/c/dev/ppb_font_dev.h" |
24 #include "ppapi/c/dev/ppb_fullscreen_dev.h" | 25 #include "ppapi/c/dev/ppb_fullscreen_dev.h" |
25 #include "ppapi/c/dev/ppb_graphics_3d_dev.h" | 26 #include "ppapi/c/dev/ppb_graphics_3d_dev.h" |
26 #include "ppapi/c/dev/ppb_opengles_dev.h" | 27 #include "ppapi/c/dev/ppb_opengles_dev.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 #include "webkit/plugins/ppapi/ppb_url_request_info_impl.h" | 77 #include "webkit/plugins/ppapi/ppb_url_request_info_impl.h" |
77 #include "webkit/plugins/ppapi/ppb_url_response_info_impl.h" | 78 #include "webkit/plugins/ppapi/ppb_url_response_info_impl.h" |
78 #include "webkit/plugins/ppapi/ppb_url_util_impl.h" | 79 #include "webkit/plugins/ppapi/ppb_url_util_impl.h" |
79 #include "webkit/plugins/ppapi/ppb_video_decoder_impl.h" | 80 #include "webkit/plugins/ppapi/ppb_video_decoder_impl.h" |
80 #include "webkit/plugins/ppapi/ppb_widget_impl.h" | 81 #include "webkit/plugins/ppapi/ppb_widget_impl.h" |
81 #include "webkit/plugins/ppapi/resource_tracker.h" | 82 #include "webkit/plugins/ppapi/resource_tracker.h" |
82 #include "webkit/plugins/ppapi/var.h" | 83 #include "webkit/plugins/ppapi/var.h" |
83 #include "webkit/plugins/ppapi/var_object_class.h" | 84 #include "webkit/plugins/ppapi/var_object_class.h" |
84 | 85 |
85 #ifdef ENABLE_GPU | 86 #ifdef ENABLE_GPU |
| 87 #include "webkit/plugins/ppapi/ppb_context_3d_impl.h" |
86 #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" |
87 #endif // ENABLE_GPU | 90 #endif // ENABLE_GPU |
88 | 91 |
89 namespace webkit { | 92 namespace webkit { |
90 namespace ppapi { | 93 namespace ppapi { |
91 | 94 |
92 namespace { | 95 namespace { |
93 | 96 |
94 // Maintains all currently loaded plugin libs for validating PP_Module | 97 // Maintains all currently loaded plugin libs for validating PP_Module |
95 // identifiers. | 98 // identifiers. |
96 typedef std::set<PluginModule*> PluginModuleSet; | 99 typedef std::set<PluginModule*> PluginModuleSet; |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 if (strcmp(name, PPB_WIDGET_DEV_INTERFACE) == 0) | 279 if (strcmp(name, PPB_WIDGET_DEV_INTERFACE) == 0) |
277 return PPB_Widget_Impl::GetInterface(); | 280 return PPB_Widget_Impl::GetInterface(); |
278 if (strcmp(name, PPB_ZOOM_DEV_INTERFACE) == 0) | 281 if (strcmp(name, PPB_ZOOM_DEV_INTERFACE) == 0) |
279 return PluginInstance::GetZoomInterface(); | 282 return PluginInstance::GetZoomInterface(); |
280 | 283 |
281 #ifdef ENABLE_GPU | 284 #ifdef ENABLE_GPU |
282 // This should really refer to switches::kDisable3DAPIs. | 285 // This should really refer to switches::kDisable3DAPIs. |
283 if (!CommandLine::ForCurrentProcess()->HasSwitch("disable-3d-apis")) { | 286 if (!CommandLine::ForCurrentProcess()->HasSwitch("disable-3d-apis")) { |
284 if (strcmp(name, PPB_GRAPHICS_3D_DEV_INTERFACE) == 0) | 287 if (strcmp(name, PPB_GRAPHICS_3D_DEV_INTERFACE) == 0) |
285 return PPB_Graphics3D_Impl::GetInterface(); | 288 return PPB_Graphics3D_Impl::GetInterface(); |
| 289 if (strcmp(name, PPB_CONTEXT_3D_DEV_INTERFACE) == 0) |
| 290 return PPB_Context3D_Impl::GetInterface(); |
286 if (strcmp(name, PPB_OPENGLES2_DEV_INTERFACE) == 0) | 291 if (strcmp(name, PPB_OPENGLES2_DEV_INTERFACE) == 0) |
287 return PPB_Graphics3D_Impl::GetOpenGLES2Interface(); | 292 return PPB_OpenGLES_Impl::GetInterface(); |
288 } | 293 } |
289 #endif // ENABLE_GPU | 294 #endif // ENABLE_GPU |
290 | 295 |
291 // Only support the testing interface when the command line switch is | 296 // Only support the testing interface when the command line switch is |
292 // specified. This allows us to prevent people from (ab)using this interface | 297 // specified. This allows us to prevent people from (ab)using this interface |
293 // in production code. | 298 // in production code. |
294 if (strcmp(name, PPB_TESTING_DEV_INTERFACE) == 0) { | 299 if (strcmp(name, PPB_TESTING_DEV_INTERFACE) == 0) { |
295 if (CommandLine::ForCurrentProcess()->HasSwitch("enable-pepper-testing")) | 300 if (CommandLine::ForCurrentProcess()->HasSwitch("enable-pepper-testing")) |
296 return &testing_interface; | 301 return &testing_interface; |
297 } | 302 } |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
505 if (retval != 0) { | 510 if (retval != 0) { |
506 LOG(WARNING) << "PPP_InitializeModule returned failure " << retval; | 511 LOG(WARNING) << "PPP_InitializeModule returned failure " << retval; |
507 return false; | 512 return false; |
508 } | 513 } |
509 return true; | 514 return true; |
510 } | 515 } |
511 | 516 |
512 } // namespace ppapi | 517 } // namespace ppapi |
513 } // namespace webkit | 518 } // namespace webkit |
514 | 519 |
OLD | NEW |