| Index: webkit/plugins/ppapi/plugin_module.cc
|
| ===================================================================
|
| --- webkit/plugins/ppapi/plugin_module.cc (revision 0)
|
| +++ webkit/plugins/ppapi/plugin_module.cc (working copy)
|
| @@ -2,7 +2,7 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#include "webkit/glue/plugins/pepper_plugin_module.h"
|
| +#include "webkit/plugins/ppapi/plugin_module.h"
|
|
|
| #include <set>
|
|
|
| @@ -48,42 +48,44 @@
|
| #include "ppapi/c/ppp_instance.h"
|
| #include "ppapi/c/trusted/ppb_image_data_trusted.h"
|
| #include "ppapi/c/trusted/ppb_url_loader_trusted.h"
|
| -#include "webkit/glue/plugins/pepper_audio.h"
|
| -#include "webkit/glue/plugins/pepper_buffer.h"
|
| -#include "webkit/glue/plugins/pepper_common.h"
|
| -#include "webkit/glue/plugins/pepper_char_set.h"
|
| -#include "webkit/glue/plugins/pepper_class.h"
|
| -#include "webkit/glue/plugins/pepper_cursor_control.h"
|
| -#include "webkit/glue/plugins/pepper_directory_reader.h"
|
| -#include "webkit/glue/plugins/pepper_file_chooser.h"
|
| -#include "webkit/glue/plugins/pepper_file_io.h"
|
| -#include "webkit/glue/plugins/pepper_file_ref.h"
|
| -#include "webkit/glue/plugins/pepper_file_system.h"
|
| -#include "webkit/glue/plugins/pepper_font.h"
|
| -#include "webkit/glue/plugins/pepper_graphics_2d.h"
|
| -#include "webkit/glue/plugins/pepper_image_data.h"
|
| -#include "webkit/glue/plugins/pepper_plugin_instance.h"
|
| -#include "webkit/glue/plugins/pepper_plugin_object.h"
|
| -#include "webkit/glue/plugins/pepper_private.h"
|
| -#include "webkit/glue/plugins/pepper_private2.h"
|
| -#include "webkit/glue/plugins/pepper_resource_tracker.h"
|
| -#include "webkit/glue/plugins/pepper_scrollbar.h"
|
| -#include "webkit/glue/plugins/pepper_transport.h"
|
| -#include "webkit/glue/plugins/pepper_url_loader.h"
|
| -#include "webkit/glue/plugins/pepper_url_request_info.h"
|
| -#include "webkit/glue/plugins/pepper_url_response_info.h"
|
| -#include "webkit/glue/plugins/pepper_url_util.h"
|
| -#include "webkit/glue/plugins/pepper_var.h"
|
| -#include "webkit/glue/plugins/pepper_video_decoder.h"
|
| -#include "webkit/glue/plugins/pepper_widget.h"
|
| -#include "webkit/glue/plugins/ppb_private.h"
|
| -#include "webkit/glue/plugins/ppb_private2.h"
|
| +#include "webkit/plugins/ppapi/common.h"
|
| +#include "webkit/plugins/ppapi/plugin_instance.h"
|
| +#include "webkit/plugins/ppapi/plugin_object.h"
|
| +#include "webkit/plugins/ppapi/ppb_audio_impl.h"
|
| +#include "webkit/plugins/ppapi/ppb_buffer_impl.h"
|
| +#include "webkit/plugins/ppapi/ppb_char_set_impl.h"
|
| +#include "webkit/plugins/ppapi/ppb_cursor_control_impl.h"
|
| +#include "webkit/plugins/ppapi/ppb_directory_reader_impl.h"
|
| +#include "webkit/plugins/ppapi/ppb_file_chooser_impl.h"
|
| +#include "webkit/plugins/ppapi/ppb_file_io_impl.h"
|
| +#include "webkit/plugins/ppapi/ppb_file_ref_impl.h"
|
| +#include "webkit/plugins/ppapi/ppb_file_system_impl.h"
|
| +#include "webkit/plugins/ppapi/ppb_flash.h"
|
| +#include "webkit/plugins/ppapi/ppb_flash_impl.h"
|
| +#include "webkit/plugins/ppapi/ppb_font_impl.h"
|
| +#include "webkit/plugins/ppapi/ppb_graphics_2d_impl.h"
|
| +#include "webkit/plugins/ppapi/ppb_image_data_impl.h"
|
| +#include "webkit/plugins/ppapi/ppb_pdf.h"
|
| +#include "webkit/plugins/ppapi/ppb_pdf_impl.h"
|
| +#include "webkit/plugins/ppapi/ppb_scrollbar_impl.h"
|
| +#include "webkit/plugins/ppapi/ppb_transport_impl.h"
|
| +#include "webkit/plugins/ppapi/ppb_url_loader_impl.h"
|
| +#include "webkit/plugins/ppapi/ppb_url_request_info_impl.h"
|
| +#include "webkit/plugins/ppapi/ppb_url_response_info_impl.h"
|
| +#include "webkit/plugins/ppapi/ppb_url_util_impl.h"
|
| +#include "webkit/plugins/ppapi/ppb_video_decoder_impl.h"
|
| +#include "webkit/plugins/ppapi/ppb_widget_impl.h"
|
| +#include "webkit/plugins/ppapi/resource_tracker.h"
|
| +#include "webkit/plugins/ppapi/var.h"
|
| +#include "webkit/plugins/ppapi/var_object_class.h"
|
|
|
| #ifdef ENABLE_GPU
|
| -#include "webkit/glue/plugins/pepper_graphics_3d.h"
|
| +#include "webkit/plugins/ppapi/ppb_graphics_3d_impl.h"
|
| #endif // ENABLE_GPU
|
|
|
| -namespace pepper {
|
| +namespace webkit {
|
| +namespace plugins {
|
| +namespace ppapi {
|
|
|
| namespace {
|
|
|
| @@ -162,10 +164,10 @@
|
| // PPB_Testing -----------------------------------------------------------------
|
|
|
| PP_Bool ReadImageData(PP_Resource device_context_2d,
|
| - PP_Resource image,
|
| - const PP_Point* top_left) {
|
| - scoped_refptr<Graphics2D> context(
|
| - Resource::GetAs<Graphics2D>(device_context_2d));
|
| + PP_Resource image,
|
| + const PP_Point* top_left) {
|
| + scoped_refptr<PPB_Graphics2D_Impl> context(
|
| + Resource::GetAs<PPB_Graphics2D_Impl>(device_context_2d));
|
| if (!context.get())
|
| return PP_FALSE;
|
| return BoolToPPBool(context->ReadImageData(image, top_left));
|
| @@ -199,83 +201,86 @@
|
| // GetInterface ----------------------------------------------------------------
|
|
|
| const void* GetInterface(const char* name) {
|
| - if (strcmp(name, PPB_CORE_INTERFACE) == 0)
|
| - return &core_interface;
|
| - if (strcmp(name, PPB_VAR_DEPRECATED_INTERFACE) == 0)
|
| - return Var::GetDeprecatedInterface();
|
| - if (strcmp(name, PPB_VAR_INTERFACE) == 0)
|
| - return Var::GetInterface();
|
| - if (strcmp(name, PPB_INSTANCE_INTERFACE) == 0)
|
| - return PluginInstance::GetInterface();
|
| - if (strcmp(name, PPB_IMAGEDATA_INTERFACE) == 0)
|
| - return ImageData::GetInterface();
|
| - if (strcmp(name, PPB_IMAGEDATA_TRUSTED_INTERFACE) == 0)
|
| - return ImageData::GetTrustedInterface();
|
| + // Please keep alphabetized by interface macro name with "special" stuff at
|
| + // the bottom.
|
| if (strcmp(name, PPB_AUDIO_CONFIG_DEV_INTERFACE) == 0)
|
| - return AudioConfig::GetInterface();
|
| + return PPB_AudioConfig_Impl::GetInterface();
|
| if (strcmp(name, PPB_AUDIO_DEV_INTERFACE) == 0)
|
| - return Audio::GetInterface();
|
| + return PPB_Audio_Impl::GetInterface();
|
| if (strcmp(name, PPB_AUDIO_TRUSTED_DEV_INTERFACE) == 0)
|
| - return Audio::GetTrustedInterface();
|
| - if (strcmp(name, PPB_GRAPHICS_2D_INTERFACE) == 0)
|
| - return Graphics2D::GetInterface();
|
| -#ifdef ENABLE_GPU
|
| - if (strcmp(name, PPB_GRAPHICS_3D_DEV_INTERFACE) == 0)
|
| - return Graphics3D::GetInterface();
|
| - if (strcmp(name, PPB_OPENGLES_DEV_INTERFACE) == 0)
|
| - return Graphics3D::GetOpenGLESInterface();
|
| -#endif // ENABLE_GPU
|
| - if (strcmp(name, PPB_TRANSPORT_DEV_INTERFACE) == 0)
|
| - return Transport::GetInterface();
|
| - if (strcmp(name, PPB_URLLOADER_INTERFACE) == 0)
|
| - return URLLoader::GetInterface();
|
| - if (strcmp(name, PPB_URLLOADERTRUSTED_INTERFACE) == 0)
|
| - return URLLoader::GetTrustedInterface();
|
| - if (strcmp(name, PPB_URLREQUESTINFO_INTERFACE) == 0)
|
| - return URLRequestInfo::GetInterface();
|
| - if (strcmp(name, PPB_URLRESPONSEINFO_INTERFACE) == 0)
|
| - return URLResponseInfo::GetInterface();
|
| + return PPB_Audio_Impl::GetTrustedInterface();
|
| if (strcmp(name, PPB_BUFFER_DEV_INTERFACE) == 0)
|
| - return Buffer::GetInterface();
|
| - if (strcmp(name, PPB_FILEREF_DEV_INTERFACE) == 0)
|
| - return FileRef::GetInterface();
|
| + return PPB_Buffer_Impl::GetInterface();
|
| + if (strcmp(name, PPB_CHAR_SET_DEV_INTERFACE) == 0)
|
| + return PPB_CharSet_Impl::GetInterface();
|
| + if (strcmp(name, PPB_CLASS_INTERFACE) == 0)
|
| + return VarObjectClass::GetInterface();
|
| + if (strcmp(name, PPB_CORE_INTERFACE) == 0)
|
| + return &core_interface;
|
| + if (strcmp(name, PPB_CURSOR_CONTROL_DEV_INTERFACE) == 0)
|
| + return GetCursorControlInterface();
|
| + if (strcmp(name, PPB_DIRECTORYREADER_DEV_INTERFACE) == 0)
|
| + return PPB_DirectoryReader_Impl::GetInterface();
|
| + if (strcmp(name, PPB_FILECHOOSER_DEV_INTERFACE) == 0)
|
| + return PPB_FileChooser_Impl::GetInterface();
|
| if (strcmp(name, PPB_FILEIO_DEV_INTERFACE) == 0)
|
| - return FileIO::GetInterface();
|
| + return PPB_FileIO_Impl::GetInterface();
|
| if (strcmp(name, PPB_FILEIOTRUSTED_DEV_INTERFACE) == 0)
|
| - return FileIO::GetTrustedInterface();
|
| + return PPB_FileIO_Impl::GetTrustedInterface();
|
| + if (strcmp(name, PPB_FILEREF_DEV_INTERFACE) == 0)
|
| + return PPB_FileRef_Impl::GetInterface();
|
| if (strcmp(name, PPB_FILESYSTEM_DEV_INTERFACE) == 0)
|
| - return FileSystem::GetInterface();
|
| - if (strcmp(name, PPB_DIRECTORYREADER_DEV_INTERFACE) == 0)
|
| - return DirectoryReader::GetInterface();
|
| - if (strcmp(name, PPB_WIDGET_DEV_INTERFACE) == 0)
|
| - return Widget::GetInterface();
|
| - if (strcmp(name, PPB_SCROLLBAR_DEV_INTERFACE) == 0)
|
| - return Scrollbar::GetInterface();
|
| - if (strcmp(name, PPB_FONT_DEV_INTERFACE) == 0)
|
| - return Font::GetInterface();
|
| + return PPB_FileSystem_Impl::GetInterface();
|
| if (strcmp(name, PPB_FIND_DEV_INTERFACE) == 0)
|
| return PluginInstance::GetFindInterface();
|
| + if (strcmp(name, PPB_FLASH_INTERFACE) == 0)
|
| + return PPB_Flash_Impl::GetInterface();
|
| + if (strcmp(name, PPB_FONT_DEV_INTERFACE) == 0)
|
| + return PPB_Font_Impl::GetInterface();
|
| if (strcmp(name, PPB_FULLSCREEN_DEV_INTERFACE) == 0)
|
| return PluginInstance::GetFullscreenInterface();
|
| + if (strcmp(name, PPB_GRAPHICS_2D_INTERFACE) == 0)
|
| + return PPB_Graphics2D_Impl::GetInterface();
|
| + if (strcmp(name, PPB_IMAGEDATA_INTERFACE) == 0)
|
| + return PPB_ImageData_Impl::GetInterface();
|
| + if (strcmp(name, PPB_IMAGEDATA_TRUSTED_INTERFACE) == 0)
|
| + return PPB_ImageData_Impl::GetTrustedInterface();
|
| + if (strcmp(name, PPB_INSTANCE_INTERFACE) == 0)
|
| + return PluginInstance::GetInterface();
|
| + if (strcmp(name, PPB_PDF_INTERFACE) == 0)
|
| + return PPB_Pdf_Impl::GetInterface();
|
| + if (strcmp(name, PPB_SCROLLBAR_DEV_INTERFACE) == 0)
|
| + return PPB_Scrollbar_Impl::GetInterface();
|
| + if (strcmp(name, PPB_TRANSPORT_DEV_INTERFACE) == 0)
|
| + return PPB_Transport_Impl::GetInterface();
|
| + if (strcmp(name, PPB_URLLOADER_INTERFACE) == 0)
|
| + return PPB_URLLoader_Impl::GetInterface();
|
| + if (strcmp(name, PPB_URLLOADERTRUSTED_INTERFACE) == 0)
|
| + return PPB_URLLoader_Impl::GetTrustedInterface();
|
| + if (strcmp(name, PPB_URLREQUESTINFO_INTERFACE) == 0)
|
| + return PPB_URLRequestInfo_Impl::GetInterface();
|
| + if (strcmp(name, PPB_URLRESPONSEINFO_INTERFACE) == 0)
|
| + return PPB_URLResponseInfo_Impl::GetInterface();
|
| if (strcmp(name, PPB_URLUTIL_DEV_INTERFACE) == 0)
|
| - return UrlUtil::GetInterface();
|
| - if (strcmp(name, PPB_PRIVATE_INTERFACE) == 0)
|
| - return Private::GetInterface();
|
| - if (strcmp(name, PPB_PRIVATE2_INTERFACE) == 0)
|
| - return Private2::GetInterface();
|
| - if (strcmp(name, PPB_FILECHOOSER_DEV_INTERFACE) == 0)
|
| - return FileChooser::GetInterface();
|
| + return PPB_UrlUtil_Impl::GetInterface();
|
| + if (strcmp(name, PPB_VAR_DEPRECATED_INTERFACE) == 0)
|
| + return Var::GetDeprecatedInterface();
|
| + if (strcmp(name, PPB_VAR_INTERFACE) == 0)
|
| + return Var::GetInterface();
|
| if (strcmp(name, PPB_VIDEODECODER_DEV_INTERFACE) == 0)
|
| - return VideoDecoder::GetInterface();
|
| - if (strcmp(name, PPB_CHAR_SET_DEV_INTERFACE) == 0)
|
| - return CharSet::GetInterface();
|
| - if (strcmp(name, PPB_CURSOR_CONTROL_DEV_INTERFACE) == 0)
|
| - return GetCursorControlInterface();
|
| + return PPB_VideoDecoder_Impl::GetInterface();
|
| + if (strcmp(name, PPB_WIDGET_DEV_INTERFACE) == 0)
|
| + return PPB_Widget_Impl::GetInterface();
|
| if (strcmp(name, PPB_ZOOM_DEV_INTERFACE) == 0)
|
| return PluginInstance::GetZoomInterface();
|
| - if (strcmp(name, PPB_CLASS_INTERFACE) == 0)
|
| - return VarObjectClass::GetInterface();
|
|
|
| +#ifdef ENABLE_GPU
|
| + if (strcmp(name, PPB_GRAPHICS_3D_DEV_INTERFACE) == 0)
|
| + return PPB_Graphics3D_Impl::GetInterface();
|
| + if (strcmp(name, PPB_OPENGLES_DEV_INTERFACE) == 0)
|
| + return PPB_Graphics3D_Impl::GetOpenGLESInterface();
|
| +#endif // ENABLE_GPU
|
| +
|
| // Only support the testing interface when the command line switch is
|
| // specified. This allows us to prevent people from (ab)using this interface
|
| // in production code.
|
| @@ -489,4 +494,7 @@
|
| return true;
|
| }
|
|
|
| -} // namespace pepper
|
| +} // namespace ppapi
|
| +} // namespace plugins
|
| +} // namespace webkit
|
| +
|
|
|