| 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_context_3d_dev.h" |
| 18 #include "ppapi/c/dev/ppb_cursor_control_dev.h" | 18 #include "ppapi/c/dev/ppb_cursor_control_dev.h" |
| 19 #include "ppapi/c/dev/ppb_directory_reader_dev.h" | 19 #include "ppapi/c/dev/ppb_directory_reader_dev.h" |
| 20 #include "ppapi/c/dev/ppb_file_io_dev.h" | 20 #include "ppapi/c/dev/ppb_file_io_dev.h" |
| 21 #include "ppapi/c/dev/ppb_file_io_trusted_dev.h" | 21 #include "ppapi/c/dev/ppb_file_io_trusted_dev.h" |
| 22 #include "ppapi/c/dev/ppb_file_system_dev.h" | 22 #include "ppapi/c/dev/ppb_file_system_dev.h" |
| 23 #include "ppapi/c/dev/ppb_find_dev.h" | 23 #include "ppapi/c/dev/ppb_find_dev.h" |
| 24 #include "ppapi/c/dev/ppb_font_dev.h" | 24 #include "ppapi/c/dev/ppb_font_dev.h" |
| 25 #include "ppapi/c/dev/ppb_fullscreen_dev.h" | 25 #include "ppapi/c/dev/ppb_fullscreen_dev.h" |
| 26 #include "ppapi/c/dev/ppb_gles_chromium_extension_dev.h" |
| 26 #include "ppapi/c/dev/ppb_graphics_3d_dev.h" | 27 #include "ppapi/c/dev/ppb_graphics_3d_dev.h" |
| 27 #include "ppapi/c/dev/ppb_opengles_dev.h" | 28 #include "ppapi/c/dev/ppb_opengles_dev.h" |
| 28 #include "ppapi/c/dev/ppb_scrollbar_dev.h" | 29 #include "ppapi/c/dev/ppb_scrollbar_dev.h" |
| 29 #include "ppapi/c/dev/ppb_testing_dev.h" | 30 #include "ppapi/c/dev/ppb_testing_dev.h" |
| 30 #include "ppapi/c/dev/ppb_transport_dev.h" | 31 #include "ppapi/c/dev/ppb_transport_dev.h" |
| 31 #include "ppapi/c/dev/ppb_url_util_dev.h" | 32 #include "ppapi/c/dev/ppb_url_util_dev.h" |
| 32 #include "ppapi/c/dev/ppb_var_deprecated.h" | 33 #include "ppapi/c/dev/ppb_var_deprecated.h" |
| 33 #include "ppapi/c/dev/ppb_video_decoder_dev.h" | 34 #include "ppapi/c/dev/ppb_video_decoder_dev.h" |
| 34 #include "ppapi/c/dev/ppb_widget_dev.h" | 35 #include "ppapi/c/dev/ppb_widget_dev.h" |
| 35 #include "ppapi/c/dev/ppb_zoom_dev.h" | 36 #include "ppapi/c/dev/ppb_zoom_dev.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 #include "webkit/plugins/ppapi/ppb_url_response_info_impl.h" | 79 #include "webkit/plugins/ppapi/ppb_url_response_info_impl.h" |
| 79 #include "webkit/plugins/ppapi/ppb_url_util_impl.h" | 80 #include "webkit/plugins/ppapi/ppb_url_util_impl.h" |
| 80 #include "webkit/plugins/ppapi/ppb_video_decoder_impl.h" | 81 #include "webkit/plugins/ppapi/ppb_video_decoder_impl.h" |
| 81 #include "webkit/plugins/ppapi/ppb_widget_impl.h" | 82 #include "webkit/plugins/ppapi/ppb_widget_impl.h" |
| 82 #include "webkit/plugins/ppapi/resource_tracker.h" | 83 #include "webkit/plugins/ppapi/resource_tracker.h" |
| 83 #include "webkit/plugins/ppapi/var.h" | 84 #include "webkit/plugins/ppapi/var.h" |
| 84 #include "webkit/plugins/ppapi/var_object_class.h" | 85 #include "webkit/plugins/ppapi/var_object_class.h" |
| 85 | 86 |
| 86 #ifdef ENABLE_GPU | 87 #ifdef ENABLE_GPU |
| 87 #include "webkit/plugins/ppapi/ppb_context_3d_impl.h" | 88 #include "webkit/plugins/ppapi/ppb_context_3d_impl.h" |
| 89 #include "webkit/plugins/ppapi/ppb_gles_chromium_extension_impl.h" |
| 88 #include "webkit/plugins/ppapi/ppb_graphics_3d_impl.h" | 90 #include "webkit/plugins/ppapi/ppb_graphics_3d_impl.h" |
| 89 #include "webkit/plugins/ppapi/ppb_opengles_impl.h" | 91 #include "webkit/plugins/ppapi/ppb_opengles_impl.h" |
| 90 #include "webkit/plugins/ppapi/ppb_surface_3d_impl.h" | 92 #include "webkit/plugins/ppapi/ppb_surface_3d_impl.h" |
| 91 #endif // ENABLE_GPU | 93 #endif // ENABLE_GPU |
| 92 | 94 |
| 93 namespace webkit { | 95 namespace webkit { |
| 94 namespace ppapi { | 96 namespace ppapi { |
| 95 | 97 |
| 96 namespace { | 98 namespace { |
| 97 | 99 |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 if (strcmp(name, PPB_ZOOM_DEV_INTERFACE) == 0) | 284 if (strcmp(name, PPB_ZOOM_DEV_INTERFACE) == 0) |
| 283 return PluginInstance::GetZoomInterface(); | 285 return PluginInstance::GetZoomInterface(); |
| 284 | 286 |
| 285 #ifdef ENABLE_GPU | 287 #ifdef ENABLE_GPU |
| 286 // This should really refer to switches::kDisable3DAPIs. | 288 // This should really refer to switches::kDisable3DAPIs. |
| 287 if (!CommandLine::ForCurrentProcess()->HasSwitch("disable-3d-apis")) { | 289 if (!CommandLine::ForCurrentProcess()->HasSwitch("disable-3d-apis")) { |
| 288 if (strcmp(name, PPB_GRAPHICS_3D_DEV_INTERFACE) == 0) | 290 if (strcmp(name, PPB_GRAPHICS_3D_DEV_INTERFACE) == 0) |
| 289 return PPB_Graphics3D_Impl::GetInterface(); | 291 return PPB_Graphics3D_Impl::GetInterface(); |
| 290 if (strcmp(name, PPB_CONTEXT_3D_DEV_INTERFACE) == 0) | 292 if (strcmp(name, PPB_CONTEXT_3D_DEV_INTERFACE) == 0) |
| 291 return PPB_Context3D_Impl::GetInterface(); | 293 return PPB_Context3D_Impl::GetInterface(); |
| 294 if (strcmp(name, PPB_GLES_CHROMIUM_EXTENSION_DEV_INTERFACE) == 0) |
| 295 return PPB_GLESChromiumExtension_Impl::GetInterface(); |
| 292 if (strcmp(name, PPB_OPENGLES2_DEV_INTERFACE) == 0) | 296 if (strcmp(name, PPB_OPENGLES2_DEV_INTERFACE) == 0) |
| 293 return PPB_OpenGLES_Impl::GetInterface(); | 297 return PPB_OpenGLES_Impl::GetInterface(); |
| 294 if (strcmp(name, PPB_SURFACE_3D_DEV_INTERFACE) == 0) | 298 if (strcmp(name, PPB_SURFACE_3D_DEV_INTERFACE) == 0) |
| 295 return PPB_Surface3D_Impl::GetInterface(); | 299 return PPB_Surface3D_Impl::GetInterface(); |
| 296 } | 300 } |
| 297 #endif // ENABLE_GPU | 301 #endif // ENABLE_GPU |
| 298 | 302 |
| 299 // Only support the testing interface when the command line switch is | 303 // Only support the testing interface when the command line switch is |
| 300 // specified. This allows us to prevent people from (ab)using this interface | 304 // specified. This allows us to prevent people from (ab)using this interface |
| 301 // in production code. | 305 // in production code. |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 515 if (retval != 0) { | 519 if (retval != 0) { |
| 516 LOG(WARNING) << "PPP_InitializeModule returned failure " << retval; | 520 LOG(WARNING) << "PPP_InitializeModule returned failure " << retval; |
| 517 return false; | 521 return false; |
| 518 } | 522 } |
| 519 return true; | 523 return true; |
| 520 } | 524 } |
| 521 | 525 |
| 522 } // namespace ppapi | 526 } // namespace ppapi |
| 523 } // namespace webkit | 527 } // namespace webkit |
| 524 | 528 |
| OLD | NEW |