diff options
167 files changed, 1274 insertions, 1574 deletions
diff --git a/chrome/renderer/pepper/pepper_flash_drm_renderer_host.cc b/chrome/renderer/pepper/pepper_flash_drm_renderer_host.cc index 26b6ef4..ca59c7ef 100644 --- a/chrome/renderer/pepper/pepper_flash_drm_renderer_host.cc +++ b/chrome/renderer/pepper/pepper_flash_drm_renderer_host.cc @@ -5,7 +5,7 @@ #include "chrome/renderer/pepper/pepper_flash_drm_renderer_host.h" #include "base/files/file_path.h" -#include "content/public/renderer/ppapi_plugin_instance.h" +#include "content/public/renderer/pepper_plugin_instance.h" #include "content/public/renderer/renderer_ppapi_host.h" #include "ppapi/c/pp_errors.h" #include "ppapi/host/dispatch_host_message.h" @@ -46,7 +46,7 @@ int32_t PepperFlashDRMRendererHost::OnResourceMessageReceived( int32_t PepperFlashDRMRendererHost::OnGetVoucherFile( ppapi::host::HostMessageContext* context) { - webkit::ppapi::PluginInstance* plugin_instance = + content::PepperPluginInstance* plugin_instance = renderer_ppapi_host_->GetPluginInstance(pp_instance()); if (!plugin_instance) return PP_ERROR_FAILED; diff --git a/chrome/renderer/pepper/pepper_flash_fullscreen_host.cc b/chrome/renderer/pepper/pepper_flash_fullscreen_host.cc index edeb06b..37bea81 100644 --- a/chrome/renderer/pepper/pepper_flash_fullscreen_host.cc +++ b/chrome/renderer/pepper/pepper_flash_fullscreen_host.cc @@ -4,7 +4,7 @@ #include "chrome/renderer/pepper/pepper_flash_fullscreen_host.h" -#include "content/public/renderer/ppapi_plugin_instance.h" +#include "content/public/renderer/pepper_plugin_instance.h" #include "content/public/renderer/renderer_ppapi_host.h" #include "ppapi/c/pp_errors.h" #include "ppapi/host/dispatch_host_message.h" @@ -39,7 +39,7 @@ int32_t PepperFlashFullscreenHost::OnResourceMessageReceived( int32_t PepperFlashFullscreenHost::OnSetFullscreen( ppapi::host::HostMessageContext* context, bool fullscreen) { - webkit::ppapi::PluginInstance* plugin_instance = + content::PepperPluginInstance* plugin_instance = renderer_ppapi_host_->GetPluginInstance(pp_instance()); if (plugin_instance) { plugin_instance->FlashSetFullscreen(fullscreen, true); diff --git a/chrome/renderer/pepper/pepper_flash_renderer_host.cc b/chrome/renderer/pepper/pepper_flash_renderer_host.cc index 37561ae..e305946 100644 --- a/chrome/renderer/pepper/pepper_flash_renderer_host.cc +++ b/chrome/renderer/pepper/pepper_flash_renderer_host.cc @@ -7,7 +7,7 @@ #include <vector> #include "chrome/renderer/pepper/ppb_pdf_impl.h" -#include "content/public/renderer/ppapi_plugin_instance.h" +#include "content/public/renderer/pepper_plugin_instance.h" #include "content/public/renderer/render_thread.h" #include "content/public/renderer/renderer_ppapi_host.h" #include "ipc/ipc_message_macros.h" @@ -89,7 +89,7 @@ int32_t PepperFlashRendererHost::OnGetProxyForURL( int32_t PepperFlashRendererHost::OnSetInstanceAlwaysOnTop( ppapi::host::HostMessageContext* host_context, bool on_top) { - webkit::ppapi::PluginInstance* plugin_instance = + content::PepperPluginInstance* plugin_instance = host_->GetPluginInstance(pp_instance()); if (plugin_instance) plugin_instance->SetAlwaysOnTop(on_top); @@ -206,8 +206,8 @@ int32_t PepperFlashRendererHost::OnNavigate( const ppapi::URLRequestInfoData& data, const std::string& target, bool from_user_action) { - // If our PluginInstance is already destroyed, just return a failure. - webkit::ppapi::PluginInstance* plugin_instance = + // If our PepperPluginInstance is already destroyed, just return a failure. + content::PepperPluginInstance* plugin_instance = host_->GetPluginInstance(pp_instance()); if (!plugin_instance) return PP_ERROR_FAILED; @@ -242,7 +242,7 @@ int32_t PepperFlashRendererHost::OnNavigate( int32_t PepperFlashRendererHost::OnIsRectTopmost( ppapi::host::HostMessageContext* host_context, const PP_Rect& rect) { - webkit::ppapi::PluginInstance* plugin_instance = + content::PepperPluginInstance* plugin_instance = host_->GetPluginInstance(pp_instance()); if (plugin_instance && plugin_instance->IsRectTopmost( gfx::Rect(rect.point.x, rect.point.y,rect.size.width, rect.size.height))) diff --git a/chrome/renderer/pepper/pepper_pdf_host.cc b/chrome/renderer/pepper/pepper_pdf_host.cc index debaf9c..172b1bc 100644 --- a/chrome/renderer/pepper/pepper_pdf_host.cc +++ b/chrome/renderer/pepper/pepper_pdf_host.cc @@ -8,7 +8,7 @@ #include "chrome/common/render_messages.h" #include "chrome/renderer/printing/print_web_view_helper.h" #include "content/public/common/referrer.h" -#include "content/public/renderer/ppapi_plugin_instance.h" +#include "content/public/renderer/pepper_plugin_instance.h" #include "content/public/renderer/render_thread.h" #include "content/public/renderer/render_view.h" #include "content/public/renderer/renderer_ppapi_host.h" @@ -38,8 +38,6 @@ #include "ui/gfx/image/image_skia_rep.h" #include "ui/gfx/point.h" -using webkit::ppapi::PluginInstance; - namespace chrome { namespace { @@ -179,7 +177,8 @@ int32_t PepperPDFHost::OnHostMsgGetLocalizedString( int32_t PepperPDFHost::OnHostMsgDidStartLoading( ppapi::host::HostMessageContext* context) { - PluginInstance* instance = host_->GetPluginInstance(pp_instance()); + content::PepperPluginInstance* instance = + host_->GetPluginInstance(pp_instance()); if (!instance) return PP_ERROR_FAILED; instance->GetRenderView()->DidStartLoading(); @@ -188,7 +187,8 @@ int32_t PepperPDFHost::OnHostMsgDidStartLoading( int32_t PepperPDFHost::OnHostMsgDidStopLoading( ppapi::host::HostMessageContext* context) { - PluginInstance* instance = host_->GetPluginInstance(pp_instance()); + content::PepperPluginInstance* instance = + host_->GetPluginInstance(pp_instance()); if (!instance) return PP_ERROR_FAILED; instance->GetRenderView()->DidStopLoading(); @@ -197,7 +197,8 @@ int32_t PepperPDFHost::OnHostMsgDidStopLoading( int32_t PepperPDFHost::OnHostMsgSetContentRestriction( ppapi::host::HostMessageContext* context, int restrictions) { - PluginInstance* instance = host_->GetPluginInstance(pp_instance()); + content::PepperPluginInstance* instance = + host_->GetPluginInstance(pp_instance()); if (!instance) return PP_ERROR_FAILED; instance->GetRenderView()->Send( @@ -226,7 +227,8 @@ int32_t PepperPDFHost::OnHostMsgUserMetricsRecordAction( int32_t PepperPDFHost::OnHostMsgHasUnsupportedFeature( ppapi::host::HostMessageContext* context) { - PluginInstance* instance = host_->GetPluginInstance(pp_instance()); + content::PepperPluginInstance* instance = + host_->GetPluginInstance(pp_instance()); if (!instance) return PP_ERROR_FAILED; @@ -245,7 +247,8 @@ int32_t PepperPDFHost::OnHostMsgHasUnsupportedFeature( int32_t PepperPDFHost::OnHostMsgPrint( ppapi::host::HostMessageContext* context) { #if defined(ENABLE_PRINTING) - PluginInstance* instance = host_->GetPluginInstance(pp_instance()); + content::PepperPluginInstance* instance = + host_->GetPluginInstance(pp_instance()); if (!instance) return PP_ERROR_FAILED; @@ -265,7 +268,8 @@ int32_t PepperPDFHost::OnHostMsgPrint( int32_t PepperPDFHost::OnHostMsgSaveAs( ppapi::host::HostMessageContext* context) { - PluginInstance* instance = host_->GetPluginInstance(pp_instance()); + content::PepperPluginInstance* instance = + host_->GetPluginInstance(pp_instance()); if (!instance) return PP_ERROR_FAILED; GURL url = instance->GetPluginURL(); diff --git a/chrome/renderer/pepper/pepper_shared_memory_message_filter.cc b/chrome/renderer/pepper/pepper_shared_memory_message_filter.cc index 00724e4..8aafd70e 100644 --- a/chrome/renderer/pepper/pepper_shared_memory_message_filter.cc +++ b/chrome/renderer/pepper/pepper_shared_memory_message_filter.cc @@ -8,7 +8,7 @@ #include "base/memory/shared_memory.h" #include "base/process/process_handle.h" #include "content/public/common/content_client.h" -#include "content/public/renderer/ppapi_plugin_instance.h" +#include "content/public/renderer/pepper_plugin_instance.h" #include "content/public/renderer/render_thread.h" #include "content/public/renderer/renderer_ppapi_host.h" #include "ppapi/host/ppapi_host.h" @@ -55,7 +55,7 @@ void PepperSharedMemoryMessageFilter::OnHostMsgCreateSharedMemory( base::SharedMemoryHandle host_shm_handle; shm->ShareToProcess(base::GetCurrentProcessHandle(), &host_shm_handle); - *host_handle_id = webkit::ppapi::PluginInstance::Get(instance)-> + *host_handle_id = content::PepperPluginInstance::Get(instance)-> GetVarTracker()->TrackSharedMemoryHandle(instance, host_shm_handle, size); base::PlatformFile host_handle = diff --git a/chrome/renderer/pepper/ppb_nacl_private_impl.cc b/chrome/renderer/pepper/ppb_nacl_private_impl.cc index 7ffe277..2c8d603 100644 --- a/chrome/renderer/pepper/ppb_nacl_private_impl.cc +++ b/chrome/renderer/pepper/ppb_nacl_private_impl.cc @@ -18,7 +18,7 @@ #include "content/public/common/content_client.h" #include "content/public/common/content_switches.h" #include "content/public/common/sandbox_init.h" -#include "content/public/renderer/ppapi_plugin_instance.h" +#include "content/public/renderer/pepper_plugin_instance.h" #include "content/public/renderer/renderer_ppapi_host.h" #include "content/public/renderer/render_thread.h" #include "content/public/renderer/render_view.h" @@ -159,8 +159,8 @@ PP_ExternalPluginResult StartPpapiProxy(PP_Instance instance) { InstanceInfo instance_info = it->second; map.erase(it); - webkit::ppapi::PluginInstance* plugin_instance = - webkit::ppapi::PluginInstance::Get(instance); + content::PepperPluginInstance* plugin_instance = + content::PepperPluginInstance::Get(instance); if (!plugin_instance) { DLOG(ERROR) << "GetInstance() failed"; return PP_EXTERNAL_PLUGIN_ERROR_MODULE; diff --git a/chrome/renderer/pepper/ppb_pdf_impl.cc b/chrome/renderer/pepper/ppb_pdf_impl.cc index 0ac88b2..85e92e1 100644 --- a/chrome/renderer/pepper/ppb_pdf_impl.cc +++ b/chrome/renderer/pepper/ppb_pdf_impl.cc @@ -14,7 +14,7 @@ #include "chrome/renderer/printing/print_web_view_helper.h" #include "content/public/common/child_process_sandbox_support_linux.h" #include "content/public/common/referrer.h" -#include "content/public/renderer/ppapi_plugin_instance.h" +#include "content/public/renderer/pepper_plugin_instance.h" #include "content/public/renderer/render_thread.h" #include "content/public/renderer/render_view.h" #include "grit/webkit_resources.h" @@ -38,7 +38,6 @@ #include "ui/base/resource/resource_bundle.h" using ppapi::PpapiGlobals; -using webkit::ppapi::PluginInstance; using WebKit::WebElement; using WebKit::WebView; using content::RenderThread; @@ -134,7 +133,8 @@ static const ResourceImageInfo kResourceImageMap[] = { #if defined(ENABLE_PRINTING) WebKit::WebElement GetWebElement(PP_Instance instance_id) { - PluginInstance* instance = PluginInstance::Get(instance_id); + content::PepperPluginInstance* instance = + content::PepperPluginInstance::Get(instance_id); if (!instance) return WebKit::WebElement(); return instance->GetContainer()->element(); @@ -167,7 +167,8 @@ bool IsPrintingEnabled(PP_Instance instance_id) { PP_Var GetLocalizedString(PP_Instance instance_id, PP_ResourceString string_id) { - PluginInstance* instance = PluginInstance::Get(instance_id); + content::PepperPluginInstance* instance = + content::PepperPluginInstance::Get(instance_id); if (!instance) return PP_MakeUndefined(); @@ -193,7 +194,7 @@ PP_Resource GetFontFileWithFallback( PP_PrivateFontCharset charset) { #if defined(OS_LINUX) || defined(OS_OPENBSD) // Validate the instance before using it below. - if (!PluginInstance::Get(instance_id)) + if (!content::PepperPluginInstance::Get(instance_id)) return 0; scoped_refptr<ppapi::StringVar> face_name(ppapi::StringVar::FromPPVar( @@ -287,21 +288,24 @@ void SearchString(PP_Instance instance, } void DidStartLoading(PP_Instance instance_id) { - PluginInstance* instance = PluginInstance::Get(instance_id); + content::PepperPluginInstance* instance = + content::PepperPluginInstance::Get(instance_id); if (!instance) return; instance->GetRenderView()->DidStartLoading(); } void DidStopLoading(PP_Instance instance_id) { - PluginInstance* instance = PluginInstance::Get(instance_id); + content::PepperPluginInstance* instance = + content::PepperPluginInstance::Get(instance_id); if (!instance) return; instance->GetRenderView()->DidStopLoading(); } void SetContentRestriction(PP_Instance instance_id, int restrictions) { - PluginInstance* instance = PluginInstance::Get(instance_id); + content::PepperPluginInstance* instance = + content::PepperPluginInstance::Get(instance_id); if (!instance) return; instance->GetRenderView()->Send( @@ -321,7 +325,8 @@ void UserMetricsRecordAction(PP_Instance instance, PP_Var action) { } void HasUnsupportedFeature(PP_Instance instance_id) { - PluginInstance* instance = PluginInstance::Get(instance_id); + content::PepperPluginInstance* instance = + content::PepperPluginInstance::Get(instance_id); if (!instance) return; @@ -336,7 +341,8 @@ void HasUnsupportedFeature(PP_Instance instance_id) { } void SaveAs(PP_Instance instance_id) { - PluginInstance* instance = PluginInstance::Get(instance_id); + content::PepperPluginInstance* instance = + content::PepperPluginInstance::Get(instance_id); if (!instance) return; GURL url = instance->GetPluginURL(); @@ -373,7 +379,8 @@ PP_Resource GetResourceImageForScale(PP_Instance instance_id, return 0; // Validate the instance. - PluginInstance* instance = PluginInstance::Get(instance_id); + content::PepperPluginInstance* instance = + content::PepperPluginInstance::Get(instance_id); if (!instance) return 0; diff --git a/content/content_renderer.gypi b/content/content_renderer.gypi index 88ae322..c7975cf 100644 --- a/content/content_renderer.gypi +++ b/content/content_renderer.gypi @@ -46,7 +46,7 @@ 'public/renderer/navigation_state.cc', 'public/renderer/navigation_state.h', 'public/renderer/password_form_conversion_utils.h', - 'public/renderer/ppapi_plugin_instance.h', + 'public/renderer/pepper_plugin_instance.h', 'public/renderer/renderer_ppapi_host.h', 'public/renderer/render_frame.h', 'public/renderer/render_process_observer.cc', @@ -320,6 +320,8 @@ 'renderer/pepper/pepper_platform_video_capture_impl.h', 'renderer/pepper/pepper_plugin_delegate_impl.cc', 'renderer/pepper/pepper_plugin_delegate_impl.h', + 'renderer/pepper/pepper_plugin_instance_impl.cc', + 'renderer/pepper/pepper_plugin_instance_impl.h', 'renderer/pepper/pepper_plugin_registry.cc', 'renderer/pepper/pepper_plugin_registry.h', 'renderer/pepper/pepper_proxy_channel_delegate_impl.cc', @@ -335,6 +337,8 @@ 'renderer/pepper/pepper_url_loader_host.h', 'renderer/pepper/pepper_video_capture_host.cc', 'renderer/pepper/pepper_video_capture_host.h', + 'renderer/pepper/pepper_webplugin_impl.cc', + 'renderer/pepper/pepper_webplugin_impl.h', 'renderer/pepper/pepper_websocket_host.cc', 'renderer/pepper/pepper_websocket_host.h', 'renderer/pepper/plugin_delegate.h', @@ -344,10 +348,6 @@ 'renderer/pepper/plugin_object.h', 'renderer/pepper/ppapi_interface_factory.cc', 'renderer/pepper/ppapi_interface_factory.h', - 'renderer/pepper/ppapi_plugin_instance_impl.cc', - 'renderer/pepper/ppapi_plugin_instance_impl.h', - 'renderer/pepper/ppapi_webplugin_impl.cc', - 'renderer/pepper/ppapi_webplugin_impl.h', 'renderer/pepper/ppb_audio_impl.cc', 'renderer/pepper/ppb_audio_impl.h', 'renderer/pepper/ppb_broker_impl.cc', diff --git a/content/content_tests.gypi b/content/content_tests.gypi index dd31481..6e69912 100644 --- a/content/content_tests.gypi +++ b/content/content_tests.gypi @@ -437,7 +437,7 @@ 'renderer/pepper/mock_plugin_delegate.cc', 'renderer/pepper/mock_plugin_delegate.h', 'renderer/pepper/mock_resource.h', - 'renderer/pepper/ppapi_plugin_instance_unittest.cc', + 'renderer/pepper/pepper_plugin_instance_unittest.cc', 'renderer/pepper/ppapi_unittest.cc', 'renderer/pepper/ppapi_unittest.h', 'renderer/pepper/quota_file_io_unittest.cc', diff --git a/content/public/renderer/ppapi_plugin_instance.h b/content/public/renderer/pepper_plugin_instance.h index 1e56e4c..211752d 100644 --- a/content/public/renderer/ppapi_plugin_instance.h +++ b/content/public/renderer/pepper_plugin_instance.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CONTENT_PUBLIC_PPAPI_PLUGIN_INSTANCE_H_ -#define CONTENT_PUBLIC_PPAPI_PLUGIN_INSTANCE_H_ +#ifndef CONTENT_PUBLIC_RENDERER_PEPPER_PLUGIN_INSTANCE_H_ +#define CONTENT_PUBLIC_RENDERER_PEPPER_PLUGIN_INSTANCE_H_ #include "base/basictypes.h" #include "base/process/process_handle.h" @@ -17,10 +17,6 @@ namespace base { class FilePath; } -namespace content { -class RenderView; -} - namespace gfx { class ImageSkia; class Rect; @@ -40,20 +36,20 @@ namespace WebKit { class WebPluginContainer; } -namespace webkit { -namespace ppapi { +namespace content { +class RenderView; -class PluginInstance { +class PepperPluginInstance { public: - static CONTENT_EXPORT PluginInstance* Get(PP_Instance instance_id); + static CONTENT_EXPORT PepperPluginInstance* Get(PP_Instance instance_id); - virtual ~PluginInstance() {} + virtual ~PepperPluginInstance() {} virtual content::RenderView* GetRenderView() = 0; virtual WebKit::WebPluginContainer* GetContainer() = 0; - virtual ::ppapi::VarTracker* GetVarTracker() = 0; + virtual ppapi::VarTracker* GetVarTracker() = 0; virtual const GURL& GetPluginURL() = 0; @@ -72,7 +68,7 @@ class PluginInstance { // Switches this instance with one that uses the out of process IPC proxy. virtual PP_ExternalPluginResult SwitchToOutOfProcessProxy( const base::FilePath& file_path, - ::ppapi::PpapiPermissions permissions, + ppapi::PpapiPermissions permissions, const IPC::ChannelHandle& channel_handle, base::ProcessId plugin_pid, int plugin_child_id) = 0; @@ -93,13 +89,12 @@ class PluginInstance { virtual bool IsRectTopmost(const gfx::Rect& rect) = 0; - virtual int32_t Navigate(const ::ppapi::URLRequestInfoData& request, + virtual int32_t Navigate(const ppapi::URLRequestInfoData& request, const char* target, bool from_user_action) = 0; }; -} // namespace ppapi -} // namespace webkit +} // namespace content -#endif // CONTENT_PUBLIC_PPAPI_PLUGIN_INSTANCE_H_ +#endif // CONTENT_PUBLIC_RENDERER_PEPPER_PLUGIN_INSTANCE_H_ diff --git a/content/public/renderer/renderer_ppapi_host.h b/content/public/renderer/renderer_ppapi_host.h index afbf600..329961e 100644 --- a/content/public/renderer/renderer_ppapi_host.h +++ b/content/public/renderer/renderer_ppapi_host.h @@ -35,14 +35,8 @@ namespace WebKit { class WebPluginContainer; } -namespace webkit { -namespace ppapi { -class PluginInstance; -} -} - namespace content { - +class PepperPluginInstance; class RenderView; // Interface that allows components in the embedder app to talk to the @@ -66,7 +60,7 @@ class RendererPpapiHost { // Returns the PluginInstance for the given PP_Instance, or NULL if the // PP_Instance is invalid (the common case this will be invalid is during // plugin teardown when resource hosts are being force-freed). - virtual webkit::ppapi::PluginInstance* GetPluginInstance( + virtual PepperPluginInstance* GetPluginInstance( PP_Instance instance) const = 0; // Returns the RenderView for the given plugin instance, or NULL if the diff --git a/content/renderer/media/crypto/content_decryption_module_factory.cc b/content/renderer/media/crypto/content_decryption_module_factory.cc index 3138be2..3ce22f3 100644 --- a/content/renderer/media/crypto/content_decryption_module_factory.cc +++ b/content/renderer/media/crypto/content_decryption_module_factory.cc @@ -10,8 +10,8 @@ #if defined(ENABLE_PEPPER_CDMS) #include "content/renderer/media/crypto/ppapi_decryptor.h" -#include "content/renderer/pepper/ppapi_plugin_instance_impl.h" -#include "content/renderer/pepper/ppapi_webplugin_impl.h" +#include "content/renderer/pepper/pepper_plugin_instance_impl.h" +#include "content/renderer/pepper/pepper_webplugin_impl.h" #include "third_party/WebKit/public/platform/WebString.h" #include "third_party/WebKit/public/web/WebFrame.h" #include "third_party/WebKit/public/web/WebMediaPlayerClient.h" @@ -23,10 +23,10 @@ namespace content { #if defined(ENABLE_PEPPER_CDMS) -// Returns the PluginInstanceImpl associated with the Helper Plugin. +// Returns the PepperPluginInstanceImpl associated with the Helper Plugin. // If a non-NULL pointer is returned, the caller must call closeHelperPlugin() // when the Helper Plugin is no longer needed. -static scoped_refptr<webkit::ppapi::PluginInstanceImpl> CreateHelperPlugin( +static scoped_refptr<PepperPluginInstanceImpl> CreateHelperPlugin( const std::string& plugin_type, WebKit::WebMediaPlayerClient* web_media_player_client, WebKit::WebFrame* web_frame) { @@ -40,8 +40,8 @@ static scoped_refptr<webkit::ppapi::PluginInstanceImpl> CreateHelperPlugin( DCHECK(!web_plugin->isPlaceholder()); // Prevented by Blink. // Only Pepper plugins are supported, so it must be a ppapi object. - webkit::ppapi::WebPluginImpl* ppapi_plugin = - static_cast<webkit::ppapi::WebPluginImpl*>(web_plugin); + PepperWebPluginImpl* ppapi_plugin = + static_cast<PepperWebPluginImpl*>(web_plugin); return ppapi_plugin->instance(); } @@ -58,7 +58,7 @@ static scoped_ptr<media::MediaKeys> CreatePpapiDecryptor( std::string plugin_type = GetPepperType(key_system); DCHECK(!plugin_type.empty()); - const scoped_refptr<webkit::ppapi::PluginInstanceImpl>& plugin_instance = + const scoped_refptr<PepperPluginInstanceImpl>& plugin_instance = CreateHelperPlugin(plugin_type, web_media_player_client, web_frame); if (!plugin_instance.get()) { DLOG(ERROR) << "ProxyDecryptor: plugin instance creation failed."; diff --git a/content/renderer/media/crypto/ppapi_decryptor.cc b/content/renderer/media/crypto/ppapi_decryptor.cc index 7bf2aab8..8d5bdf9 100644 --- a/content/renderer/media/crypto/ppapi_decryptor.cc +++ b/content/renderer/media/crypto/ppapi_decryptor.cc @@ -13,7 +13,7 @@ #include "base/message_loop/message_loop.h" #include "base/message_loop/message_loop_proxy.h" #include "content/renderer/pepper/content_decryptor_delegate.h" -#include "content/renderer/pepper/ppapi_plugin_instance_impl.h" +#include "content/renderer/pepper/pepper_plugin_instance_impl.h" #include "media/base/audio_decoder_config.h" #include "media/base/data_buffer.h" #include "media/base/decoder_buffer.h" @@ -24,12 +24,12 @@ namespace content { scoped_ptr<PpapiDecryptor> PpapiDecryptor::Create( const std::string& key_system, - const scoped_refptr<webkit::ppapi::PluginInstanceImpl>& plugin_instance, + const scoped_refptr<PepperPluginInstanceImpl>& plugin_instance, const media::KeyAddedCB& key_added_cb, const media::KeyErrorCB& key_error_cb, const media::KeyMessageCB& key_message_cb, const base::Closure& destroy_plugin_cb) { - webkit::ppapi::ContentDecryptorDelegate* plugin_cdm_delegate = + ContentDecryptorDelegate* plugin_cdm_delegate = plugin_instance->GetContentDecryptorDelegate(); if (!plugin_cdm_delegate) { DVLOG(1) << "PpapiDecryptor: plugin cdm delegate creation failed."; @@ -47,8 +47,8 @@ scoped_ptr<PpapiDecryptor> PpapiDecryptor::Create( } PpapiDecryptor::PpapiDecryptor( - const scoped_refptr<webkit::ppapi::PluginInstanceImpl>& plugin_instance, - webkit::ppapi::ContentDecryptorDelegate* plugin_cdm_delegate, + const scoped_refptr<PepperPluginInstanceImpl>& plugin_instance, + ContentDecryptorDelegate* plugin_cdm_delegate, const media::KeyAddedCB& key_added_cb, const media::KeyErrorCB& key_error_cb, const media::KeyMessageCB& key_message_cb, diff --git a/content/renderer/media/crypto/ppapi_decryptor.h b/content/renderer/media/crypto/ppapi_decryptor.h index 39c84af..327ecc6 100644 --- a/content/renderer/media/crypto/ppapi_decryptor.h +++ b/content/renderer/media/crypto/ppapi_decryptor.h @@ -19,14 +19,9 @@ namespace base { class MessageLoopProxy; } -namespace webkit { -namespace ppapi { -class ContentDecryptorDelegate; -class PluginInstanceImpl; -} -} - namespace content { +class ContentDecryptorDelegate; +class PepperPluginInstanceImpl; // PpapiDecryptor implements media::Decryptor and forwards all calls to the // PluginInstance. @@ -36,7 +31,7 @@ class PpapiDecryptor : public media::MediaKeys, public media::Decryptor { static scoped_ptr<PpapiDecryptor> Create( // TODO(ddorwin): Remove after updating the delegate. const std::string& key_system, - const scoped_refptr<webkit::ppapi::PluginInstanceImpl>& plugin_instance, + const scoped_refptr<PepperPluginInstanceImpl>& plugin_instance, const media::KeyAddedCB& key_added_cb, const media::KeyErrorCB& key_error_cb, const media::KeyMessageCB& key_message_cb, @@ -76,8 +71,8 @@ class PpapiDecryptor : public media::MediaKeys, public media::Decryptor { private: PpapiDecryptor( - const scoped_refptr<webkit::ppapi::PluginInstanceImpl>& plugin_instance, - webkit::ppapi::ContentDecryptorDelegate* plugin_cdm_delegate, + const scoped_refptr<PepperPluginInstanceImpl>& plugin_instance, + ContentDecryptorDelegate* plugin_cdm_delegate, const media::KeyAddedCB& key_added_cb, const media::KeyErrorCB& key_error_cb, const media::KeyMessageCB& key_message_cb, @@ -99,9 +94,9 @@ class PpapiDecryptor : public media::MediaKeys, public media::Decryptor { // Hold a reference of the plugin instance to make sure the plugin outlives // the |plugin_cdm_delegate_|. This is needed because |plugin_cdm_delegate_| // is owned by the |plugin_instance_|. - scoped_refptr<webkit::ppapi::PluginInstanceImpl> plugin_instance_; + scoped_refptr<PepperPluginInstanceImpl> plugin_instance_; - webkit::ppapi::ContentDecryptorDelegate* plugin_cdm_delegate_; + ContentDecryptorDelegate* plugin_cdm_delegate_; // Callbacks for firing key events. media::KeyAddedCB key_added_cb_; diff --git a/content/renderer/media/pepper_platform_video_decoder_impl.h b/content/renderer/media/pepper_platform_video_decoder_impl.h index d3fc9a9..b63fdcd 100644 --- a/content/renderer/media/pepper_platform_video_decoder_impl.h +++ b/content/renderer/media/pepper_platform_video_decoder_impl.h @@ -16,7 +16,7 @@ namespace content { class PlatformVideoDecoderImpl - : public webkit::ppapi::PluginDelegate::PlatformVideoDecoder, + : public PluginDelegate::PlatformVideoDecoder, public media::VideoDecodeAccelerator::Client { public: PlatformVideoDecoderImpl( diff --git a/content/renderer/media/video_destination_handler.cc b/content/renderer/media/video_destination_handler.cc index 81ab07f..7438c49 100644 --- a/content/renderer/media/video_destination_handler.cc +++ b/content/renderer/media/video_destination_handler.cc @@ -18,7 +18,6 @@ using cricket::CaptureState; using cricket::VideoFormat; -using webkit::ppapi::PPB_ImageData_Impl; using webrtc::VideoTrackInterface; using webrtc::VideoTrackVector; @@ -100,7 +99,7 @@ void PpFrameWriter::PutFrame(PPB_ImageData_Impl* image_data, LOG(ERROR) << "PpFrameWriter::PutFrame - Called with NULL image_data."; return; } - webkit::ppapi::ImageDataAutoMapper mapper(image_data); + ImageDataAutoMapper mapper(image_data); if (!mapper.is_valid()) { LOG(ERROR) << "PpFrameWriter::PutFrame - " << "The image could not be mapped and is unusable."; @@ -148,7 +147,7 @@ class PpFrameWriterProxy : public FrameWriterInterface { virtual ~PpFrameWriterProxy() {} - virtual void PutFrame(webkit::ppapi::PPB_ImageData_Impl* image_data, + virtual void PutFrame(PPB_ImageData_Impl* image_data, int64 time_stamp_ns) OVERRIDE { writer_->PutFrame(image_data, time_stamp_ns); } diff --git a/content/renderer/media/video_destination_handler.h b/content/renderer/media/video_destination_handler.h index 68b1a6c..087d3ac 100644 --- a/content/renderer/media/video_destination_handler.h +++ b/content/renderer/media/video_destination_handler.h @@ -13,16 +13,11 @@ #include "content/common/content_export.h" #include "third_party/libjingle/source/talk/media/base/videocapturer.h" -namespace webkit { -namespace ppapi { -class PPB_ImageData_Impl; -} -} - namespace content { class MediaStreamDependencyFactory; class MediaStreamRegistryInterface; +class PPB_ImageData_Impl; // Interface used by the effects pepper plugin to output the processed frame // to the video track. @@ -30,7 +25,7 @@ class CONTENT_EXPORT FrameWriterInterface { public: // The ownership of the |image_data| deosn't transfer. So the implementation // of this interface should make a copy of the |image_data| before return. - virtual void PutFrame(webkit::ppapi::PPB_ImageData_Impl* image_data, + virtual void PutFrame(PPB_ImageData_Impl* image_data, int64 time_stamp_ns) = 0; virtual ~FrameWriterInterface() {} }; @@ -59,7 +54,7 @@ class CONTENT_EXPORT PpFrameWriter // FrameWriterInterface implementation. // This method will be called by the Pepper host from render thread. - virtual void PutFrame(webkit::ppapi::PPB_ImageData_Impl* image_data, + virtual void PutFrame(PPB_ImageData_Impl* image_data, int64 time_stamp_ns) OVERRIDE; private: diff --git a/content/renderer/media/webmediaplayer_impl.cc b/content/renderer/media/webmediaplayer_impl.cc index dac94c6..7cece16 100644 --- a/content/renderer/media/webmediaplayer_impl.cc +++ b/content/renderer/media/webmediaplayer_impl.cc @@ -28,7 +28,7 @@ #include "content/renderer/media/webmediaplayer_params.h" #include "content/renderer/media/webmediaplayer_util.h" #include "content/renderer/media/webmediasourceclient_impl.h" -#include "content/renderer/pepper/ppapi_webplugin_impl.h" +#include "content/renderer/pepper/pepper_webplugin_impl.h" #include "gpu/GLES2/gl2extchromium.h" #include "media/audio/null_audio_sink.h" #include "media/base/bind_to_loop.h" diff --git a/content/renderer/pepper/audio_helper.cc b/content/renderer/pepper/audio_helper.cc index 7eb0d87..8197d7a 100644 --- a/content/renderer/pepper/audio_helper.cc +++ b/content/renderer/pepper/audio_helper.cc @@ -10,8 +10,7 @@ using ppapi::TrackedCallback; -namespace webkit { -namespace ppapi { +namespace content { // AudioHelper ----------------------------------------------------------------- @@ -84,5 +83,4 @@ void AudioHelper::SetCreateCallback( create_callback_ = create_callback; } -} // namespace ppapi -} // namespace webkit +} // namespace content
\ No newline at end of file diff --git a/content/renderer/pepper/audio_helper.h b/content/renderer/pepper/audio_helper.h index 854ac9a..7ffeb24 100644 --- a/content/renderer/pepper/audio_helper.h +++ b/content/renderer/pepper/audio_helper.h @@ -15,8 +15,7 @@ #include "ppapi/shared_impl/scoped_pp_resource.h" #include "ppapi/shared_impl/tracked_callback.h" -namespace webkit { -namespace ppapi { +namespace content { class AudioHelper : public PluginDelegate::PlatformAudioOutputClient { public: @@ -57,7 +56,6 @@ class AudioHelper : public PluginDelegate::PlatformAudioOutputClient { DISALLOW_COPY_AND_ASSIGN(AudioHelper); }; -} // namespace ppapi -} // namespace webkit +} // namespace content #endif // CONTENT_RENDERER_PEPPER_AUDIO_HELPER_H_ diff --git a/content/renderer/pepper/common.h b/content/renderer/pepper/common.h index ed51b62..9b440bf 100644 --- a/content/renderer/pepper/common.h +++ b/content/renderer/pepper/common.h @@ -8,8 +8,7 @@ #include "ppapi/c/pp_bool.h" #include "ppapi/c/pp_var.h" -namespace webkit { -namespace ppapi { +namespace content { inline PP_Bool BoolToPPBool(bool value) { return value ? PP_TRUE : PP_FALSE; @@ -19,8 +18,7 @@ inline bool PPBoolToBool(PP_Bool value) { return (PP_TRUE == value); } -} // namespace ppapi -} // namespace webkit +} // namespace content #endif // CONTENT_RENDERER_PEPPER_COMMON_H_ diff --git a/content/renderer/pepper/content_decryptor_delegate.cc b/content/renderer/pepper/content_decryptor_delegate.cc index 79d9cff..22c3aff 100644 --- a/content/renderer/pepper/content_decryptor_delegate.cc +++ b/content/renderer/pepper/content_decryptor_delegate.cc @@ -33,8 +33,7 @@ using ppapi::StringVar; using ppapi::thunk::EnterResourceNoLock; using ppapi::thunk::PPB_Buffer_API; -namespace webkit { -namespace ppapi { +namespace content { namespace { @@ -1047,5 +1046,4 @@ bool ContentDecryptorDelegate::DeserializeAudioFrames( return true; } -} // namespace ppapi -} // namespace webkit +} // namespace content diff --git a/content/renderer/pepper/content_decryptor_delegate.h b/content/renderer/pepper/content_decryptor_delegate.h index 8f7ad31..ca54d98 100644 --- a/content/renderer/pepper/content_decryptor_delegate.h +++ b/content/renderer/pepper/content_decryptor_delegate.h @@ -25,8 +25,7 @@ class DecoderBuffer; class VideoDecoderConfig; } -namespace webkit { -namespace ppapi { +namespace content { class PPB_Buffer_Impl; @@ -189,7 +188,6 @@ class ContentDecryptorDelegate { DISALLOW_COPY_AND_ASSIGN(ContentDecryptorDelegate); }; -} // namespace ppapi -} // namespace webkit +} // namespace content #endif // CONTENT_RENDERER_PEPPER_CONTENT_DECRYPTOR_DELEGATE_H_ diff --git a/content/renderer/pepper/content_renderer_pepper_host_factory.cc b/content/renderer/pepper/content_renderer_pepper_host_factory.cc index d7872c9..983e185 100644 --- a/content/renderer/pepper/content_renderer_pepper_host_factory.cc +++ b/content/renderer/pepper/content_renderer_pepper_host_factory.cc @@ -33,9 +33,10 @@ using ppapi::host::ResourceHost; using ppapi::proxy::SerializedTrueTypeFontDesc; using ppapi::UnpackMessage; +namespace content { namespace { -bool CanUseMediaStreamAPI(const content::RendererPpapiHost* host, +bool CanUseMediaStreamAPI(const RendererPpapiHost* host, PP_Instance instance) { WebKit::WebPluginContainer* container = host->GetContainerForInstance(instance); @@ -43,15 +44,13 @@ bool CanUseMediaStreamAPI(const content::RendererPpapiHost* host, return false; GURL document_url = container->element().document().url(); - content::ContentRendererClient* content_renderer_client = - content::GetContentClient()->renderer(); + ContentRendererClient* content_renderer_client = + GetContentClient()->renderer(); return content_renderer_client->AllowPepperMediaStreamAPI(document_url); } } -namespace content { - ContentRendererPepperHostFactory::ContentRendererPepperHostFactory( RendererPpapiHostImpl* host) : host_(host) { diff --git a/content/renderer/pepper/event_conversion.cc b/content/renderer/pepper/event_conversion.cc index f912ae5..8020d5a 100644 --- a/content/renderer/pepper/event_conversion.cc +++ b/content/renderer/pepper/event_conversion.cc @@ -35,8 +35,7 @@ using WebKit::WebTouchEvent; using WebKit::WebTouchPoint; using WebKit::WebUChar; -namespace webkit { -namespace ppapi { +namespace content { namespace { @@ -731,5 +730,4 @@ PP_InputEvent_Class ClassifyInputEvent(WebInputEvent::Type type) { } } -} // namespace ppapi -} // namespace webkit +} // namespace content diff --git a/content/renderer/pepper/event_conversion.h b/content/renderer/pepper/event_conversion.h index 0fa849c..05bdda8 100644 --- a/content/renderer/pepper/event_conversion.h +++ b/content/renderer/pepper/event_conversion.h @@ -22,8 +22,7 @@ class WebGamepads; class WebInputEvent; } -namespace webkit { -namespace ppapi { +namespace content { // Converts the given WebKit event to one or possibly multiple PP_InputEvents. // The generated events will be filled into the given vector. On failure, no @@ -48,7 +47,6 @@ std::vector<linked_ptr<WebKit::WebInputEvent> > CreateSimulatedWebInputEvents( // type should not be "Undefined" since there's no corresponding PPAPI class. PP_InputEvent_Class ClassifyInputEvent(WebKit::WebInputEvent::Type type); -} // namespace ppapi -} // namespace webkit +} // namespace content #endif // CONTENT_RENDERER_PEPPER_EVENT_CONVERSION_H_ diff --git a/content/renderer/pepper/fullscreen_container.h b/content/renderer/pepper/fullscreen_container.h index 805c187..e3c030f 100644 --- a/content/renderer/pepper/fullscreen_container.h +++ b/content/renderer/pepper/fullscreen_container.h @@ -13,8 +13,7 @@ struct WebCursorInfo; struct WebRect; } // namespace WebKit -namespace webkit { -namespace ppapi { +namespace content { // This class is like a lightweight WebPluginContainer for fullscreen PPAPI // plugins, that only handles painting. @@ -42,7 +41,6 @@ class FullscreenContainer { virtual ~FullscreenContainer() {} }; -} // namespace ppapi -} // namespace webkit +} // namespace content #endif // CONTENT_RENDERER_PEPPER_PPB_FULLSCREEN_CONTAINER_IMPL_H_ diff --git a/content/renderer/pepper/gfx_conversion.h b/content/renderer/pepper/gfx_conversion.h index 77e7001..3b504ba 100644 --- a/content/renderer/pepper/gfx_conversion.h +++ b/content/renderer/pepper/gfx_conversion.h @@ -15,8 +15,7 @@ // Conversions for graphics types between our gfx library and PPAPI. // The style of naming is to match the PP_Bool conversions. -namespace webkit { -namespace ppapi { +namespace content { inline gfx::Point PP_ToGfxPoint(const PP_Point& p) { return gfx::Point(p.x, p.y); @@ -42,7 +41,6 @@ inline PP_Size PP_FromGfxSize(const gfx::Size& s) { return PP_MakeSize(s.width(), s.height()); } -} // namespace ppapi -} // namespace webkit +} // namespace content #endif // CONTENT_RENDERER_PEPPER_GFX_CONVERSION_H_ diff --git a/content/renderer/pepper/host_array_buffer_var.cc b/content/renderer/pepper/host_array_buffer_var.cc index 3aebfd9..e8d349e 100644 --- a/content/renderer/pepper/host_array_buffer_var.cc +++ b/content/renderer/pepper/host_array_buffer_var.cc @@ -11,15 +11,14 @@ #include "base/memory/scoped_ptr.h" #include "base/process/process_handle.h" #include "content/renderer/pepper/host_globals.h" +#include "content/renderer/pepper/pepper_plugin_instance_impl.h" #include "content/renderer/pepper/plugin_module.h" -#include "content/renderer/pepper/ppapi_plugin_instance_impl.h" #include "ppapi/c/pp_instance.h" using ppapi::ArrayBufferVar; using WebKit::WebArrayBuffer; -namespace webkit { -namespace ppapi { +namespace content { HostArrayBufferVar::HostArrayBufferVar(uint32 size_in_bytes) : buffer_(WebArrayBuffer::create(size_in_bytes, 1 /* element_size */)), @@ -63,8 +62,7 @@ bool HostArrayBufferVar::CopyToNewShmem( PP_Instance instance, int* host_shm_handle_id, base::SharedMemoryHandle* plugin_shm_handle) { - webkit::ppapi::PluginInstanceImpl* i = - webkit::ppapi::HostGlobals::Get()->GetInstance(instance); + PepperPluginInstanceImpl* i = HostGlobals::Get()->GetInstance(instance); scoped_ptr<base::SharedMemory> shm(i->delegate()->CreateAnonymousSharedMemory( ByteLength())); if (!shm) @@ -99,5 +97,4 @@ bool HostArrayBufferVar::CopyToNewShmem( return true; } -} // namespace ppapi -} // namespace webkit +} // namespace content diff --git a/content/renderer/pepper/host_array_buffer_var.h b/content/renderer/pepper/host_array_buffer_var.h index b1bd16a..9388c4e 100644 --- a/content/renderer/pepper/host_array_buffer_var.h +++ b/content/renderer/pepper/host_array_buffer_var.h @@ -11,8 +11,7 @@ #include "ppapi/shared_impl/var.h" #include "third_party/WebKit/public/platform/WebArrayBuffer.h" -namespace webkit { -namespace ppapi { +namespace content { // Represents a host-side ArrayBufferVar. class HostArrayBufferVar : public ::ppapi::ArrayBufferVar { @@ -43,7 +42,6 @@ class HostArrayBufferVar : public ::ppapi::ArrayBufferVar { DISALLOW_COPY_AND_ASSIGN(HostArrayBufferVar); }; -} // namespace ppapi -} // namespace webkit +} // namespace content #endif // PPAPI_CONTENT_RENDERER_PEPPER_HOST_ARRAY_BUFFER_VAR_H_ diff --git a/content/renderer/pepper/host_globals.cc b/content/renderer/pepper/host_globals.cc index ccc9f84..78790e1 100644 --- a/content/renderer/pepper/host_globals.cc +++ b/content/renderer/pepper/host_globals.cc @@ -11,8 +11,8 @@ #include "base/rand_util.h" #include "base/strings/utf_string_conversions.h" #include "base/task_runner.h" +#include "content/renderer/pepper/pepper_plugin_instance_impl.h" #include "content/renderer/pepper/plugin_module.h" -#include "content/renderer/pepper/ppapi_plugin_instance_impl.h" #include "ppapi/shared_impl/api_id.h" #include "ppapi/shared_impl/id_assignment.h" #include "third_party/WebKit/public/platform/WebString.h" @@ -30,8 +30,7 @@ using ppapi::ResourceTracker; using WebKit::WebConsoleMessage; using WebKit::WebString; -namespace webkit { -namespace ppapi { +namespace content { namespace { @@ -119,14 +118,14 @@ HostGlobals::~HostGlobals() { ::ppapi::thunk::ResourceCreationAPI* HostGlobals::GetResourceCreationAPI( PP_Instance pp_instance) { - PluginInstanceImpl* instance = GetInstance(pp_instance); + PepperPluginInstanceImpl* instance = GetInstance(pp_instance); if (!instance) return NULL; return &instance->resource_creation(); } PP_Module HostGlobals::GetModuleForInstance(PP_Instance instance) { - PluginInstanceImpl* inst = GetInstance(instance); + PepperPluginInstanceImpl* inst = GetInstance(instance); if (!inst) return 0; return inst->module()->pp_module(); @@ -150,7 +149,7 @@ void HostGlobals::LogWithSource(PP_Instance instance, PP_LogLevel level, const std::string& source, const std::string& value) { - PluginInstanceImpl* instance_object = + PepperPluginInstanceImpl* instance_object = HostGlobals::Get()->GetInstance(instance); if (instance_object) { instance_object->container()->element().document().frame()-> @@ -186,7 +185,8 @@ void HostGlobals::BroadcastLogWithSource(PP_Module pp_module, } base::TaskRunner* HostGlobals::GetFileTaskRunner(PP_Instance instance) { - scoped_refptr<PluginInstanceImpl> plugin_instance = GetInstance(instance); + scoped_refptr<PepperPluginInstanceImpl> plugin_instance = + GetInstance(instance); DCHECK(plugin_instance.get()); scoped_refptr<base::MessageLoopProxy> message_loop = plugin_instance->delegate()->GetFileThreadMessageLoopProxy(); @@ -236,7 +236,7 @@ PluginModule* HostGlobals::GetModule(PP_Module module) { return found->second; } -PP_Instance HostGlobals::AddInstance(PluginInstanceImpl* instance) { +PP_Instance HostGlobals::AddInstance(PepperPluginInstanceImpl* instance) { DCHECK(instance_map_.find(instance->pp_instance()) == instance_map_.end()); // Use a random number for the instance ID. This helps prevent some @@ -268,7 +268,7 @@ void HostGlobals::InstanceCrashed(PP_Instance instance) { host_var_tracker_.DidDeleteInstance(instance); } -PluginInstanceImpl* HostGlobals::GetInstance(PP_Instance instance) { +PepperPluginInstanceImpl* HostGlobals::GetInstance(PP_Instance instance) { DLOG_IF(ERROR, !CheckIdType(instance, ::ppapi::PP_ID_TYPE_INSTANCE)) << instance << " is not a PP_Instance."; InstanceMap::iterator found = instance_map_.find(instance); @@ -281,5 +281,4 @@ bool HostGlobals::IsHostGlobals() const { return true; } -} // namespace ppapi -} // namespace webkit +} // namespace content diff --git a/content/renderer/pepper/host_globals.h b/content/renderer/pepper/host_globals.h index 1689259..f48eb05 100644 --- a/content/renderer/pepper/host_globals.h +++ b/content/renderer/pepper/host_globals.h @@ -12,10 +12,9 @@ #include "ppapi/shared_impl/resource_tracker.h" #include "ppapi/shared_impl/var_tracker.h" -namespace webkit { -namespace ppapi { +namespace content { -class PluginInstanceImpl; +class PepperPluginInstanceImpl; class PluginModule; class HostGlobals : public ::ppapi::PpapiGlobals { @@ -78,7 +77,7 @@ class HostGlobals : public ::ppapi::PpapiGlobals { // Adds a new plugin instance to the list of tracked instances, and returns a // new instance handle to identify it. - PP_Instance AddInstance(PluginInstanceImpl* instance); + PP_Instance AddInstance(PepperPluginInstanceImpl* instance); // Called when a plugin instance was deleted and should no longer be tracked. // The given handle should be one generated by AddInstance. @@ -89,7 +88,7 @@ class HostGlobals : public ::ppapi::PpapiGlobals { // Returns a pointer to the plugin instance object associated with the given // instance handle. The return value will be NULL if the handle is invalid or // if the instance has crashed. - PluginInstanceImpl* GetInstance(PP_Instance instance); + PepperPluginInstanceImpl* GetInstance(PP_Instance instance); private: // PpapiGlobals overrides. @@ -101,7 +100,7 @@ class HostGlobals : public ::ppapi::PpapiGlobals { HostVarTracker host_var_tracker_; // Tracks all live instances and their associated object. - typedef std::map<PP_Instance, PluginInstanceImpl*> InstanceMap; + typedef std::map<PP_Instance, PepperPluginInstanceImpl*> InstanceMap; InstanceMap instance_map_; // Tracks all live modules. The pointers are non-owning, the PluginModule @@ -112,7 +111,6 @@ class HostGlobals : public ::ppapi::PpapiGlobals { DISALLOW_COPY_AND_ASSIGN(HostGlobals); }; -} // namespace ppapi -} // namespace webkit +} // namespace content #endif // CONTENT_RENDERER_PEPPER_HOST_GLOBALS_H_ diff --git a/content/renderer/pepper/host_var_tracker.cc b/content/renderer/pepper/host_var_tracker.cc index b61af73..9b9ebda 100644 --- a/content/renderer/pepper/host_var_tracker.cc +++ b/content/renderer/pepper/host_var_tracker.cc @@ -7,14 +7,13 @@ #include "base/logging.h" #include "content/renderer/pepper/host_array_buffer_var.h" #include "content/renderer/pepper/npobject_var.h" -#include "content/renderer/pepper/ppapi_plugin_instance_impl.h" +#include "content/renderer/pepper/pepper_plugin_instance_impl.h" #include "ppapi/c/pp_var.h" using ppapi::ArrayBufferVar; using ppapi::NPObjectVar; -namespace webkit { -namespace ppapi { +namespace content { HostVarTracker::HostVarTracker() : VarTracker(SINGLE_THREADED), @@ -169,5 +168,4 @@ bool HostVarTracker::StopTrackingSharedMemoryHandle( return true; } -} // namespace ppapi -} // namespace webkit +} // namespace content diff --git a/content/renderer/pepper/host_var_tracker.h b/content/renderer/pepper/host_var_tracker.h index 9ff0dbd..290e858 100644 --- a/content/renderer/pepper/host_var_tracker.h +++ b/content/renderer/pepper/host_var_tracker.h @@ -27,8 +27,7 @@ class NPObjectVar; class Var; } -namespace webkit { -namespace ppapi { +namespace content { // Adds NPObject var tracking to the standard PPAPI VarTracker for use in the // renderer. @@ -104,7 +103,6 @@ class HostVarTracker : public ::ppapi::VarTracker { DISALLOW_COPY_AND_ASSIGN(HostVarTracker); }; -} // namespace ppapi -} // namespace webkit +} // namespace content #endif // CONTENT_RENDERER_PEPPER_HOST_VAR_TRACKER_H_ diff --git a/content/renderer/pepper/host_var_tracker_unittest.cc b/content/renderer/pepper/host_var_tracker_unittest.cc index 037f059e..a5a1c184 100644 --- a/content/renderer/pepper/host_var_tracker_unittest.cc +++ b/content/renderer/pepper/host_var_tracker_unittest.cc @@ -11,7 +11,7 @@ #include "content/renderer/pepper/mock_resource.h" #include "content/renderer/pepper/npapi_glue.h" #include "content/renderer/pepper/npobject_var.h" -#include "content/renderer/pepper/ppapi_plugin_instance_impl.h" +#include "content/renderer/pepper/pepper_plugin_instance_impl.h" #include "ppapi/c/pp_var.h" #include "ppapi/c/ppp_instance.h" #include "third_party/npapi/bindings/npruntime.h" @@ -19,8 +19,7 @@ using ppapi::NPObjectVar; -namespace webkit { -namespace ppapi { +namespace content { namespace { @@ -84,8 +83,9 @@ class HostVarTrackerTest : public PpapiUnittest { TEST_F(HostVarTrackerTest, DeleteObjectVarWithInstance) { // Make a second instance (the test harness already creates & manages one). - scoped_refptr<PluginInstanceImpl> instance2( - PluginInstanceImpl::Create(delegate(), NULL, module(), NULL, GURL())); + scoped_refptr<PepperPluginInstanceImpl> instance2( + PepperPluginInstanceImpl::Create( + delegate(), NULL, module(), NULL, GURL())); PP_Instance pp_instance2 = instance2->pp_instance(); // Make an object var. @@ -134,5 +134,4 @@ TEST_F(HostVarTrackerTest, ReuseVar) { var_tracker->ReleaseVar(static_cast<int32_t>(pp_object3.value.as_id)); } -} // namespace ppapi -} // namespace webkit +} // namespace content diff --git a/content/renderer/pepper/message_channel.cc b/content/renderer/pepper/message_channel.cc index ea3bdf5..7cd7430 100644 --- a/content/renderer/pepper/message_channel.cc +++ b/content/renderer/pepper/message_channel.cc @@ -12,8 +12,8 @@ #include "base/message_loop/message_loop.h" #include "content/renderer/pepper/host_array_buffer_var.h" #include "content/renderer/pepper/npapi_glue.h" +#include "content/renderer/pepper/pepper_plugin_instance_impl.h" #include "content/renderer/pepper/plugin_module.h" -#include "content/renderer/pepper/ppapi_plugin_instance_impl.h" #include "content/renderer/pepper/v8_var_converter.h" #include "ppapi/shared_impl/ppapi_globals.h" #include "ppapi/shared_impl/var.h" @@ -38,9 +38,7 @@ using WebKit::WebDOMMessageEvent; using WebKit::WebPluginContainer; using WebKit::WebSerializedScriptValue; -namespace webkit { - -namespace ppapi { +namespace content { namespace { @@ -328,7 +326,7 @@ MessageChannel::MessageChannelNPObject::MessageChannelNPObject() { MessageChannel::MessageChannelNPObject::~MessageChannelNPObject() {} -MessageChannel::MessageChannel(PluginInstanceImpl* instance) +MessageChannel::MessageChannel(PepperPluginInstanceImpl* instance) : instance_(instance), passthrough_object_(NULL), np_object_(NULL), @@ -405,7 +403,7 @@ void MessageChannel::PostMessageToJavaScript(PP_Var message_data) { void MessageChannel::StopQueueingJavaScriptMessages() { // We PostTask here instead of draining the message queue directly - // since we haven't finished initializing the WebPluginImpl yet, so + // since we haven't finished initializing the PepperWebPluginImpl yet, so // the plugin isn't available in the DOM. early_message_queue_state_ = DRAIN_PENDING; base::MessageLoop::current()->PostTask( @@ -425,7 +423,7 @@ void MessageChannel::DrainEarlyMessageQueue() { // Take a reference on the PluginInstance. This is because JavaScript code // may delete the plugin, which would destroy the PluginInstance and its // corresponding MessageChannel. - scoped_refptr<PluginInstanceImpl> instance_ref(instance_); + scoped_refptr<PepperPluginInstanceImpl> instance_ref(instance_); if (early_message_queue_state_ == DRAIN_CANCELLED) { early_message_queue_state_ = QUEUE_MESSAGES; @@ -516,5 +514,4 @@ void MessageChannel::SetPassthroughObject(NPObject* passthrough) { passthrough_object_ = passthrough; } -} // namespace ppapi -} // namespace webkit +} // namespace content diff --git a/content/renderer/pepper/message_channel.h b/content/renderer/pepper/message_channel.h index 322c4b4..b377b51 100644 --- a/content/renderer/pepper/message_channel.h +++ b/content/renderer/pepper/message_channel.h @@ -14,10 +14,9 @@ struct PP_Var; -namespace webkit { -namespace ppapi { +namespace content { -class PluginInstanceImpl; +class PepperPluginInstanceImpl; // MessageChannel implements bidirectional postMessage functionality, allowing // calls from JavaScript to plugins and vice-versa. See @@ -45,7 +44,7 @@ class MessageChannel { base::WeakPtr<MessageChannel> message_channel; }; - explicit MessageChannel(PluginInstanceImpl* instance); + explicit MessageChannel(PepperPluginInstanceImpl* instance); ~MessageChannel(); // Post a message to the onmessage handler for this channel's instance @@ -66,7 +65,7 @@ class MessageChannel { NPObject* np_object() { return np_object_; } - PluginInstanceImpl* instance() { + PepperPluginInstanceImpl* instance() { return instance_; } @@ -77,7 +76,7 @@ class MessageChannel { void StopQueueingJavaScriptMessages(); private: - PluginInstanceImpl* instance_; + PepperPluginInstanceImpl* instance_; // We pass all non-postMessage calls through to the passthrough_object_. // This way, a plugin can use PPB_Class or PPP_Class_Deprecated and also @@ -104,7 +103,7 @@ class MessageChannel { base::WeakPtrFactory<MessageChannel> weak_ptr_factory_; // TODO(teravest): Remove all the tricky DRAIN_CANCELLED logic once - // webkit::ppapi::PluginInstance::ResetAsProxied() is gone. + // PluginInstance::ResetAsProxied() is gone. std::deque<WebKit::WebSerializedScriptValue> early_message_queue_; enum EarlyMessageQueueState { QUEUE_MESSAGES, // Queue JS messages. @@ -117,7 +116,6 @@ class MessageChannel { DISALLOW_COPY_AND_ASSIGN(MessageChannel); }; -} // namespace ppapi -} // namespace webkit +} // namespace content #endif // CONTENT_RENDERER_PEPPER_MESSAGE_CHANNEL_H_ diff --git a/content/renderer/pepper/mock_platform_image_2d.cc b/content/renderer/pepper/mock_platform_image_2d.cc index 2aba190..3a170be 100644 --- a/content/renderer/pepper/mock_platform_image_2d.cc +++ b/content/renderer/pepper/mock_platform_image_2d.cc @@ -6,8 +6,7 @@ #include "skia/ext/platform_canvas.h" -namespace webkit { -namespace ppapi { +namespace content { MockPlatformImage2D::MockPlatformImage2D(int width, int height) : width_(width), @@ -30,5 +29,4 @@ TransportDIB* MockPlatformImage2D::GetTransportDIB() const { return NULL; } -} // namespace ppapi -} // namespace webkit +} // namespace content diff --git a/content/renderer/pepper/mock_platform_image_2d.h b/content/renderer/pepper/mock_platform_image_2d.h index eedd4af..19b8202 100644 --- a/content/renderer/pepper/mock_platform_image_2d.h +++ b/content/renderer/pepper/mock_platform_image_2d.h @@ -8,8 +8,7 @@ #include "content/renderer/pepper/plugin_delegate.h" #include "skia/ext/platform_canvas.h" -namespace webkit { -namespace ppapi { +namespace content { class MockPlatformImage2D : public PluginDelegate::PlatformImage2D { public: @@ -26,7 +25,6 @@ class MockPlatformImage2D : public PluginDelegate::PlatformImage2D { int height_; }; -} // namespace ppapi -} // namespace webkit +} // namespace content #endif // CONTENT_RENDERER_PEPPER_MOCK_PLATFORM_IMAGE_2D_H_ diff --git a/content/renderer/pepper/mock_plugin_delegate.cc b/content/renderer/pepper/mock_plugin_delegate.cc index aae195e..72990a2 100644 --- a/content/renderer/pepper/mock_plugin_delegate.cc +++ b/content/renderer/pepper/mock_plugin_delegate.cc @@ -7,16 +7,15 @@ #include "base/logging.h" #include "base/message_loop/message_loop_proxy.h" #include "content/renderer/pepper/mock_platform_image_2d.h" +#include "content/renderer/pepper/pepper_plugin_instance_impl.h" #include "content/renderer/pepper/plugin_delegate.h" #include "content/renderer/pepper/plugin_module.h" -#include "content/renderer/pepper/ppapi_plugin_instance_impl.h" #include "ppapi/c/pp_errors.h" #include "ppapi/shared_impl/ppapi_permissions.h" #include "ppapi/shared_impl/ppapi_preferences.h" #include "third_party/WebKit/public/platform/WebGamepads.h" -namespace webkit { -namespace ppapi { +namespace content { MockPluginDelegate::MockPluginDelegate() { } @@ -24,23 +23,24 @@ MockPluginDelegate::MockPluginDelegate() { MockPluginDelegate::~MockPluginDelegate() { } -void MockPluginDelegate::PluginFocusChanged(PluginInstanceImpl* instance, +void MockPluginDelegate::PluginFocusChanged(PepperPluginInstanceImpl* instance, bool focused) { } void MockPluginDelegate::PluginTextInputTypeChanged( - PluginInstanceImpl* instance) { + PepperPluginInstanceImpl* instance) { } void MockPluginDelegate::PluginCaretPositionChanged( - PluginInstanceImpl* instance) { + PepperPluginInstanceImpl* instance) { } void MockPluginDelegate::PluginRequestedCancelComposition( - PluginInstanceImpl* instance) { + PepperPluginInstanceImpl* instance) { } -void MockPluginDelegate::PluginSelectionChanged(PluginInstanceImpl* instance) { +void MockPluginDelegate::PluginSelectionChanged( + PepperPluginInstanceImpl* instance) { } void MockPluginDelegate::SimulateImeSetComposition( @@ -54,17 +54,18 @@ void MockPluginDelegate::SimulateImeConfirmComposition( const base::string16& text) { } -void MockPluginDelegate::PluginCrashed(PluginInstanceImpl* instance) { +void MockPluginDelegate::PluginCrashed(PepperPluginInstanceImpl* instance) { } -void MockPluginDelegate::InstanceCreated(PluginInstanceImpl* instance) { +void MockPluginDelegate::InstanceCreated(PepperPluginInstanceImpl* instance) { } -void MockPluginDelegate::InstanceDeleted(PluginInstanceImpl* instance) { +void MockPluginDelegate::InstanceDeleted(PepperPluginInstanceImpl* instance) { } scoped_ptr< ::ppapi::thunk::ResourceCreationAPI> -MockPluginDelegate::CreateResourceCreationAPI(PluginInstanceImpl* instance) { + MockPluginDelegate::CreateResourceCreationAPI( + PepperPluginInstanceImpl* instance) { return scoped_ptr< ::ppapi::thunk::ResourceCreationAPI>(); } @@ -84,7 +85,7 @@ MockPluginDelegate::PlatformImage2D* MockPluginDelegate::CreateImage2D( } PluginDelegate::PlatformGraphics2D* MockPluginDelegate::GetGraphics2D( - PluginInstanceImpl* instance, + PepperPluginInstanceImpl* instance, PP_Resource graphics_2d) { return NULL; } @@ -321,7 +322,7 @@ bool MockPluginDelegate::X509CertificateParseDER( } FullscreenContainer* MockPluginDelegate::CreateFullscreenContainer( - PluginInstanceImpl* instance) { + PepperPluginInstanceImpl* instance) { return NULL; } @@ -346,22 +347,23 @@ base::SharedMemory* MockPluginDelegate::CreateAnonymousSharedMemory( return ::ppapi::Preferences(); } -bool MockPluginDelegate::LockMouse(PluginInstanceImpl* instance) { +bool MockPluginDelegate::LockMouse(PepperPluginInstanceImpl* instance) { return false; } -void MockPluginDelegate::UnlockMouse(PluginInstanceImpl* instance) { +void MockPluginDelegate::UnlockMouse(PepperPluginInstanceImpl* instance) { } -bool MockPluginDelegate::IsMouseLocked(PluginInstanceImpl* instance) { +bool MockPluginDelegate::IsMouseLocked(PepperPluginInstanceImpl* instance) { return false; } -void MockPluginDelegate::DidChangeCursor(PluginInstanceImpl* instance, +void MockPluginDelegate::DidChangeCursor(PepperPluginInstanceImpl* instance, const WebKit::WebCursorInfo& cursor) { } -void MockPluginDelegate::DidReceiveMouseEvent(PluginInstanceImpl* instance) { +void MockPluginDelegate::DidReceiveMouseEvent( + PepperPluginInstanceImpl* instance) { } void MockPluginDelegate::SampleGamepads(WebKit::WebGamepads* data) { @@ -397,11 +399,11 @@ bool MockPluginDelegate::IsRunningInProcess(PP_Instance instance) const { } void MockPluginDelegate::HandleDocumentLoad( - PluginInstanceImpl* instance, + PepperPluginInstanceImpl* instance, const WebKit::WebURLResponse& response) { } -content::RendererPpapiHost* MockPluginDelegate::CreateExternalPluginModule( +RendererPpapiHost* MockPluginDelegate::CreateExternalPluginModule( scoped_refptr<PluginModule> module, const base::FilePath& path, ::ppapi::PpapiPermissions permissions, @@ -411,5 +413,4 @@ content::RendererPpapiHost* MockPluginDelegate::CreateExternalPluginModule( return NULL; } -} // namespace ppapi -} // namespace webkit +} // namespace content diff --git a/content/renderer/pepper/mock_plugin_delegate.h b/content/renderer/pepper/mock_plugin_delegate.h index 8631dd7..2d184f2 100644 --- a/content/renderer/pepper/mock_plugin_delegate.h +++ b/content/renderer/pepper/mock_plugin_delegate.h @@ -10,23 +10,23 @@ struct PP_NetAddress_Private; namespace ppapi { class PPB_X509Certificate_Fields; } -namespace webkit { -namespace ppapi { +namespace content { class MockPluginDelegate : public PluginDelegate { public: MockPluginDelegate(); virtual ~MockPluginDelegate(); - virtual void PluginFocusChanged(PluginInstanceImpl* instance, + virtual void PluginFocusChanged(PepperPluginInstanceImpl* instance, bool focused) OVERRIDE; virtual void PluginTextInputTypeChanged( - PluginInstanceImpl* instance) OVERRIDE; + PepperPluginInstanceImpl* instance) OVERRIDE; virtual void PluginCaretPositionChanged( - PluginInstanceImpl* instance) OVERRIDE; + PepperPluginInstanceImpl* instance) OVERRIDE; virtual void PluginRequestedCancelComposition( - PluginInstanceImpl* instance) OVERRIDE; - virtual void PluginSelectionChanged(PluginInstanceImpl* instance) OVERRIDE; + PepperPluginInstanceImpl* instance) OVERRIDE; + virtual void PluginSelectionChanged( + PepperPluginInstanceImpl* instance) OVERRIDE; virtual void SimulateImeSetComposition( const base::string16& text, const std::vector<WebKit::WebCompositionUnderline>& underlines, @@ -34,16 +34,16 @@ class MockPluginDelegate : public PluginDelegate { int selection_end) OVERRIDE; virtual void SimulateImeConfirmComposition( const base::string16& text) OVERRIDE; - virtual void PluginCrashed(PluginInstanceImpl* instance) OVERRIDE; - virtual void InstanceCreated(PluginInstanceImpl* instance) OVERRIDE; - virtual void InstanceDeleted(PluginInstanceImpl* instance) OVERRIDE; + virtual void PluginCrashed(PepperPluginInstanceImpl* instance) OVERRIDE; + virtual void InstanceCreated(PepperPluginInstanceImpl* instance) OVERRIDE; + virtual void InstanceDeleted(PepperPluginInstanceImpl* instance) OVERRIDE; virtual scoped_ptr< ::ppapi::thunk::ResourceCreationAPI> - CreateResourceCreationAPI(PluginInstanceImpl* instance) OVERRIDE; + CreateResourceCreationAPI(PepperPluginInstanceImpl* instance) OVERRIDE; virtual SkBitmap* GetSadPluginBitmap() OVERRIDE; virtual WebKit::WebPlugin* CreatePluginReplacement( const base::FilePath& file_path) OVERRIDE; virtual PlatformImage2D* CreateImage2D(int width, int height) OVERRIDE; - virtual PlatformGraphics2D* GetGraphics2D(PluginInstanceImpl* instance, + virtual PlatformGraphics2D* GetGraphics2D(PepperPluginInstanceImpl* instance, PP_Resource graphics_2d) OVERRIDE; virtual PlatformContext3D* CreateContext3D() OVERRIDE; virtual PlatformVideoDecoder* CreateVideoDecoder( @@ -162,19 +162,20 @@ class MockPluginDelegate : public PluginDelegate { const std::vector<char>& der, ::ppapi::PPB_X509Certificate_Fields* fields) OVERRIDE; virtual FullscreenContainer* CreateFullscreenContainer( - PluginInstanceImpl* instance) OVERRIDE; + PepperPluginInstanceImpl* instance) OVERRIDE; virtual gfx::Size GetScreenSize() OVERRIDE; virtual std::string GetDefaultEncoding() OVERRIDE; virtual void ZoomLimitsChanged(double minimum_factor, double maximum_factor) OVERRIDE; virtual base::SharedMemory* CreateAnonymousSharedMemory(size_t size) OVERRIDE; virtual ::ppapi::Preferences GetPreferences() OVERRIDE; - virtual bool LockMouse(PluginInstanceImpl* instance) OVERRIDE; - virtual void UnlockMouse(PluginInstanceImpl* instance) OVERRIDE; - virtual bool IsMouseLocked(PluginInstanceImpl* instance) OVERRIDE; - virtual void DidChangeCursor(PluginInstanceImpl* instance, + virtual bool LockMouse(PepperPluginInstanceImpl* instance) OVERRIDE; + virtual void UnlockMouse(PepperPluginInstanceImpl* instance) OVERRIDE; + virtual bool IsMouseLocked(PepperPluginInstanceImpl* instance) OVERRIDE; + virtual void DidChangeCursor(PepperPluginInstanceImpl* instance, const WebKit::WebCursorInfo& cursor) OVERRIDE; - virtual void DidReceiveMouseEvent(PluginInstanceImpl* instance) OVERRIDE; + virtual void DidReceiveMouseEvent( + PepperPluginInstanceImpl* instance) OVERRIDE; virtual void SampleGamepads(WebKit::WebGamepads* data) OVERRIDE; virtual bool IsInFullscreenMode() OVERRIDE; virtual bool IsPageVisible() const OVERRIDE; @@ -188,9 +189,9 @@ class MockPluginDelegate : public PluginDelegate { bool should_close_source) const OVERRIDE; virtual bool IsRunningInProcess(PP_Instance instance) const OVERRIDE; virtual void HandleDocumentLoad( - PluginInstanceImpl* instance, + PepperPluginInstanceImpl* instance, const WebKit::WebURLResponse& response) OVERRIDE; - virtual content::RendererPpapiHost* CreateExternalPluginModule( + virtual RendererPpapiHost* CreateExternalPluginModule( scoped_refptr<PluginModule> module, const base::FilePath& path, ::ppapi::PpapiPermissions permissions, @@ -199,7 +200,6 @@ class MockPluginDelegate : public PluginDelegate { int plugin_child_id) OVERRIDE; }; -} // namespace ppapi -} // namespace webkit +} // namespace content #endif // CONTENT_RENDERER_PEPPER_MOCK_PLUGIN_DELEGATE_H_ diff --git a/content/renderer/pepper/mock_renderer_ppapi_host.cc b/content/renderer/pepper/mock_renderer_ppapi_host.cc index 5a2da54..e1de551 100644 --- a/content/renderer/pepper/mock_renderer_ppapi_host.cc +++ b/content/renderer/pepper/mock_renderer_ppapi_host.cc @@ -28,7 +28,7 @@ bool MockRendererPpapiHost::IsValidInstance(PP_Instance instance) const { return instance == pp_instance_; } -webkit::ppapi::PluginInstance* MockRendererPpapiHost::GetPluginInstance( +PepperPluginInstance* MockRendererPpapiHost::GetPluginInstance( PP_Instance instance) const { NOTIMPLEMENTED(); return NULL; diff --git a/content/renderer/pepper/mock_renderer_ppapi_host.h b/content/renderer/pepper/mock_renderer_ppapi_host.h index 3194d3f..7a18ad2 100644 --- a/content/renderer/pepper/mock_renderer_ppapi_host.h +++ b/content/renderer/pepper/mock_renderer_ppapi_host.h @@ -11,14 +11,8 @@ #include "ppapi/host/ppapi_host.h" #include "ppapi/proxy/resource_message_test_sink.h" -namespace webkit { -namespace ppapi { -class PluginInstance; -class PluginModule; -} -} - namespace content { +class PluginModule; // A mock RendererPpapiHost for testing resource hosts. Messages sent by // resources through this will get added to the test sink. @@ -39,7 +33,7 @@ class MockRendererPpapiHost : public RendererPpapiHost { // RendererPpapiHost. virtual ppapi::host::PpapiHost* GetPpapiHost() OVERRIDE; virtual bool IsValidInstance(PP_Instance instance) const OVERRIDE; - virtual webkit::ppapi::PluginInstance* GetPluginInstance( + virtual PepperPluginInstance* GetPluginInstance( PP_Instance instance) const OVERRIDE; virtual RenderView* GetRenderViewForInstance( PP_Instance instance) const OVERRIDE; diff --git a/content/renderer/pepper/mock_resource.h b/content/renderer/pepper/mock_resource.h index 60531f0..fc6d0a8 100644 --- a/content/renderer/pepper/mock_resource.h +++ b/content/renderer/pepper/mock_resource.h @@ -7,8 +7,7 @@ #include "ppapi/shared_impl/resource.h" -namespace webkit { -namespace ppapi { +namespace content { // Tests can derive from this to implement special test-specific resources. // It's assumed that a test will only need one mock resource, so it can @@ -22,7 +21,6 @@ class MockResource : public ::ppapi::Resource { virtual ~MockResource() {} }; -} // namespace ppapi -} // namespace webkit +} // namespace content #endif // CONTENT_RENDERER_PEPPER_MOCK_RESOURCE_H_ diff --git a/content/renderer/pepper/npapi_glue.cc b/content/renderer/pepper/npapi_glue.cc index f8b0c52..96e0bb0 100644 --- a/content/renderer/pepper/npapi_glue.cc +++ b/content/renderer/pepper/npapi_glue.cc @@ -11,9 +11,9 @@ #include "content/renderer/pepper/host_globals.h" #include "content/renderer/pepper/host_var_tracker.h" #include "content/renderer/pepper/npobject_var.h" +#include "content/renderer/pepper/pepper_plugin_instance_impl.h" #include "content/renderer/pepper/plugin_module.h" #include "content/renderer/pepper/plugin_object.h" -#include "content/renderer/pepper/ppapi_plugin_instance_impl.h" #include "ppapi/c/pp_var.h" #include "third_party/npapi/bindings/npapi.h" #include "third_party/npapi/bindings/npruntime.h" @@ -32,14 +32,13 @@ using WebKit::WebArrayBuffer; using WebKit::WebBindings; using WebKit::WebPluginContainer; -namespace webkit { -namespace ppapi { +namespace content { namespace { const char kInvalidPluginValue[] = "Error: Plugin returned invalid value."; -PP_Var NPObjectToPPVarImpl(PluginInstanceImpl* instance, +PP_Var NPObjectToPPVarImpl(PepperPluginInstanceImpl* instance, NPObject* object, v8::Local<v8::Context> context) { DCHECK(object); @@ -122,7 +121,7 @@ bool PPVarToNPVariant(PP_Var var, NPVariant* result) { return true; } -PP_Var NPVariantToPPVar(PluginInstanceImpl* instance, +PP_Var NPVariantToPPVar(PepperPluginInstanceImpl* instance, const NPVariant* variant) { switch (variant->type) { case NPVariantType_Void: @@ -172,7 +171,7 @@ PP_Var NPIdentifierToPPVar(NPIdentifier id) { return PP_MakeInt32(int_value); } -PP_Var NPObjectToPPVar(PluginInstanceImpl* instance, NPObject* object) { +PP_Var NPObjectToPPVar(PepperPluginInstanceImpl* instance, NPObject* object) { WebPluginContainer* container = instance->container(); // It's possible that container() is NULL if the plugin has been removed from // the DOM (but the PluginInstance is not destroyed yet). @@ -184,7 +183,8 @@ PP_Var NPObjectToPPVar(PluginInstanceImpl* instance, NPObject* object) { return NPObjectToPPVarImpl(instance, object, context); } -PP_Var NPObjectToPPVarForTest(PluginInstanceImpl* instance, NPObject* object) { +PP_Var NPObjectToPPVarForTest(PepperPluginInstanceImpl* instance, + NPObject* object) { v8::Isolate* test_isolate = v8::Isolate::New(); PP_Var result = PP_MakeUndefined(); { @@ -280,7 +280,7 @@ void PPResultAndExceptionToNPResult::ThrowException() { // PPVarArrayFromNPVariantArray ------------------------------------------------ PPVarArrayFromNPVariantArray::PPVarArrayFromNPVariantArray( - PluginInstanceImpl* instance, + PepperPluginInstanceImpl* instance, size_t size, const NPVariant* variants) : size_(size) { @@ -299,7 +299,7 @@ PPVarArrayFromNPVariantArray::~PPVarArrayFromNPVariantArray() { // PPVarFromNPObject ----------------------------------------------------------- -PPVarFromNPObject::PPVarFromNPObject(PluginInstanceImpl* instance, +PPVarFromNPObject::PPVarFromNPObject(PepperPluginInstanceImpl* instance, NPObject* object) : var_(NPObjectToPPVar(instance, object)) { } @@ -353,5 +353,4 @@ void TryCatch::Catch(void* self, const char* message) { static_cast<TryCatch*>(self)->SetException(message); } -} // namespace ppapi -} // namespace webkit +} // namespace content diff --git a/content/renderer/pepper/npapi_glue.h b/content/renderer/pepper/npapi_glue.h index 5cc745b..c2d23c8 100644 --- a/content/renderer/pepper/npapi_glue.h +++ b/content/renderer/pepper/npapi_glue.h @@ -15,10 +15,9 @@ struct NPObject; typedef struct _NPVariant NPVariant; typedef void* NPIdentifier; -namespace webkit { -namespace ppapi { +namespace content { -class PluginInstanceImpl; +class PepperPluginInstanceImpl; class PluginObject; // Utilities ------------------------------------------------------------------- @@ -38,7 +37,8 @@ bool PPVarToNPVariant(PP_Var var, NPVariant* result); // // The returned PP_Var will have a refcount of 1, this passing ownership of // the reference to the caller. This is suitable for returning to a plugin. -PP_Var NPVariantToPPVar(PluginInstanceImpl* instance, const NPVariant* variant); +PP_Var NPVariantToPPVar(PepperPluginInstanceImpl* instance, + const NPVariant* variant); // Returns a NPIdentifier that corresponds to the given PP_Var. The contents // of the PP_Var will be copied. Returns 0 if the given PP_Var is not a a @@ -64,13 +64,13 @@ PP_Var NPIdentifierToPPVar(NPIdentifier id); // Note: this could easily be changed to take a PP_Instance instead if that // makes certain calls in the future easier. Currently all callers have a // PluginInstance so that's what we use here. -CONTENT_EXPORT PP_Var NPObjectToPPVar(PluginInstanceImpl* instance, +CONTENT_EXPORT PP_Var NPObjectToPPVar(PepperPluginInstanceImpl* instance, NPObject* object); // This version creates a default v8::Context rather than using the one from // the container of |instance|. It is only for use in unit tests, where we don't // have a real container for |instance|. -CONTENT_EXPORT PP_Var NPObjectToPPVarForTest(PluginInstanceImpl* instance, +CONTENT_EXPORT PP_Var NPObjectToPPVarForTest(PepperPluginInstanceImpl* instance, NPObject* object); // PPResultAndExceptionToNPResult ---------------------------------------------- @@ -152,7 +152,7 @@ class PPResultAndExceptionToNPResult { // WebKit to the plugin. class PPVarArrayFromNPVariantArray { public: - PPVarArrayFromNPVariantArray(PluginInstanceImpl* instance, + PPVarArrayFromNPVariantArray(PepperPluginInstanceImpl* instance, size_t size, const NPVariant* variants); ~PPVarArrayFromNPVariantArray(); @@ -172,7 +172,7 @@ class PPVarArrayFromNPVariantArray { // is used when converting 'this' pointer from WebKit to the plugin. class PPVarFromNPObject { public: - PPVarFromNPObject(PluginInstanceImpl* instance, NPObject* object); + PPVarFromNPObject(PepperPluginInstanceImpl* instance, NPObject* object); ~PPVarFromNPObject(); PP_Var var() const { return var_; } @@ -259,7 +259,6 @@ class TryCatch { PP_Var* exception_; }; -} // namespace ppapi -} // namespace webkit +} // namespace content #endif // CONTENT_RENDERER_PEPPER_NPAPI_GLUE_H_ diff --git a/content/renderer/pepper/npobject_var.cc b/content/renderer/pepper/npobject_var.cc index 0ab1755..690dd22 100644 --- a/content/renderer/pepper/npobject_var.cc +++ b/content/renderer/pepper/npobject_var.cc @@ -10,7 +10,6 @@ #include "ppapi/c/pp_var.h" #include "third_party/WebKit/public/web/WebBindings.h" -using webkit::ppapi::HostGlobals; using WebKit::WebBindings; namespace ppapi { @@ -22,12 +21,12 @@ NPObjectVar::NPObjectVar(PP_Instance instance, : pp_instance_(instance), np_object_(np_object) { WebBindings::retainObject(np_object_); - HostGlobals::Get()->host_var_tracker()->AddNPObjectVar(this); + content::HostGlobals::Get()->host_var_tracker()->AddNPObjectVar(this); } NPObjectVar::~NPObjectVar() { if (pp_instance()) - HostGlobals::Get()->host_var_tracker()->RemoveNPObjectVar(this); + content::HostGlobals::Get()->host_var_tracker()->RemoveNPObjectVar(this); WebBindings::releaseObject(np_object_); } @@ -41,7 +40,7 @@ PP_VarType NPObjectVar::GetType() const { void NPObjectVar::InstanceDeleted() { DCHECK(pp_instance_); - HostGlobals::Get()->host_var_tracker()->RemoveNPObjectVar(this); + content::HostGlobals::Get()->host_var_tracker()->RemoveNPObjectVar(this); pp_instance_ = 0; } diff --git a/content/renderer/pepper/npobject_var.h b/content/renderer/pepper/npobject_var.h index 6cafbb4..68f9097 100644 --- a/content/renderer/pepper/npobject_var.h +++ b/content/renderer/pepper/npobject_var.h @@ -66,6 +66,6 @@ class NPObjectVar : public Var { DISALLOW_COPY_AND_ASSIGN(NPObjectVar); }; -} // namespace +} // ppapi #endif // CONTENT_RENDERER_PEPPER_NPOBJECT_VAR_H_ diff --git a/content/renderer/pepper/pepper_audio_input_host.cc b/content/renderer/pepper/pepper_audio_input_host.cc index 6e74126..a4056d2 100644 --- a/content/renderer/pepper/pepper_audio_input_host.cc +++ b/content/renderer/pepper/pepper_audio_input_host.cc @@ -6,7 +6,7 @@ #include "base/logging.h" #include "build/build_config.h" -#include "content/renderer/pepper/ppapi_plugin_instance_impl.h" +#include "content/renderer/pepper/pepper_plugin_instance_impl.h" #include "content/renderer/pepper/renderer_ppapi_host_impl.h" #include "ipc/ipc_message.h" #include "media/audio/shared_memory_util.h" @@ -83,8 +83,8 @@ void PepperAudioInputHost::StreamCreationFailed() { base::SyncSocket::kInvalidHandle); } -webkit::ppapi::PluginDelegate* PepperAudioInputHost::GetPluginDelegate() { - webkit::ppapi::PluginInstanceImpl* instance = +PluginDelegate* PepperAudioInputHost::GetPluginDelegate() { + PepperPluginInstanceImpl* instance = renderer_ppapi_host_->GetPluginInstanceImpl(pp_instance()); if (instance) return instance->delegate(); @@ -101,11 +101,11 @@ int32_t PepperAudioInputHost::OnOpen( if (audio_input_) return PP_ERROR_FAILED; - webkit::ppapi::PluginDelegate* plugin_delegate = GetPluginDelegate(); + PluginDelegate* plugin_delegate = GetPluginDelegate(); if (!plugin_delegate) return PP_ERROR_FAILED; - webkit::ppapi::PluginInstanceImpl* instance = + PepperPluginInstanceImpl* instance = renderer_ppapi_host_->GetPluginInstanceImpl(pp_instance()); if (!instance) return PP_ERROR_FAILED; diff --git a/content/renderer/pepper/pepper_audio_input_host.h b/content/renderer/pepper/pepper_audio_input_host.h index 8316ec8..f142197 100644 --- a/content/renderer/pepper/pepper_audio_input_host.h +++ b/content/renderer/pepper/pepper_audio_input_host.h @@ -25,7 +25,7 @@ class RendererPpapiHostImpl; class PepperAudioInputHost : public ppapi::host::ResourceHost, - public webkit::ppapi::PluginDelegate::PlatformAudioInputClient, + public PluginDelegate::PlatformAudioInputClient, public PepperDeviceEnumerationHostHelper::Delegate { public: PepperAudioInputHost(RendererPpapiHostImpl* host, @@ -44,7 +44,7 @@ class PepperAudioInputHost virtual void StreamCreationFailed() OVERRIDE; // PepperDeviceEnumerationHostHelper::Delegate implementation. - virtual webkit::ppapi::PluginDelegate* GetPluginDelegate() OVERRIDE; + virtual PluginDelegate* GetPluginDelegate() OVERRIDE; private: int32_t OnOpen(ppapi::host::HostMessageContext* context, @@ -75,7 +75,7 @@ class PepperAudioInputHost // PluginDelegate audio input object that we delegate audio IPC through. // We don't own this pointer but are responsible for calling Shutdown on it. - webkit::ppapi::PluginDelegate::PlatformAudioInput* audio_input_; + PluginDelegate::PlatformAudioInput* audio_input_; PepperDeviceEnumerationHostHelper enumeration_helper_; diff --git a/content/renderer/pepper/pepper_broker_impl.cc b/content/renderer/pepper/pepper_broker_impl.cc index aca9f32..a245885 100644 --- a/content/renderer/pepper/pepper_broker_impl.cc +++ b/content/renderer/pepper/pepper_broker_impl.cc @@ -79,7 +79,7 @@ bool PepperBrokerDispatcherWrapper::Init( return false; } dispatcher_->channel()->SetRestrictDispatchChannelGroup( - content::kRendererRestrictDispatchGroup_Pepper); + kRendererRestrictDispatchGroup_Pepper); return true; } @@ -107,7 +107,7 @@ int32_t PepperBrokerDispatcherWrapper::SendHandleToBroker( return result; } -PepperBrokerImpl::PepperBrokerImpl(webkit::ppapi::PluginModule* plugin_module, +PepperBrokerImpl::PepperBrokerImpl(PluginModule* plugin_module, PepperPluginDelegateImpl* delegate) : plugin_module_(plugin_module), delegate_(delegate->AsWeakPtr()) { @@ -124,8 +124,7 @@ PepperBrokerImpl::~PepperBrokerImpl() { } // If the channel is not ready, queue the connection. -void PepperBrokerImpl::AddPendingConnect( - webkit::ppapi::PPB_Broker_Impl* client) { +void PepperBrokerImpl::AddPendingConnect(PPB_Broker_Impl* client) { DCHECK(pending_connects_.find(client) == pending_connects_.end()) << "Connect was already called for this client"; @@ -141,7 +140,7 @@ void PepperBrokerImpl::AddPendingConnect( pending_connects_[client].client = client->AsWeakPtr(); } -void PepperBrokerImpl::Disconnect(webkit::ppapi::PPB_Broker_Impl* client) { +void PepperBrokerImpl::Disconnect(PPB_Broker_Impl* client) { // Remove the pending connect if one exists. This class will not call client's // callback. pending_connects_.erase(client); @@ -190,8 +189,7 @@ void PepperBrokerImpl::OnBrokerChannelConnected( // Process all pending channel requests from the plugins. for (ClientMap::iterator i = pending_connects_.begin(); i != pending_connects_.end();) { - base::WeakPtr<webkit::ppapi::PPB_Broker_Impl>& weak_ptr = - i->second.client; + base::WeakPtr<PPB_Broker_Impl>& weak_ptr = i->second.client; if (!i->second.is_authorized) { ++i; continue; @@ -204,9 +202,8 @@ void PepperBrokerImpl::OnBrokerChannelConnected( } } -void PepperBrokerImpl::OnBrokerPermissionResult( - webkit::ppapi::PPB_Broker_Impl* client, - bool result) { +void PepperBrokerImpl::OnBrokerPermissionResult(PPB_Broker_Impl* client, + bool result) { ClientMap::iterator entry = pending_connects_.find(client); if (entry == pending_connects_.end()) return; @@ -249,8 +246,7 @@ void PepperBrokerImpl::ReportFailureToClients(int error_code) { DCHECK_NE(PP_OK, error_code); for (ClientMap::iterator i = pending_connects_.begin(); i != pending_connects_.end(); ++i) { - base::WeakPtr<webkit::ppapi::PPB_Broker_Impl>& weak_ptr = - i->second.client; + base::WeakPtr<PPB_Broker_Impl>& weak_ptr = i->second.client; if (weak_ptr.get()) { weak_ptr->BrokerConnected( ppapi::PlatformFileToInt(base::kInvalidPlatformFileValue), @@ -260,8 +256,7 @@ void PepperBrokerImpl::ReportFailureToClients(int error_code) { pending_connects_.clear(); } -void PepperBrokerImpl::ConnectPluginToBroker( - webkit::ppapi::PPB_Broker_Impl* client) { +void PepperBrokerImpl::ConnectPluginToBroker(PPB_Broker_Impl* client) { base::SyncSocket::Handle plugin_handle = base::kInvalidPlatformFileValue; int32_t result = PP_OK; diff --git a/content/renderer/pepper/pepper_broker_impl.h b/content/renderer/pepper/pepper_broker_impl.h index ce81d96..a9c1411 100644 --- a/content/renderer/pepper/pepper_broker_impl.h +++ b/content/renderer/pepper/pepper_broker_impl.h @@ -22,15 +22,10 @@ class BrokerDispatcher; } } -namespace webkit { -namespace ppapi { -class PluginModule; -} -} - namespace content { class PepperPluginDelegateImpl; +class PluginModule; // This object is NOT thread-safe. class CONTENT_EXPORT PepperBrokerDispatcherWrapper { @@ -49,17 +44,17 @@ class CONTENT_EXPORT PepperBrokerDispatcherWrapper { scoped_ptr<ppapi::proxy::ProxyChannel::Delegate> dispatcher_delegate_; }; -class PepperBrokerImpl : public webkit::ppapi::PluginDelegate::Broker, +class PepperBrokerImpl : public PluginDelegate::Broker, public base::RefCountedThreadSafe<PepperBrokerImpl>{ public: - PepperBrokerImpl(webkit::ppapi::PluginModule* plugin_module, + PepperBrokerImpl(PluginModule* plugin_module, PepperPluginDelegateImpl* delegate_); - // webkit::ppapi::PluginDelegate::Broker implementation. - virtual void Disconnect(webkit::ppapi::PPB_Broker_Impl* client) OVERRIDE; + // PluginDelegate::Broker implementation. + virtual void Disconnect(PPB_Broker_Impl* client) OVERRIDE; // Adds a pending connection to the broker. Balances out Disconnect() calls. - void AddPendingConnect(webkit::ppapi::PPB_Broker_Impl* client); + void AddPendingConnect(PPB_Broker_Impl* client); // Called when the channel to the broker has been established. void OnBrokerChannelConnected(base::ProcessId broker_pid, @@ -67,7 +62,7 @@ class PepperBrokerImpl : public webkit::ppapi::PluginDelegate::Broker, // Called when we know whether permission to access the PPAPI broker was // granted. - void OnBrokerPermissionResult(webkit::ppapi::PPB_Broker_Impl* client, + void OnBrokerPermissionResult(PPB_Broker_Impl* client, bool result); private: @@ -78,7 +73,7 @@ class PepperBrokerImpl : public webkit::ppapi::PluginDelegate::Broker, ~PendingConnection(); bool is_authorized; - base::WeakPtr<webkit::ppapi::PPB_Broker_Impl> client; + base::WeakPtr<PPB_Broker_Impl> client; }; virtual ~PepperBrokerImpl(); @@ -87,20 +82,19 @@ class PepperBrokerImpl : public webkit::ppapi::PluginDelegate::Broker, void ReportFailureToClients(int error_code); // Connects the plugin to the broker via a pipe. - void ConnectPluginToBroker(webkit::ppapi::PPB_Broker_Impl* client); + void ConnectPluginToBroker(PPB_Broker_Impl* client); scoped_ptr<PepperBrokerDispatcherWrapper> dispatcher_; // A map of pointers to objects that have requested a connection to the weak // pointer we can use to reference them. The mapping is needed so we can clean // up entries for objects that may have been deleted. - typedef std::map<webkit::ppapi::PPB_Broker_Impl*, PendingConnection> - ClientMap; + typedef std::map<PPB_Broker_Impl*, PendingConnection> ClientMap; ClientMap pending_connects_; // Pointer to the associated plugin module. // Always set and cleared at the same time as the module's pointer to this. - webkit::ppapi::PluginModule* plugin_module_; + PluginModule* plugin_module_; base::WeakPtr<PepperPluginDelegateImpl> delegate_; diff --git a/content/renderer/pepper/pepper_device_enumeration_event_handler.cc b/content/renderer/pepper/pepper_device_enumeration_event_handler.cc index 7f662a1..8828fee 100644 --- a/content/renderer/pepper/pepper_device_enumeration_event_handler.cc +++ b/content/renderer/pepper/pepper_device_enumeration_event_handler.cc @@ -32,7 +32,7 @@ PepperDeviceEnumerationEventHandler::~PepperDeviceEnumerationEventHandler() { } int PepperDeviceEnumerationEventHandler::RegisterEnumerateDevicesCallback( - const webkit::ppapi::PluginDelegate::EnumerateDevicesCallback& callback) { + const PluginDelegate::EnumerateDevicesCallback& callback) { enumerate_callbacks_[next_id_] = callback; return next_id_++; } @@ -129,8 +129,7 @@ void PepperDeviceEnumerationEventHandler::NotifyDevicesEnumerated( return; } - webkit::ppapi::PluginDelegate::EnumerateDevicesCallback callback = - iter->second; + PluginDelegate::EnumerateDevicesCallback callback = iter->second; std::vector<ppapi::DeviceRefData> devices; if (succeeded) { diff --git a/content/renderer/pepper/pepper_device_enumeration_event_handler.h b/content/renderer/pepper/pepper_device_enumeration_event_handler.h index 543bcdb..05835ed 100644 --- a/content/renderer/pepper/pepper_device_enumeration_event_handler.h +++ b/content/renderer/pepper/pepper_device_enumeration_event_handler.h @@ -22,7 +22,7 @@ class PepperDeviceEnumerationEventHandler virtual ~PepperDeviceEnumerationEventHandler(); int RegisterEnumerateDevicesCallback( - const webkit::ppapi::PluginDelegate::EnumerateDevicesCallback& callback); + const PluginDelegate::EnumerateDevicesCallback& callback); void UnregisterEnumerateDevicesCallback(int request_id); int RegisterOpenDeviceCallback( @@ -62,8 +62,7 @@ class PepperDeviceEnumerationEventHandler int next_id_; - typedef std::map<int, - webkit::ppapi::PluginDelegate::EnumerateDevicesCallback> + typedef std::map<int, PluginDelegate::EnumerateDevicesCallback> EnumerateCallbackMap; EnumerateCallbackMap enumerate_callbacks_; diff --git a/content/renderer/pepper/pepper_device_enumeration_host_helper.cc b/content/renderer/pepper/pepper_device_enumeration_host_helper.cc index 136c946..ba281ea 100644 --- a/content/renderer/pepper/pepper_device_enumeration_host_helper.cc +++ b/content/renderer/pepper/pepper_device_enumeration_host_helper.cc @@ -19,7 +19,6 @@ #include "ppapi/shared_impl/ppb_device_ref_shared.h" using ppapi::host::HostMessageContext; -using webkit::ppapi::PluginDelegate; namespace content { diff --git a/content/renderer/pepper/pepper_device_enumeration_host_helper.h b/content/renderer/pepper/pepper_device_enumeration_host_helper.h index 0781f58..d7e92c7 100644 --- a/content/renderer/pepper/pepper_device_enumeration_host_helper.h +++ b/content/renderer/pepper/pepper_device_enumeration_host_helper.h @@ -26,13 +26,8 @@ namespace IPC { class Message; } -namespace webkit { -namespace ppapi { -class PluginDelegate; -} -} - namespace content { +class PluginDelegate; // Resource hosts that support device enumeration can use this class to filter // and process PpapiHostMsg_DeviceEnumeration_* messages. @@ -47,7 +42,7 @@ class CONTENT_EXPORT PepperDeviceEnumerationHostHelper { // TODO(yzshen): Move the relevant functionality out of PluginDelegate and // get rid of this method. - virtual webkit::ppapi::PluginDelegate* GetPluginDelegate() = 0; + virtual PluginDelegate* GetPluginDelegate() = 0; }; // |resource_host| and |delegate| must outlive this object. diff --git a/content/renderer/pepper/pepper_device_enumeration_host_helper_unittest.cc b/content/renderer/pepper/pepper_device_enumeration_host_helper_unittest.cc index f4e5714..a6ff34b 100644 --- a/content/renderer/pepper/pepper_device_enumeration_host_helper_unittest.cc +++ b/content/renderer/pepper/pepper_device_enumeration_host_helper_unittest.cc @@ -24,7 +24,7 @@ namespace content { namespace { -class TestPluginDelegate : public webkit::ppapi::MockPluginDelegate { +class TestPluginDelegate : public MockPluginDelegate { public: TestPluginDelegate() : last_used_id_(0) { } @@ -79,19 +79,19 @@ class TestResourceHost : public ppapi::host::ResourceHost, TestResourceHost(ppapi::host::PpapiHost* host, PP_Instance instance, PP_Resource resource, - webkit::ppapi::PluginDelegate* delegate) + PluginDelegate* delegate) : ResourceHost(host, instance, resource), delegate_(delegate) { } virtual ~TestResourceHost() {} - virtual webkit::ppapi::PluginDelegate* GetPluginDelegate() OVERRIDE { + virtual PluginDelegate* GetPluginDelegate() OVERRIDE { return delegate_; } private: - webkit::ppapi::PluginDelegate* delegate_; + PluginDelegate* delegate_; DISALLOW_COPY_AND_ASSIGN(TestResourceHost); }; diff --git a/content/renderer/pepper/pepper_file_chooser_host.cc b/content/renderer/pepper/pepper_file_chooser_host.cc index 8eecb07..1229d17 100644 --- a/content/renderer/pepper/pepper_file_chooser_host.cc +++ b/content/renderer/pepper/pepper_file_chooser_host.cc @@ -106,8 +106,7 @@ void PepperFileChooserHost::StoreChosenFiles( base::FilePath file_path(files[i].path); #endif - webkit::ppapi::PPB_FileRef_Impl* ref = - webkit::ppapi::PPB_FileRef_Impl::CreateExternal( + PPB_FileRef_Impl* ref = PPB_FileRef_Impl::CreateExternal( pp_instance(), file_path, files[i].display_name); ppapi::PPB_FileRef_CreateInfo create_info; ppapi::proxy::PPB_FileRef_Proxy::SerializeFileRef(ref->GetReference(), diff --git a/content/renderer/pepper/pepper_file_io_host.cc b/content/renderer/pepper/pepper_file_io_host.cc index 96f0e82..d23c2a8 100644 --- a/content/renderer/pepper/pepper_file_io_host.cc +++ b/content/renderer/pepper/pepper_file_io_host.cc @@ -12,7 +12,7 @@ #include "content/public/common/content_client.h" #include "content/public/renderer/content_renderer_client.h" #include "content/renderer/pepper/host_globals.h" -#include "content/renderer/pepper/ppapi_plugin_instance_impl.h" +#include "content/renderer/pepper/pepper_plugin_instance_impl.h" #include "content/renderer/pepper/ppb_file_ref_impl.h" #include "content/renderer/pepper/quota_file_io.h" #include "ppapi/c/pp_errors.h" @@ -31,8 +31,6 @@ using ppapi::PPTimeToTime; using ppapi::host::ReplyMessageContext; using ppapi::thunk::EnterResourceNoLock; using ppapi::thunk::PPB_FileRef_API; -using webkit::ppapi::PPB_FileRef_Impl; -using webkit::ppapi::PluginDelegate; namespace { @@ -66,8 +64,8 @@ PepperFileIOHost::PepperFileIOHost(RendererPpapiHost* host, open_flags_(0), weak_factory_(this) { // TODO(victorhsieh): eliminate plugin_delegate_ as it's no longer needed. - webkit::ppapi::PluginInstanceImpl* plugin_instance = - webkit::ppapi::HostGlobals::Get()->GetInstance(instance); + PepperPluginInstanceImpl* plugin_instance = + HostGlobals::Get()->GetInstance(instance); plugin_delegate_ = plugin_instance ? plugin_instance->delegate() : NULL; } @@ -480,7 +478,7 @@ void PepperFileIOHost::ExecutePlatformOpenFileCallback( if (file_ != base::kInvalidPlatformFileValue && (file_system_type_ == PP_FILESYSTEMTYPE_LOCALTEMPORARY || file_system_type_ == PP_FILESYSTEMTYPE_LOCALPERSISTENT)) { - quota_file_io_.reset(new webkit::ppapi::QuotaFileIO( + quota_file_io_.reset(new QuotaFileIO( pp_instance(), file_, file_system_url_, file_system_type_)); } diff --git a/content/renderer/pepper/pepper_file_io_host.h b/content/renderer/pepper/pepper_file_io_host.h index 89e70f7..7efc0af 100644 --- a/content/renderer/pepper/pepper_file_io_host.h +++ b/content/renderer/pepper/pepper_file_io_host.h @@ -18,15 +18,9 @@ #include "ppapi/thunk/ppb_file_ref_api.h" using ppapi::host::ReplyMessageContext; -using webkit::ppapi::PluginDelegate; - -namespace webkit { -namespace ppapi { -class QuotaFileIO; -} // namespace ppapi -} // namespace webkit namespace content { +class QuotaFileIO; class PepperFileIOHost : public ppapi::host::ResourceHost, public base::SupportsWeakPtr<PepperFileIOHost> { @@ -97,7 +91,7 @@ class PepperFileIOHost : public ppapi::host::ResourceHost, int bytes_written); // TODO(victorhsieh): eliminate plugin_delegate_ as it's no longer needed. - webkit::ppapi::PluginDelegate* plugin_delegate_; // Not owned. + PluginDelegate* plugin_delegate_; // Not owned. base::PlatformFile file_; @@ -117,7 +111,7 @@ class PepperFileIOHost : public ppapi::host::ResourceHost, // Pointer to a QuotaFileIO instance, which is valid only while a file // of type PP_FILESYSTEMTYPE_LOCAL{PERSISTENT,TEMPORARY} is opened. - scoped_ptr<webkit::ppapi::QuotaFileIO> quota_file_io_; + scoped_ptr<QuotaFileIO> quota_file_io_; bool is_running_in_process_; diff --git a/content/renderer/pepper/pepper_file_system_host.cc b/content/renderer/pepper/pepper_file_system_host.cc index 3e60dfe..f4c469a 100644 --- a/content/renderer/pepper/pepper_file_system_host.cc +++ b/content/renderer/pepper/pepper_file_system_host.cc @@ -8,9 +8,9 @@ #include "base/callback.h" #include "content/child/child_thread.h" #include "content/child/fileapi/file_system_dispatcher.h" +#include "content/renderer/pepper/pepper_plugin_instance_impl.h" #include "content/public/renderer/render_view.h" #include "content/public/renderer/renderer_ppapi_host.h" -#include "content/renderer/pepper/ppapi_plugin_instance_impl.h" #include "ppapi/c/pp_errors.h" #include "ppapi/host/dispatch_host_message.h" #include "ppapi/host/ppapi_host.h" @@ -117,7 +117,7 @@ int32_t PepperFileSystemHost::OnHostMsgOpen( return PP_ERROR_FAILED; } - webkit::ppapi::PluginInstance* plugin_instance = + PepperPluginInstance* plugin_instance = renderer_ppapi_host_->GetPluginInstance(pp_instance()); if (!plugin_instance) return PP_ERROR_FAILED; diff --git a/content/renderer/pepper/pepper_graphics_2d_host.cc b/content/renderer/pepper/pepper_graphics_2d_host.cc index ca4d524..7dbde94 100644 --- a/content/renderer/pepper/pepper_graphics_2d_host.cc +++ b/content/renderer/pepper/pepper_graphics_2d_host.cc @@ -11,7 +11,7 @@ #include "content/public/renderer/renderer_ppapi_host.h" #include "content/renderer/pepper/common.h" #include "content/renderer/pepper/gfx_conversion.h" -#include "content/renderer/pepper/ppapi_plugin_instance_impl.h" +#include "content/renderer/pepper/pepper_plugin_instance_impl.h" #include "content/renderer/pepper/ppb_image_data_impl.h" #include "content/renderer/pepper/resource_helper.h" #include "ppapi/c/pp_bool.h" @@ -41,8 +41,6 @@ using ppapi::thunk::EnterResourceNoLock; using ppapi::thunk::PPB_ImageData_API; -using webkit::ppapi::ImageDataAutoMapper; -using webkit::ppapi::PPB_ImageData_Impl; namespace content { @@ -296,7 +294,7 @@ bool PepperGraphics2DHost::ReadImageData(PP_Resource image, } bool PepperGraphics2DHost::BindToInstance( - webkit::ppapi::PluginInstanceImpl* new_instance) { + PepperPluginInstanceImpl* new_instance) { if (new_instance && new_instance->pp_instance() != pp_instance()) return false; // Can't bind other instance's contexts. if (bound_instance_ == new_instance) @@ -338,7 +336,7 @@ void PepperGraphics2DHost::Paint(WebKit::WebCanvas* canvas, gfx::Size image_size = gfx::ToFlooredSize( gfx::ScaleSize(pixel_image_size, scale_)); - webkit::ppapi::PluginInstance* plugin_instance = + PepperPluginInstance* plugin_instance = renderer_ppapi_host_->GetPluginInstance(pp_instance()); if (!plugin_instance) return; @@ -413,7 +411,7 @@ bool PepperGraphics2DHost::IsAlwaysOpaque() const { return is_always_opaque_; } -webkit::ppapi::PPB_ImageData_Impl* PepperGraphics2DHost::ImageData() { +PPB_ImageData_Impl* PepperGraphics2DHost::ImageData() { return image_data_.get(); } @@ -602,8 +600,7 @@ int32_t PepperGraphics2DHost::Flush(PP_Resource* old_image_data) { operation.type = QueuedOperation::PAINT; } - gfx::Rect clip = webkit::ppapi::PP_ToGfxRect( - bound_instance_->view_data().clip_rect); + gfx::Rect clip = PP_ToGfxRect(bound_instance_->view_data().clip_rect); is_plugin_visible = !clip.IsEmpty(); // Set |no_update_visible| to false if the change overlaps the visible diff --git a/content/renderer/pepper/pepper_graphics_2d_host.h b/content/renderer/pepper/pepper_graphics_2d_host.h index a582f2e..af379bf 100644 --- a/content/renderer/pepper/pepper_graphics_2d_host.h +++ b/content/renderer/pepper/pepper_graphics_2d_host.h @@ -22,22 +22,15 @@ class Point; class Rect; } -namespace webkit { -namespace ppapi { -class PPB_ImageData_Impl; -class PluginInstanceImpl; -} // namespace ppapi -} // namespace webkit - -using webkit::ppapi::PPB_ImageData_Impl; - namespace content { - + +class PepperPluginInstanceImpl; +class PPB_ImageData_Impl; class RendererPpapiHost; class CONTENT_EXPORT PepperGraphics2DHost : public ppapi::host::ResourceHost, - public webkit::ppapi::PluginDelegate::PlatformGraphics2D, + public PluginDelegate::PlatformGraphics2D, public base::SupportsWeakPtr<PepperGraphics2DHost> { public: static PepperGraphics2DHost* Create(RendererPpapiHost* host, @@ -57,8 +50,7 @@ class CONTENT_EXPORT PepperGraphics2DHost // PlatformGraphics2D overrides. virtual bool ReadImageData(PP_Resource image, const PP_Point* top_left) OVERRIDE; - virtual bool BindToInstance( - webkit::ppapi::PluginInstanceImpl* new_instance) OVERRIDE; + virtual bool BindToInstance(PepperPluginInstanceImpl* new_instance) OVERRIDE; virtual void Paint(WebKit::WebCanvas* canvas, const gfx::Rect& plugin_rect, const gfx::Rect& paint_rect) OVERRIDE; @@ -142,7 +134,7 @@ class CONTENT_EXPORT PepperGraphics2DHost // Non-owning pointer to the plugin instance this context is currently bound // to, if any. If the context is currently unbound, this will be NULL. - webkit::ppapi::PluginInstanceImpl* bound_instance_; + PepperPluginInstanceImpl* bound_instance_; // Keeps track of all drawing commands queued before a Flush call. struct QueuedOperation; diff --git a/content/renderer/pepper/pepper_in_process_resource_creation.cc b/content/renderer/pepper/pepper_in_process_resource_creation.cc index f9713c4..f4a345d 100644 --- a/content/renderer/pepper/pepper_in_process_resource_creation.cc +++ b/content/renderer/pepper/pepper_in_process_resource_creation.cc @@ -9,7 +9,7 @@ #include "base/memory/weak_ptr.h" #include "base/message_loop/message_loop.h" #include "content/renderer/pepper/pepper_in_process_router.h" -#include "content/renderer/pepper/ppapi_plugin_instance_impl.h" +#include "content/renderer/pepper/pepper_plugin_instance_impl.h" #include "content/renderer/pepper/renderer_ppapi_host_impl.h" #include "content/renderer/render_view_impl.h" #include "ipc/ipc_message.h" @@ -42,7 +42,7 @@ namespace content { PepperInProcessResourceCreation::PepperInProcessResourceCreation( RendererPpapiHostImpl* host_impl, - webkit::ppapi::PluginInstanceImpl* instance) + PepperPluginInstanceImpl* instance) : ResourceCreationImpl(instance), host_impl_(host_impl) { } diff --git a/content/renderer/pepper/pepper_in_process_resource_creation.h b/content/renderer/pepper/pepper_in_process_resource_creation.h index 72a5943..985ae09 100644 --- a/content/renderer/pepper/pepper_in_process_resource_creation.h +++ b/content/renderer/pepper/pepper_in_process_resource_creation.h @@ -34,11 +34,10 @@ class RendererPpapiHostImpl; // When we convert all resources to use the new-style, we can just use the // ResourceCreationProxy for all resources. This class is just glue to manage // the temporary "two different cases." -class PepperInProcessResourceCreation - : public webkit::ppapi::ResourceCreationImpl { +class PepperInProcessResourceCreation : public ResourceCreationImpl { public: PepperInProcessResourceCreation(RendererPpapiHostImpl* host_impl, - webkit::ppapi::PluginInstanceImpl* instance); + PepperPluginInstanceImpl* instance); virtual ~PepperInProcessResourceCreation(); // ResourceCreation_API implementation. diff --git a/content/renderer/pepper/pepper_platform_audio_input_impl.cc b/content/renderer/pepper/pepper_platform_audio_input_impl.cc index 436afc2..68ce940 100644 --- a/content/renderer/pepper/pepper_platform_audio_input_impl.cc +++ b/content/renderer/pepper/pepper_platform_audio_input_impl.cc @@ -25,7 +25,7 @@ PepperPlatformAudioInputImpl* PepperPlatformAudioInputImpl::Create( const GURL& document_url, int sample_rate, int frames_per_buffer, - webkit::ppapi::PluginDelegate::PlatformAudioInputClient* client) { + PluginDelegate::PlatformAudioInputClient* client) { scoped_refptr<PepperPlatformAudioInputImpl> audio_input( new PepperPlatformAudioInputImpl()); if (audio_input->Initialize(plugin_delegate, device_id, document_url, @@ -143,7 +143,7 @@ bool PepperPlatformAudioInputImpl::Initialize( const GURL& document_url, int sample_rate, int frames_per_buffer, - webkit::ppapi::PluginDelegate::PlatformAudioInputClient* client) { + PluginDelegate::PlatformAudioInputClient* client) { DCHECK(main_message_loop_proxy_->BelongsToCurrentThread()); if (!plugin_delegate.get() || !client) diff --git a/content/renderer/pepper/pepper_platform_audio_input_impl.h b/content/renderer/pepper/pepper_platform_audio_input_impl.h index c5b3fb0..3c18e7c 100644 --- a/content/renderer/pepper/pepper_platform_audio_input_impl.h +++ b/content/renderer/pepper/pepper_platform_audio_input_impl.h @@ -35,7 +35,7 @@ class PepperPluginDelegateImpl; // I/O thread. class PepperPlatformAudioInputImpl - : public webkit::ppapi::PluginDelegate::PlatformAudioInput, + : public PluginDelegate::PlatformAudioInput, public media::AudioInputIPCDelegate, public base::RefCountedThreadSafe<PepperPlatformAudioInputImpl> { public: @@ -47,7 +47,7 @@ class PepperPlatformAudioInputImpl const GURL& document_url, int sample_rate, int frames_per_buffer, - webkit::ppapi::PluginDelegate::PlatformAudioInputClient* client); + PluginDelegate::PlatformAudioInputClient* client); // PlatformAudioInput implementation (called on main thread). virtual void StartCapture() OVERRIDE; @@ -78,7 +78,7 @@ class PepperPlatformAudioInputImpl const GURL& document_url, int sample_rate, int frames_per_buffer, - webkit::ppapi::PluginDelegate::PlatformAudioInputClient* client); + PluginDelegate::PlatformAudioInputClient* client); // I/O thread backends to above functions. void InitializeOnIOThread(int session_id); @@ -94,7 +94,7 @@ class PepperPlatformAudioInputImpl // The client to notify when the stream is created. THIS MUST ONLY BE // ACCESSED ON THE MAIN THREAD. - webkit::ppapi::PluginDelegate::PlatformAudioInputClient* client_; + PluginDelegate::PlatformAudioInputClient* client_; // Used to send/receive IPC. THIS MUST ONLY BE ACCESSED ON THE // I/O THREAD. diff --git a/content/renderer/pepper/pepper_platform_audio_output_impl.cc b/content/renderer/pepper/pepper_platform_audio_output_impl.cc index f4dde379..320d211 100644 --- a/content/renderer/pepper/pepper_platform_audio_output_impl.cc +++ b/content/renderer/pepper/pepper_platform_audio_output_impl.cc @@ -21,7 +21,7 @@ PepperPlatformAudioOutputImpl* PepperPlatformAudioOutputImpl::Create( int sample_rate, int frames_per_buffer, int source_render_view_id, - webkit::ppapi::PluginDelegate::PlatformAudioOutputClient* client) { + PluginDelegate::PlatformAudioOutputClient* client) { scoped_refptr<PepperPlatformAudioOutputImpl> audio_output( new PepperPlatformAudioOutputImpl()); if (audio_output->Initialize(sample_rate, frames_per_buffer, @@ -116,7 +116,7 @@ bool PepperPlatformAudioOutputImpl::Initialize( int sample_rate, int frames_per_buffer, int source_render_view_id, - webkit::ppapi::PluginDelegate::PlatformAudioOutputClient* client) { + PluginDelegate::PlatformAudioOutputClient* client) { DCHECK(client); client_ = client; diff --git a/content/renderer/pepper/pepper_platform_audio_output_impl.h b/content/renderer/pepper/pepper_platform_audio_output_impl.h index d13aa62..af94e02 100644 --- a/content/renderer/pepper/pepper_platform_audio_output_impl.h +++ b/content/renderer/pepper/pepper_platform_audio_output_impl.h @@ -22,7 +22,7 @@ class MessageLoopProxy; namespace content { class PepperPlatformAudioOutputImpl - : public webkit::ppapi::PluginDelegate::PlatformAudioOutput, + : public PluginDelegate::PlatformAudioOutput, public media::AudioOutputIPCDelegate, public base::RefCountedThreadSafe<PepperPlatformAudioOutputImpl> { public: @@ -32,7 +32,7 @@ class PepperPlatformAudioOutputImpl int sample_rate, int frames_per_buffer, int source_render_view_id, - webkit::ppapi::PluginDelegate::PlatformAudioOutputClient* client); + PluginDelegate::PlatformAudioOutputClient* client); // PlatformAudioOutput implementation (called on main thread). virtual bool StartPlayback() OVERRIDE; @@ -59,7 +59,7 @@ class PepperPlatformAudioOutputImpl int sample_rate, int frames_per_buffer, int source_render_view_id, - webkit::ppapi::PluginDelegate::PlatformAudioOutputClient* client); + PluginDelegate::PlatformAudioOutputClient* client); // I/O thread backends to above functions. void InitializeOnIOThread(const media::AudioParameters& params); @@ -69,7 +69,7 @@ class PepperPlatformAudioOutputImpl // The client to notify when the stream is created. THIS MUST ONLY BE // ACCESSED ON THE MAIN THREAD. - webkit::ppapi::PluginDelegate::PlatformAudioOutputClient* client_; + PluginDelegate::PlatformAudioOutputClient* client_; // Used to send/receive IPC. THIS MUST ONLY BE ACCESSED ON THE // I/O thread except to send messages and get the message loop. diff --git a/content/renderer/pepper/pepper_platform_context_3d_impl.h b/content/renderer/pepper/pepper_platform_context_3d_impl.h index c975453..609cdcc 100644 --- a/content/renderer/pepper/pepper_platform_context_3d_impl.h +++ b/content/renderer/pepper/pepper_platform_context_3d_impl.h @@ -24,8 +24,7 @@ namespace content { class ContextProviderCommandBuffer; class GpuChannelHost; -class PlatformContext3DImpl - : public webkit::ppapi::PluginDelegate::PlatformContext3D { +class PlatformContext3DImpl : public PluginDelegate::PlatformContext3D { public: explicit PlatformContext3DImpl(); virtual ~PlatformContext3DImpl(); diff --git a/content/renderer/pepper/pepper_platform_image_2d_impl.h b/content/renderer/pepper/pepper_platform_image_2d_impl.h index 5ad75e1..3ff8de4 100644 --- a/content/renderer/pepper/pepper_platform_image_2d_impl.h +++ b/content/renderer/pepper/pepper_platform_image_2d_impl.h @@ -11,8 +11,7 @@ namespace content { // Implements the Image2D using a TransportDIB. -class PepperPlatformImage2DImpl - : public webkit::ppapi::PluginDelegate::PlatformImage2D { +class PepperPlatformImage2DImpl : public PluginDelegate::PlatformImage2D { public: virtual ~PepperPlatformImage2DImpl(); diff --git a/content/renderer/pepper/pepper_platform_video_capture_impl.cc b/content/renderer/pepper/pepper_platform_video_capture_impl.cc index c922c03..fd121a6 100644 --- a/content/renderer/pepper/pepper_platform_video_capture_impl.cc +++ b/content/renderer/pepper/pepper_platform_video_capture_impl.cc @@ -19,7 +19,7 @@ PepperPlatformVideoCaptureImpl::PepperPlatformVideoCaptureImpl( const base::WeakPtr<PepperPluginDelegateImpl>& plugin_delegate, const std::string& device_id, const GURL& document_url, - webkit::ppapi::PluginDelegate::PlatformVideoCaptureEventHandler* handler) + PluginDelegate::PlatformVideoCaptureEventHandler* handler) : plugin_delegate_(plugin_delegate), device_id_(device_id), session_id_(0), diff --git a/content/renderer/pepper/pepper_platform_video_capture_impl.h b/content/renderer/pepper/pepper_platform_video_capture_impl.h index 58101e53..40dc8e0 100644 --- a/content/renderer/pepper/pepper_platform_video_capture_impl.h +++ b/content/renderer/pepper/pepper_platform_video_capture_impl.h @@ -26,16 +26,16 @@ namespace content { class PepperPluginDelegateImpl; class PepperPlatformVideoCaptureImpl - : public webkit::ppapi::PluginDelegate::PlatformVideoCapture, + : public PluginDelegate::PlatformVideoCapture, public media::VideoCapture::EventHandler { public: PepperPlatformVideoCaptureImpl( const base::WeakPtr<PepperPluginDelegateImpl>& plugin_delegate, const std::string& device_id, const GURL& document_url, - webkit::ppapi::PluginDelegate::PlatformVideoCaptureEventHandler* handler); + PluginDelegate::PlatformVideoCaptureEventHandler* handler); - // webkit::ppapi::PluginDelegate::PlatformVideoCapture implementation. + // PluginDelegate::PlatformVideoCapture implementation. virtual void StartCapture( media::VideoCapture::EventHandler* handler, const media::VideoCaptureCapability& capability) OVERRIDE; @@ -77,7 +77,7 @@ class PepperPlatformVideoCaptureImpl scoped_ptr<media::VideoCaptureHandlerProxy> handler_proxy_; - webkit::ppapi::PluginDelegate::PlatformVideoCaptureEventHandler* handler_; + PluginDelegate::PlatformVideoCaptureEventHandler* handler_; media::VideoCapture* video_capture_; diff --git a/content/renderer/pepper/pepper_plugin_delegate_impl.cc b/content/renderer/pepper/pepper_plugin_delegate_impl.cc index 9eaa2ab..de6fd79 100644 --- a/content/renderer/pepper/pepper_plugin_delegate_impl.cc +++ b/content/renderer/pepper/pepper_plugin_delegate_impl.cc @@ -54,12 +54,12 @@ #include "content/renderer/pepper/pepper_platform_context_3d_impl.h" #include "content/renderer/pepper/pepper_platform_image_2d_impl.h" #include "content/renderer/pepper/pepper_platform_video_capture_impl.h" +#include "content/renderer/pepper/pepper_plugin_instance_impl.h" #include "content/renderer/pepper/pepper_plugin_registry.h" #include "content/renderer/pepper/pepper_proxy_channel_delegate_impl.h" #include "content/renderer/pepper/pepper_url_loader_host.h" +#include "content/renderer/pepper/pepper_webplugin_impl.h" #include "content/renderer/pepper/plugin_module.h" -#include "content/renderer/pepper/ppapi_plugin_instance_impl.h" -#include "content/renderer/pepper/ppapi_webplugin_impl.h" #include "content/renderer/pepper/ppb_tcp_server_socket_private_impl.h" #include "content/renderer/pepper/ppb_tcp_socket_private_impl.h" #include "content/renderer/pepper/renderer_ppapi_host_impl.h" @@ -112,10 +112,9 @@ namespace { // This class wraps a dispatcher and has the same lifetime. A dispatcher has // the same lifetime as a plugin module, which is longer than any particular // RenderView or plugin instance. -class HostDispatcherWrapper - : public webkit::ppapi::PluginDelegate::OutOfProcessProxy { +class HostDispatcherWrapper : public PluginDelegate::OutOfProcessProxy { public: - HostDispatcherWrapper(webkit::ppapi::PluginModule* module, + HostDispatcherWrapper(PluginModule* module, base::ProcessId peer_pid, int plugin_child_id, const ppapi::PpapiPermissions& perms, @@ -174,8 +173,7 @@ class HostDispatcherWrapper // isn't true for browser tag support. if (host) { RenderView* render_view = host->GetRenderViewForInstance(instance); - webkit::ppapi::PluginInstance* plugin_instance = - host->GetPluginInstance(instance); + PepperPluginInstance* plugin_instance = host->GetPluginInstance(instance); render_view->Send(new ViewHostMsg_DidCreateOutOfProcessPepperInstance( plugin_child_id_, instance, @@ -212,7 +210,7 @@ class HostDispatcherWrapper ppapi::proxy::HostDispatcher* dispatcher() { return dispatcher_.get(); } private: - webkit::ppapi::PluginModule* module_; + PluginModule* module_; base::ProcessId peer_pid_; @@ -230,7 +228,7 @@ class HostDispatcherWrapper class QuotaCallbackTranslator : public QuotaDispatcher::Callback { public: - typedef webkit::ppapi::PluginDelegate::AvailableSpaceCallback PluginCallback; + typedef PluginDelegate::AvailableSpaceCallback PluginCallback; explicit QuotaCallbackTranslator(const PluginCallback& cb) : callback_(cb) {} virtual void DidQueryStorageUsageAndQuota(int64 usage, int64 quota) OVERRIDE { callback_.Run(std::max(static_cast<int64>(0), quota - usage)); @@ -247,7 +245,7 @@ class QuotaCallbackTranslator : public QuotaDispatcher::Callback { class PluginInstanceLockTarget : public MouseLockDispatcher::LockTarget { public: - PluginInstanceLockTarget(webkit::ppapi::PluginInstanceImpl* plugin) + PluginInstanceLockTarget(PepperPluginInstanceImpl* plugin) : plugin_(plugin) {} virtual void OnLockMouseACK(bool succeeded) OVERRIDE { @@ -265,7 +263,7 @@ class PluginInstanceLockTarget : public MouseLockDispatcher::LockTarget { } private: - webkit::ppapi::PluginInstanceImpl* plugin_; + PepperPluginInstanceImpl* plugin_; }; void DoNotifyCloseFile(int file_open_id, base::PlatformFileError /* unused */) { @@ -274,8 +272,7 @@ void DoNotifyCloseFile(int file_open_id, base::PlatformFileError /* unused */) { } void DidOpenFileSystemURL( - const webkit::ppapi::PluginDelegate::AsyncOpenFileSystemURLCallback& - callback, + const PluginDelegate::AsyncOpenFileSystemURLCallback& callback, base::PlatformFile file, int file_open_id, quota::QuotaLimitType quota_policy) { @@ -293,18 +290,17 @@ void DidOpenFileSystemURL( } void DidFailOpenFileSystemURL( - const webkit::ppapi::PluginDelegate::AsyncOpenFileSystemURLCallback& - callback, + const PluginDelegate::AsyncOpenFileSystemURLCallback& callback, base::PlatformFileError error_code) { base::PlatformFile invalid_file = base::kInvalidPlatformFileValue; callback.Run(error_code, base::PassPlatformFile(&invalid_file), quota::kQuotaLimitTypeUnknown, - webkit::ppapi::PluginDelegate::NotifyCloseFileCallback()); + PluginDelegate::NotifyCloseFileCallback()); } void CreateHostForInProcessModule(RenderViewImpl* render_view, - webkit::ppapi::PluginModule* module, + PluginModule* module, const WebPluginInfo& webplugin_info) { // First time an in-process plugin was used, make a host for it. const PepperPluginInfo* info = @@ -349,28 +345,27 @@ WebKit::WebPlugin* PepperPluginDelegateImpl::CreatePepperWebPlugin( const WebPluginInfo& webplugin_info, const WebKit::WebPluginParams& params) { bool pepper_plugin_was_registered = false; - scoped_refptr<webkit::ppapi::PluginModule> pepper_module( + scoped_refptr<PluginModule> pepper_module( CreatePepperPluginModule(webplugin_info, &pepper_plugin_was_registered)); if (pepper_plugin_was_registered) { if (!pepper_module.get()) return NULL; - return new webkit::ppapi::WebPluginImpl( + return new PepperWebPluginImpl( pepper_module.get(), params, AsWeakPtr(), render_view_->AsWeakPtr()); } return NULL; } -scoped_refptr<webkit::ppapi::PluginModule> -PepperPluginDelegateImpl::CreatePepperPluginModule( +scoped_refptr<PluginModule> PepperPluginDelegateImpl::CreatePepperPluginModule( const WebPluginInfo& webplugin_info, bool* pepper_plugin_was_registered) { *pepper_plugin_was_registered = true; // See if a module has already been loaded for this plugin. base::FilePath path(webplugin_info.path); - scoped_refptr<webkit::ppapi::PluginModule> module = + scoped_refptr<PluginModule> module = PepperPluginRegistry::GetInstance()->GetLiveModule(path); if (module.get()) { if (!module->GetEmbedderState()) { @@ -389,10 +384,10 @@ PepperPluginDelegateImpl::CreatePepperPluginModule( PepperPluginRegistry::GetInstance()->GetInfoForPlugin(webplugin_info); if (!info) { *pepper_plugin_was_registered = false; - return scoped_refptr<webkit::ppapi::PluginModule>(); + return scoped_refptr<PluginModule>(); } else if (!info->is_out_of_process) { // In-process plugin not preloaded, it probably couldn't be initialized. - return scoped_refptr<webkit::ppapi::PluginModule>(); + return scoped_refptr<PluginModule>(); } ppapi::PpapiPermissions permissions = @@ -406,14 +401,12 @@ PepperPluginDelegateImpl::CreatePepperPluginModule( path, &channel_handle, &peer_pid, &plugin_child_id)); if (channel_handle.name.empty()) { // Couldn't be initialized. - return scoped_refptr<webkit::ppapi::PluginModule>(); + return scoped_refptr<PluginModule>(); } // AddLiveModule must be called before any early returns since the // module's destructor will remove itself. - module = new webkit::ppapi::PluginModule( - info->name, path, - permissions); + module = new PluginModule(info->name, path, permissions); PepperPluginRegistry::GetInstance()->AddLiveModule(path, module.get()); if (!CreateOutOfProcessModule(module.get(), @@ -423,13 +416,13 @@ PepperPluginDelegateImpl::CreatePepperPluginModule( peer_pid, plugin_child_id, false)) // is_external = false - return scoped_refptr<webkit::ppapi::PluginModule>(); + return scoped_refptr<PluginModule>(); return module; } scoped_refptr<PepperBrokerImpl> PepperPluginDelegateImpl::CreateBroker( - webkit::ppapi::PluginModule* plugin_module) { + PluginModule* plugin_module) { DCHECK(plugin_module); DCHECK(!plugin_module->GetBroker()); @@ -456,7 +449,7 @@ scoped_refptr<PepperBrokerImpl> PepperPluginDelegateImpl::CreateBroker( } RendererPpapiHost* PepperPluginDelegateImpl::CreateOutOfProcessModule( - webkit::ppapi::PluginModule* module, + PluginModule* module, const base::FilePath& path, ppapi::PpapiPermissions permissions, const IPC::ChannelHandle& channel_handle, @@ -475,7 +468,7 @@ RendererPpapiHost* PepperPluginDelegateImpl::CreateOutOfProcessModule( is_external)); if (!dispatcher->Init( channel_handle, - webkit::ppapi::PluginModule::GetLocalGetInterfaceFunc(), + PluginModule::GetLocalGetInterfaceFunc(), GetPreferences(), hung_filter.get())) return NULL; @@ -529,7 +522,7 @@ void PepperPluginDelegateImpl::ViewWillInitiatePaint() { // Notify all of our instances that we started painting. This is used for // internal bookkeeping only, so we know that the set can not change under // us. - for (std::set<webkit::ppapi::PluginInstanceImpl*>::iterator i = + for (std::set<PepperPluginInstanceImpl*>::iterator i = active_instances_.begin(); i != active_instances_.end(); ++i) (*i)->ViewWillInitiatePaint(); @@ -539,9 +532,8 @@ void PepperPluginDelegateImpl::ViewInitiatedPaint() { // Notify all instances that we painted. The same caveats apply as for // ViewFlushedPaint regarding instances closing themselves, so we take // similar precautions. - std::set<webkit::ppapi::PluginInstanceImpl*> plugins = active_instances_; - for (std::set<webkit::ppapi::PluginInstanceImpl*>::iterator i = - plugins.begin(); + std::set<PepperPluginInstanceImpl*> plugins = active_instances_; + for (std::set<PepperPluginInstanceImpl*>::iterator i = plugins.begin(); i != plugins.end(); ++i) { if (active_instances_.find(*i) != active_instances_.end()) (*i)->ViewInitiatedPaint(); @@ -553,9 +545,8 @@ void PepperPluginDelegateImpl::ViewFlushedPaint() { // we it may ask to close itself as a result. This will, in turn, modify our // set, possibly invalidating the iterator. So we iterate on a copy that // won't change out from under us. - std::set<webkit::ppapi::PluginInstanceImpl*> plugins = active_instances_; - for (std::set<webkit::ppapi::PluginInstanceImpl*>::iterator i = - plugins.begin(); + std::set<PepperPluginInstanceImpl*> plugins = active_instances_; + for (std::set<PepperPluginInstanceImpl*>::iterator i = plugins.begin(); i != plugins.end(); ++i) { // The copy above makes sure our iterator is never invalid if some plugins // are destroyed. But some plugin may decide to close all of its views in @@ -578,17 +569,17 @@ void PepperPluginDelegateImpl::ViewFlushedPaint() { } } -webkit::ppapi::PluginInstanceImpl* -PepperPluginDelegateImpl::GetBitmapForOptimizedPluginPaint( - const gfx::Rect& paint_bounds, - TransportDIB** dib, - gfx::Rect* location, - gfx::Rect* clip, - float* scale_factor) { - for (std::set<webkit::ppapi::PluginInstanceImpl*>::iterator i = +PepperPluginInstanceImpl* PepperPluginDelegateImpl:: + GetBitmapForOptimizedPluginPaint( + const gfx::Rect& paint_bounds, + TransportDIB** dib, + gfx::Rect* location, + gfx::Rect* clip, + float* scale_factor) { + for (std::set<PepperPluginInstanceImpl*>::iterator i = active_instances_.begin(); i != active_instances_.end(); ++i) { - webkit::ppapi::PluginInstanceImpl* instance = *i; + PepperPluginInstanceImpl* instance = *i; // In Flash fullscreen , the plugin contents should be painted onto the // fullscreen widget instead of the web page. if (!instance->FlashIsFullscreenOrPending() && @@ -600,7 +591,7 @@ PepperPluginDelegateImpl::GetBitmapForOptimizedPluginPaint( } void PepperPluginDelegateImpl::PluginFocusChanged( - webkit::ppapi::PluginInstanceImpl* instance, + PepperPluginInstanceImpl* instance, bool focused) { if (focused) focused_plugin_ = instance; @@ -611,25 +602,25 @@ void PepperPluginDelegateImpl::PluginFocusChanged( } void PepperPluginDelegateImpl::PluginTextInputTypeChanged( - webkit::ppapi::PluginInstanceImpl* instance) { + PepperPluginInstanceImpl* instance) { if (focused_plugin_ == instance && render_view_) render_view_->PpapiPluginTextInputTypeChanged(); } void PepperPluginDelegateImpl::PluginCaretPositionChanged( - webkit::ppapi::PluginInstanceImpl* instance) { + PepperPluginInstanceImpl* instance) { if (focused_plugin_ == instance && render_view_) render_view_->PpapiPluginCaretPositionChanged(); } void PepperPluginDelegateImpl::PluginRequestedCancelComposition( - webkit::ppapi::PluginInstanceImpl* instance) { + PepperPluginInstanceImpl* instance) { if (focused_plugin_ == instance && render_view_) render_view_->PpapiPluginCancelComposition(); } void PepperPluginDelegateImpl::PluginSelectionChanged( - webkit::ppapi::PluginInstanceImpl* instance) { + PepperPluginInstanceImpl* instance) { if (focused_plugin_ == instance && render_view_) render_view_->PpapiPluginSelectionChanged(); } @@ -740,14 +731,14 @@ bool PepperPluginDelegateImpl::CanComposeInline() const { } void PepperPluginDelegateImpl::PluginCrashed( - webkit::ppapi::PluginInstanceImpl* instance) { + PepperPluginInstanceImpl* instance) { render_view_->PluginCrashed(instance->module()->path(), instance->module()->GetPeerProcessId()); UnSetAndDeleteLockTargetAdapter(instance); } void PepperPluginDelegateImpl::InstanceCreated( - webkit::ppapi::PluginInstanceImpl* instance) { + PepperPluginInstanceImpl* instance) { active_instances_.insert(instance); // Set the initial focus. @@ -755,7 +746,7 @@ void PepperPluginDelegateImpl::InstanceCreated( } void PepperPluginDelegateImpl::InstanceDeleted( - webkit::ppapi::PluginInstanceImpl* instance) { + PepperPluginInstanceImpl* instance) { active_instances_.erase(instance); UnSetAndDeleteLockTargetAdapter(instance); @@ -767,7 +758,7 @@ void PepperPluginDelegateImpl::InstanceDeleted( scoped_ptr< ::ppapi::thunk::ResourceCreationAPI> PepperPluginDelegateImpl::CreateResourceCreationAPI( - webkit::ppapi::PluginInstanceImpl* instance) { + PepperPluginInstanceImpl* instance) { RendererPpapiHostImpl* host_impl = static_cast<RendererPpapiHostImpl*>( instance->module()->GetEmbedderState()); return host_impl->CreateInProcessResourceCreationAPI(instance); @@ -783,15 +774,15 @@ WebKit::WebPlugin* PepperPluginDelegateImpl::CreatePluginReplacement( render_view_, file_path); } -webkit::ppapi::PluginDelegate::PlatformImage2D* +PluginDelegate::PlatformImage2D* PepperPluginDelegateImpl::CreateImage2D(int width, int height) { return PepperPlatformImage2DImpl::Create(width, height); } -webkit::ppapi::PluginDelegate::PlatformGraphics2D* -PepperPluginDelegateImpl::GetGraphics2D( - webkit::ppapi::PluginInstanceImpl* instance, - PP_Resource resource) { +PluginDelegate::PlatformGraphics2D* + PepperPluginDelegateImpl::GetGraphics2D( + PepperPluginInstanceImpl* instance, + PP_Resource resource) { ppapi::host::ResourceHost* host = GetRendererResourceHost(instance->pp_instance(), resource); if (!host) @@ -801,7 +792,7 @@ PepperPluginDelegateImpl::GetGraphics2D( return result; } -webkit::ppapi::PluginDelegate::PlatformContext3D* +PluginDelegate::PlatformContext3D* PepperPluginDelegateImpl::CreateContext3D() { // If accelerated compositing of plugins is disabled, fail to create a 3D // context, because it won't be visible. This allows graceful fallback in the @@ -812,19 +803,19 @@ webkit::ppapi::PluginDelegate::PlatformContext3D* return new PlatformContext3DImpl; } -webkit::ppapi::PluginDelegate::PlatformVideoCapture* -PepperPluginDelegateImpl::CreateVideoCapture( - const std::string& device_id, - const GURL& document_url, - PlatformVideoCaptureEventHandler* handler) { +PluginDelegate::PlatformVideoCapture* + PepperPluginDelegateImpl::CreateVideoCapture( + const std::string& device_id, + const GURL& document_url, + PlatformVideoCaptureEventHandler* handler) { return new PepperPlatformVideoCaptureImpl(AsWeakPtr(), device_id, document_url, handler); } -webkit::ppapi::PluginDelegate::PlatformVideoDecoder* -PepperPluginDelegateImpl::CreateVideoDecoder( - media::VideoDecodeAccelerator::Client* client, - int32 command_buffer_route_id) { +PluginDelegate::PlatformVideoDecoder* + PepperPluginDelegateImpl::CreateVideoDecoder( + media::VideoDecodeAccelerator::Client* client, + int32 command_buffer_route_id) { return new PlatformVideoDecoderImpl(client, command_buffer_route_id); } @@ -850,36 +841,33 @@ uint32_t PepperPluginDelegateImpl::GetAudioHardwareOutputBufferSize() { return thread->GetAudioHardwareConfig()->GetOutputBufferSize(); } -webkit::ppapi::PluginDelegate::PlatformAudioOutput* -PepperPluginDelegateImpl::CreateAudioOutput( - uint32_t sample_rate, - uint32_t sample_count, - webkit::ppapi::PluginDelegate::PlatformAudioOutputClient* client) { +PluginDelegate::PlatformAudioOutput* + PepperPluginDelegateImpl::CreateAudioOutput( + uint32_t sample_rate, + uint32_t sample_count, + PluginDelegate::PlatformAudioOutputClient* client) { return PepperPlatformAudioOutputImpl::Create( static_cast<int>(sample_rate), static_cast<int>(sample_count), GetRoutingID(), client); } -webkit::ppapi::PluginDelegate::PlatformAudioInput* -PepperPluginDelegateImpl::CreateAudioInput( +PluginDelegate::PlatformAudioInput* PepperPluginDelegateImpl::CreateAudioInput( const std::string& device_id, const GURL& document_url, uint32_t sample_rate, uint32_t sample_count, - webkit::ppapi::PluginDelegate::PlatformAudioInputClient* client) { + PluginDelegate::PlatformAudioInputClient* client) { return PepperPlatformAudioInputImpl::Create( AsWeakPtr(), device_id, document_url, static_cast<int>(sample_rate), static_cast<int>(sample_count), client); } // If a broker has not already been created for this plugin, creates one. -webkit::ppapi::PluginDelegate::Broker* -PepperPluginDelegateImpl::ConnectToBroker( - webkit::ppapi::PPB_Broker_Impl* client) { +PluginDelegate::Broker* PepperPluginDelegateImpl::ConnectToBroker( + PPB_Broker_Impl* client) { DCHECK(client); - webkit::ppapi::PluginModule* plugin_module = - webkit::ppapi::ResourceHelper::GetPluginModule(client); + PluginModule* plugin_module = ResourceHelper::GetPluginModule(client); if (!plugin_module) return NULL; @@ -892,7 +880,7 @@ PepperPluginDelegateImpl::ConnectToBroker( } int request_id = pending_permission_requests_.Add( - new base::WeakPtr<webkit::ppapi::PPB_Broker_Impl>(client->AsWeakPtr())); + new base::WeakPtr<PPB_Broker_Impl>(client->AsWeakPtr())); if (!render_view_->Send( new ViewHostMsg_RequestPpapiBrokerPermission( render_view_->routing_id(), @@ -912,16 +900,15 @@ PepperPluginDelegateImpl::ConnectToBroker( void PepperPluginDelegateImpl::OnPpapiBrokerPermissionResult( int request_id, bool result) { - scoped_ptr<base::WeakPtr<webkit::ppapi::PPB_Broker_Impl> > client_ptr( + scoped_ptr<base::WeakPtr<PPB_Broker_Impl> > client_ptr( pending_permission_requests_.Lookup(request_id)); DCHECK(client_ptr.get()); pending_permission_requests_.Remove(request_id); - base::WeakPtr<webkit::ppapi::PPB_Broker_Impl> client = *client_ptr; + base::WeakPtr<PPB_Broker_Impl> client = *client_ptr; if (!client.get()) return; - webkit::ppapi::PluginModule* plugin_module = - webkit::ppapi::ResourceHelper::GetPluginModule(client.get()); + PluginModule* plugin_module = ResourceHelper::GetPluginModule(client.get()); if (!plugin_module) return; @@ -959,14 +946,14 @@ void PepperPluginDelegateImpl::OnAsyncFileOpened( } void PepperPluginDelegateImpl::OnSetFocus(bool has_focus) { - for (std::set<webkit::ppapi::PluginInstanceImpl*>::iterator i = + for (std::set<PepperPluginInstanceImpl*>::iterator i = active_instances_.begin(); i != active_instances_.end(); ++i) (*i)->SetContentAreaFocus(has_focus); } void PepperPluginDelegateImpl::PageVisibilityChanged(bool is_visible) { - for (std::set<webkit::ppapi::PluginInstanceImpl*>::iterator i = + for (std::set<PepperPluginInstanceImpl*>::iterator i = active_instances_.begin(); i != active_instances_.end(); ++i) (*i)->PageVisibilityChanged(is_visible); @@ -1140,7 +1127,7 @@ uint32 PepperPluginDelegateImpl::TCPSocketCreate() { } void PepperPluginDelegateImpl::TCPSocketConnect( - webkit::ppapi::PPB_TCPSocket_Private_Impl* socket, + PPB_TCPSocket_Private_Impl* socket, uint32 socket_id, const std::string& host, uint16_t port) { @@ -1151,7 +1138,7 @@ void PepperPluginDelegateImpl::TCPSocketConnect( } void PepperPluginDelegateImpl::TCPSocketConnectWithNetAddress( - webkit::ppapi::PPB_TCPSocket_Private_Impl* socket, + PPB_TCPSocket_Private_Impl* socket, uint32 socket_id, const PP_NetAddress_Private& addr) { RegisterTCPSocket(socket, socket_id); @@ -1202,7 +1189,7 @@ void PepperPluginDelegateImpl::TCPSocketSetOption( } void PepperPluginDelegateImpl::RegisterTCPSocket( - webkit::ppapi::PPB_TCPSocket_Private_Impl* socket, + PPB_TCPSocket_Private_Impl* socket, uint32 socket_id) { tcp_sockets_.AddWithID(socket, socket_id); } @@ -1265,9 +1252,8 @@ bool PepperPluginDelegateImpl::X509CertificateParseDER( return succeeded; } -webkit::ppapi::FullscreenContainer* -PepperPluginDelegateImpl::CreateFullscreenContainer( - webkit::ppapi::PluginInstanceImpl* instance) { +FullscreenContainer* PepperPluginDelegateImpl::CreateFullscreenContainer( + PepperPluginInstanceImpl* instance) { return render_view_->CreatePepperFullscreenContainer(instance); } @@ -1288,7 +1274,7 @@ void PepperPluginDelegateImpl::ZoomLimitsChanged(double minimum_factor, } void PepperPluginDelegateImpl::HandleDocumentLoad( - webkit::ppapi::PluginInstanceImpl* instance, + PepperPluginInstanceImpl* instance, const WebKit::WebURLResponse& response) { DCHECK(!instance->document_loader()); @@ -1346,7 +1332,7 @@ void PepperPluginDelegateImpl::HandleDocumentLoad( } RendererPpapiHost* PepperPluginDelegateImpl::CreateExternalPluginModule( - scoped_refptr<webkit::ppapi::PluginModule> module, + scoped_refptr<PluginModule> module, const base::FilePath& path, ppapi::PpapiPermissions permissions, const IPC::ChannelHandle& channel_handle, @@ -1372,26 +1358,24 @@ ppapi::Preferences PepperPluginDelegateImpl::GetPreferences() { return ppapi::Preferences(render_view_->webkit_preferences()); } -bool PepperPluginDelegateImpl::LockMouse( - webkit::ppapi::PluginInstanceImpl* instance) { +bool PepperPluginDelegateImpl::LockMouse(PepperPluginInstanceImpl* instance) { return GetMouseLockDispatcher(instance)->LockMouse( GetOrCreateLockTargetAdapter(instance)); } -void PepperPluginDelegateImpl::UnlockMouse( - webkit::ppapi::PluginInstanceImpl* instance) { +void PepperPluginDelegateImpl::UnlockMouse(PepperPluginInstanceImpl* instance) { GetMouseLockDispatcher(instance)->UnlockMouse( GetOrCreateLockTargetAdapter(instance)); } bool PepperPluginDelegateImpl::IsMouseLocked( - webkit::ppapi::PluginInstanceImpl* instance) { + PepperPluginInstanceImpl* instance) { return GetMouseLockDispatcher(instance)->IsMouseLockedTo( GetOrCreateLockTargetAdapter(instance)); } void PepperPluginDelegateImpl::DidChangeCursor( - webkit::ppapi::PluginInstanceImpl* instance, + PepperPluginInstanceImpl* instance, const WebKit::WebCursorInfo& cursor) { // Update the cursor appearance immediately if the requesting plugin is the // one which receives the last mouse event. Otherwise, the new cursor won't be @@ -1403,7 +1387,7 @@ void PepperPluginDelegateImpl::DidChangeCursor( } void PepperPluginDelegateImpl::DidReceiveMouseEvent( - webkit::ppapi::PluginInstanceImpl* instance) { + PepperPluginInstanceImpl* instance) { last_mouse_event_target_ = instance; } @@ -1496,8 +1480,7 @@ void PepperPluginDelegateImpl::OnTCPSocketConnectACK( int32_t result, const PP_NetAddress_Private& local_addr, const PP_NetAddress_Private& remote_addr) { - webkit::ppapi::PPB_TCPSocket_Private_Impl* socket = - tcp_sockets_.Lookup(socket_id); + PPB_TCPSocket_Private_Impl* socket = tcp_sockets_.Lookup(socket_id); if (socket) socket->OnConnectCompleted(result, local_addr, remote_addr); if (result != PP_OK) @@ -1509,8 +1492,7 @@ void PepperPluginDelegateImpl::OnTCPSocketSSLHandshakeACK( uint32 socket_id, bool succeeded, const ppapi::PPB_X509Certificate_Fields& certificate_fields) { - webkit::ppapi::PPB_TCPSocket_Private_Impl* socket = - tcp_sockets_.Lookup(socket_id); + PPB_TCPSocket_Private_Impl* socket = tcp_sockets_.Lookup(socket_id); if (socket) socket->OnSSLHandshakeCompleted(succeeded, certificate_fields); } @@ -1519,8 +1501,7 @@ void PepperPluginDelegateImpl::OnTCPSocketReadACK(uint32 plugin_dispatcher_id, uint32 socket_id, int32_t result, const std::string& data) { - webkit::ppapi::PPB_TCPSocket_Private_Impl* socket = - tcp_sockets_.Lookup(socket_id); + PPB_TCPSocket_Private_Impl* socket = tcp_sockets_.Lookup(socket_id); if (socket) socket->OnReadCompleted(result, data); } @@ -1528,8 +1509,7 @@ void PepperPluginDelegateImpl::OnTCPSocketReadACK(uint32 plugin_dispatcher_id, void PepperPluginDelegateImpl::OnTCPSocketWriteACK(uint32 plugin_dispatcher_id, uint32 socket_id, int32_t result) { - webkit::ppapi::PPB_TCPSocket_Private_Impl* socket = - tcp_sockets_.Lookup(socket_id); + PPB_TCPSocket_Private_Impl* socket = tcp_sockets_.Lookup(socket_id); if (socket) socket->OnWriteCompleted(result); } @@ -1538,8 +1518,7 @@ void PepperPluginDelegateImpl::OnTCPSocketSetOptionACK( uint32 plugin_dispatcher_id, uint32 socket_id, int32_t result) { - webkit::ppapi::PPB_TCPSocket_Private_Impl* socket = - tcp_sockets_.Lookup(socket_id); + PPB_TCPSocket_Private_Impl* socket = tcp_sockets_.Lookup(socket_id); if (socket) socket->OnSetOptionCompleted(result); } @@ -1649,7 +1628,7 @@ int PepperPluginDelegateImpl::GetSessionID(PP_DeviceType_Dev type, MouseLockDispatcher::LockTarget* PepperPluginDelegateImpl::GetOrCreateLockTargetAdapter( - webkit::ppapi::PluginInstanceImpl* instance) { + PepperPluginInstanceImpl* instance) { MouseLockDispatcher::LockTarget* target = mouse_lock_instances_[instance]; if (target) return target; @@ -1659,7 +1638,7 @@ MouseLockDispatcher::LockTarget* } void PepperPluginDelegateImpl::UnSetAndDeleteLockTargetAdapter( - webkit::ppapi::PluginInstanceImpl* instance) { + PepperPluginInstanceImpl* instance) { LockTargetMap::iterator it = mouse_lock_instances_.find(instance); if (it != mouse_lock_instances_.end()) { MouseLockDispatcher::LockTarget* target = it->second; @@ -1670,7 +1649,7 @@ void PepperPluginDelegateImpl::UnSetAndDeleteLockTargetAdapter( } MouseLockDispatcher* PepperPluginDelegateImpl::GetMouseLockDispatcher( - webkit::ppapi::PluginInstanceImpl* instance) { + PepperPluginInstanceImpl* instance) { if (instance->flash_fullscreen()) { RenderWidgetFullscreenPepper* container = static_cast<RenderWidgetFullscreenPepper*>( diff --git a/content/renderer/pepper/pepper_plugin_delegate_impl.h b/content/renderer/pepper/pepper_plugin_delegate_impl.h index 5a0f977..191a056 100644 --- a/content/renderer/pepper/pepper_plugin_delegate_impl.h +++ b/content/renderer/pepper/pepper_plugin_delegate_impl.h @@ -35,12 +35,6 @@ class PepperFilePath; class PPB_X509Certificate_Fields; } -namespace webkit { -namespace ppapi { -class PluginModule; -} -} - namespace WebKit { class WebGamepads; struct WebCompositionUnderline; @@ -51,11 +45,12 @@ class ContextProviderCommandBuffer; class GamepadSharedMemoryReader; class PepperBrokerImpl; class PepperDeviceEnumerationEventHandler; +class PluginModule; class RenderViewImpl; struct WebPluginInfo; class PepperPluginDelegateImpl - : public webkit::ppapi::PluginDelegate, + : public PluginDelegate, public RenderViewPepperHelper, public base::SupportsWeakPtr<PepperPluginDelegateImpl>, public RenderViewObserver { @@ -103,7 +98,7 @@ class PepperPluginDelegateImpl virtual void ViewWillInitiatePaint() OVERRIDE; virtual void ViewInitiatedPaint() OVERRIDE; virtual void ViewFlushedPaint() OVERRIDE; - virtual webkit::ppapi::PluginInstanceImpl* GetBitmapForOptimizedPluginPaint( + virtual PepperPluginInstanceImpl* GetBitmapForOptimizedPluginPaint( const gfx::Rect& paint_bounds, TransportDIB** dib, gfx::Rect* location, @@ -136,31 +131,27 @@ class PepperPluginDelegateImpl virtual void WillHandleMouseEvent() OVERRIDE; // PluginDelegate implementation. - virtual void PluginFocusChanged(webkit::ppapi::PluginInstanceImpl* instance, + virtual void PluginFocusChanged(PepperPluginInstanceImpl* instance, bool focused) OVERRIDE; virtual void PluginTextInputTypeChanged( - webkit::ppapi::PluginInstanceImpl* instance) OVERRIDE; + PepperPluginInstanceImpl* instance) OVERRIDE; virtual void PluginCaretPositionChanged( - webkit::ppapi::PluginInstanceImpl* instance) OVERRIDE; + PepperPluginInstanceImpl* instance) OVERRIDE; virtual void PluginRequestedCancelComposition( - webkit::ppapi::PluginInstanceImpl* instance) OVERRIDE; + PepperPluginInstanceImpl* instance) OVERRIDE; virtual void PluginSelectionChanged( - webkit::ppapi::PluginInstanceImpl* instance) OVERRIDE; + PepperPluginInstanceImpl* instance) OVERRIDE; virtual void SimulateImeSetComposition( const string16& text, const std::vector<WebKit::WebCompositionUnderline>& underlines, int selection_start, int selection_end) OVERRIDE; virtual void SimulateImeConfirmComposition(const string16& text) OVERRIDE; - virtual void PluginCrashed( - webkit::ppapi::PluginInstanceImpl* instance) OVERRIDE; - virtual void InstanceCreated( - webkit::ppapi::PluginInstanceImpl* instance) OVERRIDE; - virtual void InstanceDeleted( - webkit::ppapi::PluginInstanceImpl* instance) OVERRIDE; + virtual void PluginCrashed(PepperPluginInstanceImpl* instance) OVERRIDE; + virtual void InstanceCreated(PepperPluginInstanceImpl* instance) OVERRIDE; + virtual void InstanceDeleted(PepperPluginInstanceImpl* instance) OVERRIDE; virtual scoped_ptr< ::ppapi::thunk::ResourceCreationAPI> - CreateResourceCreationAPI( - webkit::ppapi::PluginInstanceImpl* instance) OVERRIDE; + CreateResourceCreationAPI(PepperPluginInstanceImpl* instance) OVERRIDE; virtual SkBitmap* GetSadPluginBitmap() OVERRIDE; virtual WebKit::WebPlugin* CreatePluginReplacement( const base::FilePath& file_path) OVERRIDE; @@ -178,7 +169,7 @@ class PepperPluginDelegateImpl PlatformAudioInputClient* client) OVERRIDE; virtual PlatformImage2D* CreateImage2D(int width, int height) OVERRIDE; virtual PlatformGraphics2D* GetGraphics2D( - webkit::ppapi::PluginInstanceImpl* instance, + PepperPluginInstanceImpl* instance, PP_Resource resource) OVERRIDE; virtual PlatformContext3D* CreateContext3D() OVERRIDE; virtual PlatformVideoCapture* CreateVideoCapture( @@ -188,8 +179,7 @@ class PepperPluginDelegateImpl virtual PlatformVideoDecoder* CreateVideoDecoder( media::VideoDecodeAccelerator::Client* client, int32 command_buffer_route_id) OVERRIDE; - virtual Broker* ConnectToBroker( - webkit::ppapi::PPB_Broker_Impl* client) OVERRIDE; + virtual Broker* ConnectToBroker(PPB_Broker_Impl* client) OVERRIDE; virtual void NumberOfFindResultsChanged(int identifier, int total, bool final_result) OVERRIDE; @@ -252,13 +242,12 @@ class PepperPluginDelegateImpl virtual scoped_refptr<base::MessageLoopProxy> GetFileThreadMessageLoopProxy() OVERRIDE; virtual uint32 TCPSocketCreate() OVERRIDE; - virtual void TCPSocketConnect( - webkit::ppapi::PPB_TCPSocket_Private_Impl* socket, - uint32 socket_id, - const std::string& host, - uint16_t port) OVERRIDE; + virtual void TCPSocketConnect(PPB_TCPSocket_Private_Impl* socket, + uint32 socket_id, + const std::string& host, + uint16_t port) OVERRIDE; virtual void TCPSocketConnectWithNetAddress( - webkit::ppapi::PPB_TCPSocket_Private_Impl* socket, + PPB_TCPSocket_Private_Impl* socket, uint32 socket_id, const PP_NetAddress_Private& addr) OVERRIDE; virtual void TCPSocketSSLHandshake( @@ -275,9 +264,8 @@ class PepperPluginDelegateImpl uint32 socket_id, PP_TCPSocket_Option name, const ppapi::SocketOptionData& value) OVERRIDE; - virtual void RegisterTCPSocket( - webkit::ppapi::PPB_TCPSocket_Private_Impl* socket, - uint32 socket_id) OVERRIDE; + virtual void RegisterTCPSocket(PPB_TCPSocket_Private_Impl* socket, + uint32 socket_id) OVERRIDE; virtual void TCPServerSocketListen( PP_Resource socket_resource, const PP_NetAddress_Private& addr, @@ -293,9 +281,8 @@ class PepperPluginDelegateImpl virtual bool X509CertificateParseDER( const std::vector<char>& der, ppapi::PPB_X509Certificate_Fields* fields) OVERRIDE; - virtual webkit::ppapi::FullscreenContainer* - CreateFullscreenContainer( - webkit::ppapi::PluginInstanceImpl* instance) OVERRIDE; + virtual FullscreenContainer* CreateFullscreenContainer( + PepperPluginInstanceImpl* instance) OVERRIDE; virtual gfx::Size GetScreenSize() OVERRIDE; virtual std::string GetDefaultEncoding() OVERRIDE; virtual void ZoomLimitsChanged(double minimum_factor, double maximum_factor) @@ -303,15 +290,13 @@ class PepperPluginDelegateImpl virtual base::SharedMemory* CreateAnonymousSharedMemory(size_t size) OVERRIDE; virtual ::ppapi::Preferences GetPreferences() OVERRIDE; - virtual bool LockMouse(webkit::ppapi::PluginInstanceImpl* instance) OVERRIDE; - virtual void UnlockMouse( - webkit::ppapi::PluginInstanceImpl* instance) OVERRIDE; - virtual bool IsMouseLocked( - webkit::ppapi::PluginInstanceImpl* instance) OVERRIDE; - virtual void DidChangeCursor(webkit::ppapi::PluginInstanceImpl* instance, + virtual bool LockMouse(PepperPluginInstanceImpl* instance) OVERRIDE; + virtual void UnlockMouse(PepperPluginInstanceImpl* instance) OVERRIDE; + virtual bool IsMouseLocked(PepperPluginInstanceImpl* instance) OVERRIDE; + virtual void DidChangeCursor(PepperPluginInstanceImpl* instance, const WebKit::WebCursorInfo& cursor) OVERRIDE; virtual void DidReceiveMouseEvent( - webkit::ppapi::PluginInstanceImpl* instance) OVERRIDE; + PepperPluginInstanceImpl* instance) OVERRIDE; virtual bool IsInFullscreenMode() OVERRIDE; virtual void SampleGamepads(WebKit::WebGamepads* data) OVERRIDE; virtual bool IsPageVisible() const OVERRIDE; @@ -320,10 +305,10 @@ class PepperPluginDelegateImpl const EnumerateDevicesCallback& callback) OVERRIDE; virtual void StopEnumerateDevices(int request_id) OVERRIDE; virtual void HandleDocumentLoad( - webkit::ppapi::PluginInstanceImpl* instance, + PepperPluginInstanceImpl* instance, const WebKit::WebURLResponse& response) OVERRIDE; - virtual content::RendererPpapiHost* CreateExternalPluginModule( - scoped_refptr<webkit::ppapi::PluginModule> module, + virtual RendererPpapiHost* CreateExternalPluginModule( + scoped_refptr<PluginModule> module, const base::FilePath& path, ::ppapi::PpapiPermissions permissions, const IPC::ChannelHandle& channel_handle, @@ -374,18 +359,17 @@ class PepperPluginDelegateImpl // the second is that the plugin failed to initialize. In this case, // |*pepper_plugin_was_registered| will be set to true and the caller should // not fall back on any other plugin types. - scoped_refptr<webkit::ppapi::PluginModule> - CreatePepperPluginModule(const WebPluginInfo& webplugin_info, - bool* pepper_plugin_was_registered); + scoped_refptr<PluginModule> CreatePepperPluginModule( + const WebPluginInfo& webplugin_info, + bool* pepper_plugin_was_registered); // Asynchronously attempts to create a PPAPI broker for the given plugin. - scoped_refptr<PepperBrokerImpl> CreateBroker( - webkit::ppapi::PluginModule* plugin_module); + scoped_refptr<PepperBrokerImpl> CreateBroker(PluginModule* plugin_module); // Create a new HostDispatcher for proxying, hook it to the PluginModule, // and perform other common initialization. RendererPpapiHost* CreateOutOfProcessModule( - webkit::ppapi::PluginModule* module, + PluginModule* module, const base::FilePath& path, ppapi::PpapiPermissions permissions, const IPC::ChannelHandle& channel_handle, @@ -394,12 +378,11 @@ class PepperPluginDelegateImpl bool is_external); MouseLockDispatcher::LockTarget* GetOrCreateLockTargetAdapter( - webkit::ppapi::PluginInstanceImpl* instance); - void UnSetAndDeleteLockTargetAdapter( - webkit::ppapi::PluginInstanceImpl* instance); + PepperPluginInstanceImpl* instance); + void UnSetAndDeleteLockTargetAdapter(PepperPluginInstanceImpl* instance); MouseLockDispatcher* GetMouseLockDispatcher( - webkit::ppapi::PluginInstanceImpl* instance); + PepperPluginInstanceImpl* instance); // Share a given handle with the target process. virtual IPC::PlatformFileForTransit ShareHandleWithRemote( @@ -416,26 +399,25 @@ class PepperPluginDelegateImpl // the browser. PepperBrowserConnection pepper_browser_connection_; - std::set<webkit::ppapi::PluginInstanceImpl*> active_instances_; - typedef std::map<webkit::ppapi::PluginInstanceImpl*, + std::set<PepperPluginInstanceImpl*> active_instances_; + typedef std::map<PepperPluginInstanceImpl*, MouseLockDispatcher::LockTarget*> LockTargetMap; LockTargetMap mouse_lock_instances_; IDMap<AsyncOpenFileCallback> pending_async_open_files_; - IDMap<webkit::ppapi::PPB_TCPSocket_Private_Impl> tcp_sockets_; + IDMap<PPB_TCPSocket_Private_Impl> tcp_sockets_; IDMap<ppapi::PPB_TCPServerSocket_Shared> tcp_server_sockets_; typedef IDMap<scoped_refptr<PepperBrokerImpl>, IDMapOwnPointer> BrokerMap; BrokerMap pending_connect_broker_; - typedef IDMap<base::WeakPtr<webkit::ppapi::PPB_Broker_Impl> > - PermissionRequestMap; + typedef IDMap<base::WeakPtr<PPB_Broker_Impl> > PermissionRequestMap; PermissionRequestMap pending_permission_requests_; // Whether or not the focus is on a PPAPI plugin - webkit::ppapi::PluginInstanceImpl* focused_plugin_; + PepperPluginInstanceImpl* focused_plugin_; // Current text input composition text. Empty if no composition is in // progress. @@ -445,7 +427,7 @@ class PepperPluginDelegateImpl // if the last mouse event went to elements other than Pepper plugins. // |last_mouse_event_target_| is not owned by this class. We can know about // when it is destroyed via InstanceDeleted(). - webkit::ppapi::PluginInstanceImpl* last_mouse_event_target_; + PepperPluginInstanceImpl* last_mouse_event_target_; scoped_ptr<GamepadSharedMemoryReader> gamepad_shared_memory_reader_; diff --git a/content/renderer/pepper/ppapi_plugin_instance_impl.cc b/content/renderer/pepper/pepper_plugin_instance_impl.cc index 229c31e..1593f9a 100644 --- a/content/renderer/pepper/ppapi_plugin_instance_impl.cc +++ b/content/renderer/pepper/pepper_plugin_instance_impl.cc @@ -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 "content/renderer/pepper/ppapi_plugin_instance_impl.h" +#include "content/renderer/pepper/pepper_plugin_instance_impl.h" #include "base/bind.h" #include "base/callback_helpers.h" @@ -150,8 +150,7 @@ using WebKit::WebUserGestureIndicator; using WebKit::WebUserGestureToken; using WebKit::WebView; -namespace webkit { -namespace ppapi { +namespace content { #if defined(OS_WIN) // Exported by pdf.dll @@ -293,7 +292,8 @@ COMPILE_ASSERT_PRINT_SCALING_MATCHING_ENUM( // unchanged. bool SecurityOriginForInstance(PP_Instance instance_id, WebKit::WebSecurityOrigin* security_origin) { - PluginInstanceImpl* instance = HostGlobals::Get()->GetInstance(instance_id); + PepperPluginInstanceImpl* instance = + HostGlobals::Get()->GetInstance(instance_id); if (!instance) return false; @@ -316,29 +316,31 @@ scoped_ptr<const char*[]> StringVectorToArgArray( } // namespace // static -PluginInstanceImpl* PluginInstanceImpl::Create(PluginDelegate* delegate, - content::RenderView* render_view, - PluginModule* module, - WebPluginContainer* container, - const GURL& plugin_url) { +PepperPluginInstanceImpl* PepperPluginInstanceImpl::Create( + PluginDelegate* delegate, + RenderView* render_view, + PluginModule* module, + WebPluginContainer* container, + const GURL& plugin_url) { base::Callback<const void*(const char*)> get_plugin_interface_func = base::Bind(&PluginModule::GetPluginInterface, module); PPP_Instance_Combined* ppp_instance_combined = PPP_Instance_Combined::Create(get_plugin_interface_func); if (!ppp_instance_combined) return NULL; - return new PluginInstanceImpl(delegate, render_view, module, - ppp_instance_combined, container, plugin_url); + return new PepperPluginInstanceImpl(delegate, render_view, module, + ppp_instance_combined, container, + plugin_url); } -PluginInstanceImpl::NaClDocumentLoader::NaClDocumentLoader() +PepperPluginInstanceImpl::NaClDocumentLoader::NaClDocumentLoader() : finished_loading_(false) { } -PluginInstanceImpl::NaClDocumentLoader::~NaClDocumentLoader(){ +PepperPluginInstanceImpl::NaClDocumentLoader::~NaClDocumentLoader(){ } -void PluginInstanceImpl::NaClDocumentLoader::ReplayReceivedData( +void PepperPluginInstanceImpl::NaClDocumentLoader::ReplayReceivedData( WebURLLoaderClient* document_loader) { for (std::list<std::string>::iterator it = data_.begin(); it != data_.end(); ++it) { @@ -354,7 +356,7 @@ void PluginInstanceImpl::NaClDocumentLoader::ReplayReceivedData( } } -void PluginInstanceImpl::NaClDocumentLoader::didReceiveData( +void PepperPluginInstanceImpl::NaClDocumentLoader::didReceiveData( WebURLLoader* loader, const char* data, int data_length, @@ -362,43 +364,44 @@ void PluginInstanceImpl::NaClDocumentLoader::didReceiveData( data_.push_back(std::string(data, data_length)); } -void PluginInstanceImpl::NaClDocumentLoader::didFinishLoading( +void PepperPluginInstanceImpl::NaClDocumentLoader::didFinishLoading( WebURLLoader* loader, double finish_time) { DCHECK(!finished_loading_); finished_loading_ = true; } -void PluginInstanceImpl::NaClDocumentLoader::didFail( +void PepperPluginInstanceImpl::NaClDocumentLoader::didFail( WebURLLoader* loader, const WebURLError& error) { DCHECK(!error_.get()); error_.reset(new WebURLError(error)); } -PluginInstanceImpl::GamepadImpl::GamepadImpl(PluginDelegate* delegate) +PepperPluginInstanceImpl::GamepadImpl::GamepadImpl(PluginDelegate* delegate) : Resource(::ppapi::Resource::Untracked()), delegate_(delegate) { } -PluginInstanceImpl::GamepadImpl::~GamepadImpl() { +PepperPluginInstanceImpl::GamepadImpl::~GamepadImpl() { } -PPB_Gamepad_API* PluginInstanceImpl::GamepadImpl::AsPPB_Gamepad_API() { +PPB_Gamepad_API* PepperPluginInstanceImpl::GamepadImpl::AsPPB_Gamepad_API() { return this; } -void PluginInstanceImpl::GamepadImpl::Sample(PP_Instance instance, - PP_GamepadsSampleData* data) { +void PepperPluginInstanceImpl::GamepadImpl::Sample( + PP_Instance instance, + PP_GamepadsSampleData* data) { WebKit::WebGamepads webkit_data; delegate_->SampleGamepads(&webkit_data); ConvertWebKitGamepadData( *reinterpret_cast<const ::ppapi::WebKitGamepads*>(&webkit_data), data); } -PluginInstanceImpl::PluginInstanceImpl( +PepperPluginInstanceImpl::PepperPluginInstanceImpl( PluginDelegate* delegate, - content::RenderView* render_view, + RenderView* render_view, PluginModule* module, ::ppapi::PPP_Instance_Combined* instance_interface, WebPluginContainer* container, @@ -468,7 +471,7 @@ PluginInstanceImpl::PluginInstanceImpl( nacl_document_load_ = true; } -PluginInstanceImpl::~PluginInstanceImpl() { +PepperPluginInstanceImpl::~PepperPluginInstanceImpl() { DCHECK(!fullscreen_container_); // Force-unbind any Graphics. In the case of Graphics2D, if the plugin @@ -503,13 +506,13 @@ PluginInstanceImpl::~PluginInstanceImpl() { // NOTE: Any of these methods that calls into the plugin needs to take into // account that the plugin may use Var to remove the <embed> from the DOM, which -// will make the WebPluginImpl drop its reference, usually the last one. If a -// method needs to access a member of the instance after the call has returned, -// then it needs to keep its own reference on the stack. +// will make the PepperWebPluginImpl drop its reference, usually the last one. +// If a method needs to access a member of the instance after the call has +// returned, then it needs to keep its own reference on the stack. -void PluginInstanceImpl::Delete() { +void PepperPluginInstanceImpl::Delete() { // Keep a reference on the stack. See NOTE above. - scoped_refptr<PluginInstanceImpl> ref(this); + scoped_refptr<PepperPluginInstanceImpl> ref(this); // Force the MessageChannel to release its "passthrough object" which should // release our last reference to the "InstanceObject" and will probably // destroy it. We want to do this prior to calling DidDestroy in case the @@ -535,9 +538,9 @@ void PluginInstanceImpl::Delete() { container_ = NULL; } -void PluginInstanceImpl::Paint(WebCanvas* canvas, - const gfx::Rect& plugin_rect, - const gfx::Rect& paint_rect) { +void PepperPluginInstanceImpl::Paint(WebCanvas* canvas, + const gfx::Rect& plugin_rect, + const gfx::Rect& paint_rect) { TRACE_EVENT0("ppapi", "PluginInstance::Paint"); if (module()->is_crashed()) { // Crashed plugin painting. @@ -553,7 +556,7 @@ void PluginInstanceImpl::Paint(WebCanvas* canvas, bound_graphics_2d->Paint(canvas, plugin_rect, paint_rect); } -void PluginInstanceImpl::InvalidateRect(const gfx::Rect& rect) { +void PepperPluginInstanceImpl::InvalidateRect(const gfx::Rect& rect) { if (fullscreen_container_) { if (rect.IsEmpty()) fullscreen_container_->Invalidate(); @@ -570,7 +573,9 @@ void PluginInstanceImpl::InvalidateRect(const gfx::Rect& rect) { } } -void PluginInstanceImpl::ScrollRect(int dx, int dy, const gfx::Rect& rect) { +void PepperPluginInstanceImpl::ScrollRect(int dx, + int dy, + const gfx::Rect& rect) { if (fullscreen_container_) { fullscreen_container_->ScrollRect(dx, dy, rect); } else { @@ -585,12 +590,12 @@ void PluginInstanceImpl::ScrollRect(int dx, int dy, const gfx::Rect& rect) { } } -void PluginInstanceImpl::CommitBackingTexture() { +void PepperPluginInstanceImpl::CommitBackingTexture() { if (texture_layer_.get()) texture_layer_->SetNeedsDisplay(); } -void PluginInstanceImpl::InstanceCrashed() { +void PepperPluginInstanceImpl::InstanceCrashed() { // Force free all resources and vars. HostGlobals::Get()->InstanceCrashed(pp_instance()); @@ -635,9 +640,10 @@ static void SetGPUHistogram(const ::ppapi::Preferences& prefs, #endif } -bool PluginInstanceImpl::Initialize(const std::vector<std::string>& arg_names, - const std::vector<std::string>& arg_values, - bool full_frame) { +bool PepperPluginInstanceImpl::Initialize( + const std::vector<std::string>& arg_names, + const std::vector<std::string>& arg_values, + bool full_frame) { message_channel_.reset(new MessageChannel(this)); full_frame_ = full_frame; @@ -660,7 +666,7 @@ bool PluginInstanceImpl::Initialize(const std::vector<std::string>& arg_names, return success; } -bool PluginInstanceImpl::HandleDocumentLoad( +bool PepperPluginInstanceImpl::HandleDocumentLoad( const WebKit::WebURLResponse& response) { DCHECK(!document_loader_); if (!nacl_document_load_) { @@ -683,7 +689,7 @@ bool PluginInstanceImpl::HandleDocumentLoad( return true; } -bool PluginInstanceImpl::SendCompositionEventToPlugin( +bool PepperPluginInstanceImpl::SendCompositionEventToPlugin( PP_InputEvent_Type type, const base::string16& text) { std::vector<WebKit::WebCompositionUnderline> empty; return SendCompositionEventWithUnderlineInformationToPlugin( @@ -691,14 +697,15 @@ bool PluginInstanceImpl::SendCompositionEventToPlugin( static_cast<int>(text.size())); } -bool PluginInstanceImpl::SendCompositionEventWithUnderlineInformationToPlugin( - PP_InputEvent_Type type, - const base::string16& text, - const std::vector<WebKit::WebCompositionUnderline>& underlines, - int selection_start, - int selection_end) { +bool PepperPluginInstanceImpl:: + SendCompositionEventWithUnderlineInformationToPlugin( + PP_InputEvent_Type type, + const base::string16& text, + const std::vector<WebKit::WebCompositionUnderline>& underlines, + int selection_start, + int selection_end) { // Keep a reference on the stack. See NOTE above. - scoped_refptr<PluginInstanceImpl> ref(this); + scoped_refptr<PepperPluginInstanceImpl> ref(this); if (!LoadInputEventInterface()) return false; @@ -767,19 +774,21 @@ bool PluginInstanceImpl::SendCompositionEventWithUnderlineInformationToPlugin( return handled; } -void PluginInstanceImpl::RequestInputEventsHelper(uint32_t event_classes) { +void PepperPluginInstanceImpl::RequestInputEventsHelper( + uint32_t event_classes) { if (event_classes & PP_INPUTEVENT_CLASS_TOUCH) UpdateTouchEventRequest(); if (event_classes & PP_INPUTEVENT_CLASS_WHEEL) container_->setWantsWheelEvents(IsAcceptingWheelEvents()); } -bool PluginInstanceImpl::HandleCompositionStart(const base::string16& text) { +bool PepperPluginInstanceImpl::HandleCompositionStart( + const base::string16& text) { return SendCompositionEventToPlugin(PP_INPUTEVENT_TYPE_IME_COMPOSITION_START, text); } -bool PluginInstanceImpl::HandleCompositionUpdate( +bool PepperPluginInstanceImpl::HandleCompositionUpdate( const base::string16& text, const std::vector<WebKit::WebCompositionUnderline>& underlines, int selection_start, @@ -789,18 +798,19 @@ bool PluginInstanceImpl::HandleCompositionUpdate( text, underlines, selection_start, selection_end); } -bool PluginInstanceImpl::HandleCompositionEnd(const base::string16& text) { +bool PepperPluginInstanceImpl::HandleCompositionEnd( + const base::string16& text) { return SendCompositionEventToPlugin(PP_INPUTEVENT_TYPE_IME_COMPOSITION_END, text); } -bool PluginInstanceImpl::HandleTextInput(const base::string16& text) { +bool PepperPluginInstanceImpl::HandleTextInput(const base::string16& text) { return SendCompositionEventToPlugin(PP_INPUTEVENT_TYPE_IME_TEXT, text); } -void PluginInstanceImpl::GetSurroundingText(base::string16* text, - ui::Range* range) const { +void PepperPluginInstanceImpl::GetSurroundingText(base::string16* text, + ui::Range* range) const { std::vector<size_t> offsets; offsets.push_back(selection_anchor_); offsets.push_back(selection_caret_); @@ -811,12 +821,12 @@ void PluginInstanceImpl::GetSurroundingText(base::string16* text, : offsets[1]); } -bool PluginInstanceImpl::IsPluginAcceptingCompositionEvents() const { +bool PepperPluginInstanceImpl::IsPluginAcceptingCompositionEvents() const { return (filtered_input_event_mask_ & PP_INPUTEVENT_CLASS_IME) || (input_event_mask_ & PP_INPUTEVENT_CLASS_IME); } -gfx::Rect PluginInstanceImpl::GetCaretBounds() const { +gfx::Rect PepperPluginInstanceImpl::GetCaretBounds() const { if (!text_input_caret_set_) { // If it is never set by the plugin, use the bottom left corner. return gfx::Rect(view_data_.rect.point.x, @@ -834,9 +844,10 @@ gfx::Rect PluginInstanceImpl::GetCaretBounds() const { return caret; } -bool PluginInstanceImpl::HandleInputEvent(const WebKit::WebInputEvent& event, - WebCursorInfo* cursor_info) { - TRACE_EVENT0("ppapi", "PluginInstanceImpl::HandleInputEvent"); +bool PepperPluginInstanceImpl::HandleInputEvent( + const WebKit::WebInputEvent& event, + WebCursorInfo* cursor_info) { + TRACE_EVENT0("ppapi", "PepperPluginInstanceImpl::HandleInputEvent"); if (WebInputEvent::isMouseEventType(event.type)) delegate()->DidReceiveMouseEvent(this); @@ -846,7 +857,7 @@ bool PluginInstanceImpl::HandleInputEvent(const WebKit::WebInputEvent& event, return false; // Keep a reference on the stack. See NOTE above. - scoped_refptr<PluginInstanceImpl> ref(this); + scoped_refptr<PepperPluginInstanceImpl> ref(this); bool rv = false; if (LoadInputEventInterface()) { @@ -892,18 +903,18 @@ bool PluginInstanceImpl::HandleInputEvent(const WebKit::WebInputEvent& event, return rv; } -void PluginInstanceImpl::HandleMessage(PP_Var message) { - TRACE_EVENT0("ppapi", "PluginInstanceImpl::HandleMessage"); +void PepperPluginInstanceImpl::HandleMessage(PP_Var message) { + TRACE_EVENT0("ppapi", "PepperPluginInstanceImpl::HandleMessage"); // Keep a reference on the stack. See NOTE above. - scoped_refptr<PluginInstanceImpl> ref(this); + scoped_refptr<PepperPluginInstanceImpl> ref(this); if (!LoadMessagingInterface()) return; plugin_messaging_interface_->HandleMessage(pp_instance(), message); } -PP_Var PluginInstanceImpl::GetInstanceObject() { +PP_Var PepperPluginInstanceImpl::GetInstanceObject() { // Keep a reference on the stack. See NOTE above. - scoped_refptr<PluginInstanceImpl> ref(this); + scoped_refptr<PepperPluginInstanceImpl> ref(this); // If the plugin supports the private instance interface, try to retrieve its // instance object. @@ -912,7 +923,7 @@ PP_Var PluginInstanceImpl::GetInstanceObject() { return PP_MakeUndefined(); } -void PluginInstanceImpl::ViewChanged( +void PepperPluginInstanceImpl::ViewChanged( const gfx::Rect& position, const gfx::Rect& clip, const std::vector<gfx::Rect>& cut_outs_rects) { @@ -965,7 +976,7 @@ void PluginInstanceImpl::ViewChanged( SendDidChangeView(); } -void PluginInstanceImpl::SetWebKitFocus(bool has_focus) { +void PepperPluginInstanceImpl::SetWebKitFocus(bool has_focus) { if (has_webkit_focus_ == has_focus) return; @@ -975,7 +986,7 @@ void PluginInstanceImpl::SetWebKitFocus(bool has_focus) { SendFocusChangeNotification(); } -void PluginInstanceImpl::SetContentAreaFocus(bool has_focus) { +void PepperPluginInstanceImpl::SetContentAreaFocus(bool has_focus) { if (has_content_area_focus_ == has_focus) return; @@ -985,44 +996,44 @@ void PluginInstanceImpl::SetContentAreaFocus(bool has_focus) { SendFocusChangeNotification(); } -void PluginInstanceImpl::PageVisibilityChanged(bool is_visible) { +void PepperPluginInstanceImpl::PageVisibilityChanged(bool is_visible) { if (is_visible == view_data_.is_page_visible) return; // Nothing to do. view_data_.is_page_visible = is_visible; // If the initial DidChangeView notification hasn't been sent to the plugin, // let it pass the visibility state for us, instead of sending a notification - // immediately. It is possible that PluginInstanceImpl::ViewChanged() hasn't - // been called for the first time. In that case, most of the fields in + // immediately. It is possible that PepperPluginInstanceImpl::ViewChanged() + // hasn't been called for the first time. In that case, most of the fields in // |view_data_| haven't been properly initialized. if (sent_initial_did_change_view_) SendDidChangeView(); } -void PluginInstanceImpl::ViewWillInitiatePaint() { +void PepperPluginInstanceImpl::ViewWillInitiatePaint() { if (GetBoundGraphics2D()) GetBoundGraphics2D()->ViewWillInitiatePaint(); else if (bound_graphics_3d_.get()) bound_graphics_3d_->ViewWillInitiatePaint(); } -void PluginInstanceImpl::ViewInitiatedPaint() { +void PepperPluginInstanceImpl::ViewInitiatedPaint() { if (GetBoundGraphics2D()) GetBoundGraphics2D()->ViewInitiatedPaint(); else if (bound_graphics_3d_.get()) bound_graphics_3d_->ViewInitiatedPaint(); } -void PluginInstanceImpl::ViewFlushedPaint() { +void PepperPluginInstanceImpl::ViewFlushedPaint() { // Keep a reference on the stack. See NOTE above. - scoped_refptr<PluginInstanceImpl> ref(this); + scoped_refptr<PepperPluginInstanceImpl> ref(this); if (GetBoundGraphics2D()) GetBoundGraphics2D()->ViewFlushedPaint(); else if (bound_graphics_3d_.get()) bound_graphics_3d_->ViewFlushedPaint(); } -bool PluginInstanceImpl::GetBitmapForOptimizedPluginPaint( +bool PepperPluginInstanceImpl::GetBitmapForOptimizedPluginPaint( const gfx::Rect& paint_bounds, TransportDIB** dib, gfx::Rect* location, @@ -1079,9 +1090,9 @@ bool PluginInstanceImpl::GetBitmapForOptimizedPluginPaint( return true; } -base::string16 PluginInstanceImpl::GetSelectedText(bool html) { +base::string16 PepperPluginInstanceImpl::GetSelectedText(bool html) { // Keep a reference on the stack. See NOTE above. - scoped_refptr<PluginInstanceImpl> ref(this); + scoped_refptr<PepperPluginInstanceImpl> ref(this); if (!LoadSelectionInterface()) return base::string16(); @@ -1096,9 +1107,10 @@ base::string16 PluginInstanceImpl::GetSelectedText(bool html) { return selection; } -base::string16 PluginInstanceImpl::GetLinkAtPosition(const gfx::Point& point) { +base::string16 PepperPluginInstanceImpl::GetLinkAtPosition( + const gfx::Point& point) { // Keep a reference on the stack. See NOTE above. - scoped_refptr<PluginInstanceImpl> ref(this); + scoped_refptr<PepperPluginInstanceImpl> ref(this); if (!LoadPdfInterface()) return base::string16(); @@ -1115,29 +1127,29 @@ base::string16 PluginInstanceImpl::GetLinkAtPosition(const gfx::Point& point) { return link; } -void PluginInstanceImpl::RequestSurroundingText( +void PepperPluginInstanceImpl::RequestSurroundingText( size_t desired_number_of_characters) { // Keep a reference on the stack. See NOTE above. - scoped_refptr<PluginInstanceImpl> ref(this); + scoped_refptr<PepperPluginInstanceImpl> ref(this); if (!LoadTextInputInterface()) return; plugin_textinput_interface_->RequestSurroundingText( pp_instance(), desired_number_of_characters); } -void PluginInstanceImpl::Zoom(double factor, bool text_only) { +void PepperPluginInstanceImpl::Zoom(double factor, bool text_only) { // Keep a reference on the stack. See NOTE above. - scoped_refptr<PluginInstanceImpl> ref(this); + scoped_refptr<PepperPluginInstanceImpl> ref(this); if (!LoadZoomInterface()) return; plugin_zoom_interface_->Zoom(pp_instance(), factor, PP_FromBool(text_only)); } -bool PluginInstanceImpl::StartFind(const base::string16& search_text, - bool case_sensitive, - int identifier) { +bool PepperPluginInstanceImpl::StartFind(const base::string16& search_text, + bool case_sensitive, + int identifier) { // Keep a reference on the stack. See NOTE above. - scoped_refptr<PluginInstanceImpl> ref(this); + scoped_refptr<PepperPluginInstanceImpl> ref(this); if (!LoadFindInterface()) return false; find_identifier_ = identifier; @@ -1148,24 +1160,24 @@ bool PluginInstanceImpl::StartFind(const base::string16& search_text, PP_FromBool(case_sensitive))); } -void PluginInstanceImpl::SelectFindResult(bool forward) { +void PepperPluginInstanceImpl::SelectFindResult(bool forward) { // Keep a reference on the stack. See NOTE above. - scoped_refptr<PluginInstanceImpl> ref(this); + scoped_refptr<PepperPluginInstanceImpl> ref(this); if (LoadFindInterface()) plugin_find_interface_->SelectFindResult(pp_instance(), PP_FromBool(forward)); } -void PluginInstanceImpl::StopFind() { +void PepperPluginInstanceImpl::StopFind() { // Keep a reference on the stack. See NOTE above. - scoped_refptr<PluginInstanceImpl> ref(this); + scoped_refptr<PepperPluginInstanceImpl> ref(this); if (!LoadFindInterface()) return; find_identifier_ = -1; plugin_find_interface_->StopFind(pp_instance()); } -bool PluginInstanceImpl::LoadFindInterface() { +bool PepperPluginInstanceImpl::LoadFindInterface() { if (!plugin_find_interface_) { plugin_find_interface_ = static_cast<const PPP_Find_Dev*>(module_->GetPluginInterface( @@ -1175,7 +1187,7 @@ bool PluginInstanceImpl::LoadFindInterface() { return !!plugin_find_interface_; } -bool PluginInstanceImpl::LoadInputEventInterface() { +bool PepperPluginInstanceImpl::LoadInputEventInterface() { if (!checked_for_plugin_input_event_interface_) { checked_for_plugin_input_event_interface_ = true; plugin_input_event_interface_ = @@ -1185,7 +1197,7 @@ bool PluginInstanceImpl::LoadInputEventInterface() { return !!plugin_input_event_interface_; } -bool PluginInstanceImpl::LoadMessagingInterface() { +bool PepperPluginInstanceImpl::LoadMessagingInterface() { if (!checked_for_plugin_messaging_interface_) { checked_for_plugin_messaging_interface_ = true; plugin_messaging_interface_ = @@ -1195,7 +1207,7 @@ bool PluginInstanceImpl::LoadMessagingInterface() { return !!plugin_messaging_interface_; } -bool PluginInstanceImpl::LoadMouseLockInterface() { +bool PepperPluginInstanceImpl::LoadMouseLockInterface() { if (!plugin_mouse_lock_interface_) { plugin_mouse_lock_interface_ = static_cast<const PPP_MouseLock*>(module_->GetPluginInterface( @@ -1205,7 +1217,7 @@ bool PluginInstanceImpl::LoadMouseLockInterface() { return !!plugin_mouse_lock_interface_; } -bool PluginInstanceImpl::LoadPdfInterface() { +bool PepperPluginInstanceImpl::LoadPdfInterface() { if (!checked_for_plugin_pdf_interface_) { checked_for_plugin_pdf_interface_ = true; plugin_pdf_interface_ = @@ -1216,7 +1228,7 @@ bool PluginInstanceImpl::LoadPdfInterface() { return !!plugin_pdf_interface_; } -bool PluginInstanceImpl::LoadPrintInterface() { +bool PepperPluginInstanceImpl::LoadPrintInterface() { // Only check for the interface if the plugin has dev permission. if (!module_->permissions().HasPermission(::ppapi::PERMISSION_DEV)) return false; @@ -1227,7 +1239,7 @@ bool PluginInstanceImpl::LoadPrintInterface() { return !!plugin_print_interface_; } -bool PluginInstanceImpl::LoadPrivateInterface() { +bool PepperPluginInstanceImpl::LoadPrivateInterface() { // Only check for the interface if the plugin has private permission. if (!module_->permissions().HasPermission(::ppapi::PERMISSION_PRIVATE)) return false; @@ -1239,7 +1251,7 @@ bool PluginInstanceImpl::LoadPrivateInterface() { return !!plugin_private_interface_; } -bool PluginInstanceImpl::LoadSelectionInterface() { +bool PepperPluginInstanceImpl::LoadSelectionInterface() { if (!plugin_selection_interface_) { plugin_selection_interface_ = static_cast<const PPP_Selection_Dev*>(module_->GetPluginInterface( @@ -1248,7 +1260,7 @@ bool PluginInstanceImpl::LoadSelectionInterface() { return !!plugin_selection_interface_; } -bool PluginInstanceImpl::LoadTextInputInterface() { +bool PepperPluginInstanceImpl::LoadTextInputInterface() { if (!plugin_textinput_interface_) { plugin_textinput_interface_ = static_cast<const PPP_TextInput_Dev*>(module_->GetPluginInterface( @@ -1258,7 +1270,7 @@ bool PluginInstanceImpl::LoadTextInputInterface() { return !!plugin_textinput_interface_; } -bool PluginInstanceImpl::LoadZoomInterface() { +bool PepperPluginInstanceImpl::LoadZoomInterface() { if (!plugin_zoom_interface_) { plugin_zoom_interface_ = static_cast<const PPP_Zoom_Dev*>(module_->GetPluginInterface( @@ -1268,13 +1280,13 @@ bool PluginInstanceImpl::LoadZoomInterface() { return !!plugin_zoom_interface_; } -bool PluginInstanceImpl::PluginHasFocus() const { +bool PepperPluginInstanceImpl::PluginHasFocus() const { return flash_fullscreen_ || (has_webkit_focus_ && has_content_area_focus_); } -void PluginInstanceImpl::SendFocusChangeNotification() { - // This call can happen during PluginInstanceImpl destruction, because WebKit - // informs the plugin it's losing focus. See crbug.com/236574 +void PepperPluginInstanceImpl::SendFocusChangeNotification() { + // This call can happen during PepperPluginInstanceImpl destruction, because + // WebKit informs the plugin it's losing focus. See crbug.com/236574 if (!delegate_ || !instance_interface_) return; bool has_focus = PluginHasFocus(); @@ -1282,7 +1294,7 @@ void PluginInstanceImpl::SendFocusChangeNotification() { instance_interface_->DidChangeFocus(pp_instance(), PP_FromBool(has_focus)); } -void PluginInstanceImpl::UpdateTouchEventRequest() { +void PepperPluginInstanceImpl::UpdateTouchEventRequest() { bool raw_touch = (filtered_input_event_mask_ & PP_INPUTEVENT_CLASS_TOUCH) || (input_event_mask_ & PP_INPUTEVENT_CLASS_TOUCH); container_->requestTouchEventType(raw_touch ? @@ -1290,21 +1302,21 @@ void PluginInstanceImpl::UpdateTouchEventRequest() { WebKit::WebPluginContainer::TouchEventRequestTypeSynthesizedMouse); } -bool PluginInstanceImpl::IsAcceptingWheelEvents() const { +bool PepperPluginInstanceImpl::IsAcceptingWheelEvents() const { return (filtered_input_event_mask_ & PP_INPUTEVENT_CLASS_WHEEL) || (input_event_mask_ & PP_INPUTEVENT_CLASS_WHEEL); } -void PluginInstanceImpl::ScheduleAsyncDidChangeView() { +void PepperPluginInstanceImpl::ScheduleAsyncDidChangeView() { if (view_change_weak_ptr_factory_.HasWeakPtrs()) return; // Already scheduled. base::MessageLoop::current()->PostTask( FROM_HERE, - base::Bind(&PluginInstanceImpl::SendAsyncDidChangeView, + base::Bind(&PepperPluginInstanceImpl::SendAsyncDidChangeView, view_change_weak_ptr_factory_.GetWeakPtr())); } -void PluginInstanceImpl::SendAsyncDidChangeView() { +void PepperPluginInstanceImpl::SendAsyncDidChangeView() { // The bound callback that owns the weak pointer is still valid until after // this function returns. SendDidChangeView checks HasWeakPtrs, so we need to // invalidate them here. @@ -1314,7 +1326,7 @@ void PluginInstanceImpl::SendAsyncDidChangeView() { SendDidChangeView(); } -void PluginInstanceImpl::SendDidChangeView() { +void PepperPluginInstanceImpl::SendDidChangeView() { // Don't send DidChangeView to crashed plugins. if (module()->is_crashed()) return; @@ -1346,7 +1358,7 @@ void PluginInstanceImpl::SendDidChangeView() { &view_data_.clip_rect); } -void PluginInstanceImpl::ReportGeometry() { +void PepperPluginInstanceImpl::ReportGeometry() { // If this call was delayed, we may have transitioned back to fullscreen in // the mean time, so only report the geometry if we are actually in normal // mode. @@ -1354,10 +1366,10 @@ void PluginInstanceImpl::ReportGeometry() { container_->reportGeometry(); } -bool PluginInstanceImpl::GetPreferredPrintOutputFormat( +bool PepperPluginInstanceImpl::GetPreferredPrintOutputFormat( PP_PrintOutputFormat_Dev* format) { // Keep a reference on the stack. See NOTE above. - scoped_refptr<PluginInstanceImpl> ref(this); + scoped_refptr<PepperPluginInstanceImpl> ref(this); if (!LoadPrintInterface()) return false; uint32_t supported_formats = @@ -1369,21 +1381,21 @@ bool PluginInstanceImpl::GetPreferredPrintOutputFormat( return false; } -bool PluginInstanceImpl::SupportsPrintInterface() { +bool PepperPluginInstanceImpl::SupportsPrintInterface() { PP_PrintOutputFormat_Dev format; return GetPreferredPrintOutputFormat(&format); } -bool PluginInstanceImpl::IsPrintScalingDisabled() { +bool PepperPluginInstanceImpl::IsPrintScalingDisabled() { DCHECK(plugin_print_interface_); if (!plugin_print_interface_) return false; return plugin_print_interface_->IsScalingDisabled(pp_instance()) == PP_TRUE; } -int PluginInstanceImpl::PrintBegin(const WebPrintParams& print_params) { +int PepperPluginInstanceImpl::PrintBegin(const WebPrintParams& print_params) { // Keep a reference on the stack. See NOTE above. - scoped_refptr<PluginInstanceImpl> ref(this); + scoped_refptr<PepperPluginInstanceImpl> ref(this); PP_PrintOutputFormat_Dev format; if (!GetPreferredPrintOutputFormat(&format)) { // PrintBegin should not have been called since SupportsPrintInterface @@ -1412,7 +1424,8 @@ int PluginInstanceImpl::PrintBegin(const WebPrintParams& print_params) { return num_pages; } -bool PluginInstanceImpl::PrintPage(int page_number, WebKit::WebCanvas* canvas) { +bool PepperPluginInstanceImpl::PrintPage(int page_number, + WebKit::WebCanvas* canvas) { #if defined(ENABLE_PRINTING) DCHECK(plugin_print_interface_); PP_PrintPageNumberRange_Dev page_range; @@ -1435,12 +1448,12 @@ bool PluginInstanceImpl::PrintPage(int page_number, WebKit::WebCanvas* canvas) { #endif } -bool PluginInstanceImpl::PrintPageHelper( +bool PepperPluginInstanceImpl::PrintPageHelper( PP_PrintPageNumberRange_Dev* page_ranges, int num_ranges, WebKit::WebCanvas* canvas) { // Keep a reference on the stack. See NOTE above. - scoped_refptr<PluginInstanceImpl> ref(this); + scoped_refptr<PepperPluginInstanceImpl> ref(this); DCHECK(plugin_print_interface_); if (!plugin_print_interface_) return false; @@ -1460,9 +1473,9 @@ bool PluginInstanceImpl::PrintPageHelper( return ret; } -void PluginInstanceImpl::PrintEnd() { +void PepperPluginInstanceImpl::PrintEnd() { // Keep a reference on the stack. See NOTE above. - scoped_refptr<PluginInstanceImpl> ref(this); + scoped_refptr<PepperPluginInstanceImpl> ref(this); if (!ranges_.empty()) PrintPageHelper(&(ranges_.front()), ranges_.size(), canvas_.get()); canvas_.clear(); @@ -1478,14 +1491,14 @@ void PluginInstanceImpl::PrintEnd() { #endif // defined(OS_MACOSX) } -bool PluginInstanceImpl::CanRotateView() { +bool PepperPluginInstanceImpl::CanRotateView() { if (!LoadPdfInterface()) return false; return true; } -void PluginInstanceImpl::SetBoundGraphics2DForTest( +void PepperPluginInstanceImpl::SetBoundGraphics2DForTest( PluginDelegate::PlatformGraphics2D* graphics) { BindGraphics(pp_instance(), 0); // Unbind any old stuff. if (graphics) { @@ -1494,7 +1507,7 @@ void PluginInstanceImpl::SetBoundGraphics2DForTest( } } -void PluginInstanceImpl::RotateView(WebPlugin::RotationType type) { +void PepperPluginInstanceImpl::RotateView(WebPlugin::RotationType type) { if (!LoadPdfInterface()) return; PP_PrivatePageTransformType transform_type = @@ -1505,17 +1518,17 @@ void PluginInstanceImpl::RotateView(WebPlugin::RotationType type) { // NOTE: plugin instance may have been deleted. } -bool PluginInstanceImpl::FlashIsFullscreenOrPending() { +bool PepperPluginInstanceImpl::FlashIsFullscreenOrPending() { return fullscreen_container_ != NULL; } -bool PluginInstanceImpl::IsFullscreenOrPending() { +bool PepperPluginInstanceImpl::IsFullscreenOrPending() { return desired_fullscreen_state_; } -bool PluginInstanceImpl::SetFullscreen(bool fullscreen) { +bool PepperPluginInstanceImpl::SetFullscreen(bool fullscreen) { // Keep a reference on the stack. See NOTE above. - scoped_refptr<PluginInstanceImpl> ref(this); + scoped_refptr<PepperPluginInstanceImpl> ref(this); // Check whether we are trying to switch to the state we're already going // to (i.e. if we're already switching to fullscreen but the fullscreen @@ -1549,7 +1562,8 @@ bool PluginInstanceImpl::SetFullscreen(bool fullscreen) { return true; } -void PluginInstanceImpl::UpdateFlashFullscreenState(bool flash_fullscreen) { +void PepperPluginInstanceImpl::UpdateFlashFullscreenState( + bool flash_fullscreen) { bool is_mouselock_pending = TrackedCallback::IsPending(lock_mouse_callback_); if (flash_fullscreen == flash_fullscreen_) { @@ -1583,7 +1597,7 @@ void PluginInstanceImpl::UpdateFlashFullscreenState(bool flash_fullscreen) { SendFocusChangeNotification(); } -bool PluginInstanceImpl::IsViewAccelerated() { +bool PepperPluginInstanceImpl::IsViewAccelerated() { if (!container_) return false; @@ -1598,12 +1612,12 @@ bool PluginInstanceImpl::IsViewAccelerated() { return view->isAcceleratedCompositingActive(); } -PluginDelegate::PlatformContext3D* PluginInstanceImpl::CreateContext3D() { +PluginDelegate::PlatformContext3D* PepperPluginInstanceImpl::CreateContext3D() { return delegate_->CreateContext3D(); } -bool PluginInstanceImpl::PrintPDFOutput(PP_Resource print_output, - WebKit::WebCanvas* canvas) { +bool PepperPluginInstanceImpl::PrintPDFOutput(PP_Resource print_output, + WebKit::WebCanvas* canvas) { #if defined(ENABLE_PRINTING) ::ppapi::thunk::EnterResourceNoLock<PPB_Buffer_API> enter(print_output, true); if (enter.failed()) @@ -1695,13 +1709,13 @@ bool PluginInstanceImpl::PrintPDFOutput(PP_Resource print_output, } PluginDelegate::PlatformGraphics2D* - PluginInstanceImpl::GetBoundGraphics2D() const { + PepperPluginInstanceImpl::GetBoundGraphics2D() const { return bound_graphics_2d_platform_; } static void IgnoreCallback(unsigned, bool) {} -void PluginInstanceImpl::UpdateLayer() { +void PepperPluginInstanceImpl::UpdateLayer() { if (!container_) return; @@ -1745,19 +1759,19 @@ void PluginInstanceImpl::UpdateLayer() { layer_bound_to_fullscreen_ = !!fullscreen_container_; } -void PluginInstanceImpl::AddPluginObject(PluginObject* plugin_object) { +void PepperPluginInstanceImpl::AddPluginObject(PluginObject* plugin_object) { DCHECK(live_plugin_objects_.find(plugin_object) == live_plugin_objects_.end()); live_plugin_objects_.insert(plugin_object); } -void PluginInstanceImpl::RemovePluginObject(PluginObject* plugin_object) { +void PepperPluginInstanceImpl::RemovePluginObject(PluginObject* plugin_object) { // Don't actually verify that the object is in the set since during module // deletion we'll be in the process of freeing them. live_plugin_objects_.erase(plugin_object); } -bool PluginInstanceImpl::IsProcessingUserGesture() { +bool PepperPluginInstanceImpl::IsProcessingUserGesture() { PP_TimeTicks now = ::ppapi::TimeTicksToPPTimeTicks(base::TimeTicks::Now()); // Give a lot of slack so tests won't be flaky. @@ -1766,30 +1780,31 @@ bool PluginInstanceImpl::IsProcessingUserGesture() { (now - pending_user_gesture_ < kUserGestureDurationInSeconds); } -WebUserGestureToken PluginInstanceImpl::CurrentUserGestureToken() { +WebUserGestureToken PepperPluginInstanceImpl::CurrentUserGestureToken() { if (!IsProcessingUserGesture()) pending_user_gesture_token_ = WebUserGestureToken(); return pending_user_gesture_token_; } -void PluginInstanceImpl::OnLockMouseACK(bool succeeded) { +void PepperPluginInstanceImpl::OnLockMouseACK(bool succeeded) { if (TrackedCallback::IsPending(lock_mouse_callback_)) lock_mouse_callback_->Run(succeeded ? PP_OK : PP_ERROR_FAILED); } -void PluginInstanceImpl::OnMouseLockLost() { +void PepperPluginInstanceImpl::OnMouseLockLost() { if (LoadMouseLockInterface()) plugin_mouse_lock_interface_->MouseLockLost(pp_instance()); } -void PluginInstanceImpl::HandleMouseLockedInputEvent( +void PepperPluginInstanceImpl::HandleMouseLockedInputEvent( const WebKit::WebMouseEvent& event) { // |cursor_info| is ignored since it is hidden when the mouse is locked. WebKit::WebCursorInfo cursor_info; HandleInputEvent(event, &cursor_info); } -void PluginInstanceImpl::SimulateInputEvent(const InputEventData& input_event) { +void PepperPluginInstanceImpl::SimulateInputEvent( + const InputEventData& input_event) { WebView* web_view = container()->element().document().frame()->view(); if (!web_view) { NOTREACHED(); @@ -1811,7 +1826,8 @@ void PluginInstanceImpl::SimulateInputEvent(const InputEventData& input_event) { } } -bool PluginInstanceImpl::SimulateIMEEvent(const InputEventData& input_event) { +bool PepperPluginInstanceImpl::SimulateIMEEvent( + const InputEventData& input_event) { switch (input_event.event_type) { case PP_INPUTEVENT_TYPE_IME_COMPOSITION_START: case PP_INPUTEVENT_TYPE_IME_COMPOSITION_UPDATE: @@ -1831,7 +1847,7 @@ bool PluginInstanceImpl::SimulateIMEEvent(const InputEventData& input_event) { return true; } -void PluginInstanceImpl::SimulateImeSetCompositionEvent( +void PepperPluginInstanceImpl::SimulateImeSetCompositionEvent( const InputEventData& input_event) { std::vector<size_t> offsets; offsets.push_back(input_event.composition_selection_start); @@ -1857,7 +1873,8 @@ void PluginInstanceImpl::SimulateImeSetCompositionEvent( utf16_text, underlines, offsets[0], offsets[1]); } -ContentDecryptorDelegate* PluginInstanceImpl::GetContentDecryptorDelegate() { +ContentDecryptorDelegate* + PepperPluginInstanceImpl::GetContentDecryptorDelegate() { if (content_decryptor_delegate_) return content_decryptor_delegate_.get(); @@ -1873,9 +1890,9 @@ ContentDecryptorDelegate* PluginInstanceImpl::GetContentDecryptorDelegate() { return content_decryptor_delegate_.get(); } -PP_Bool PluginInstanceImpl::BindGraphics(PP_Instance instance, - PP_Resource device) { - TRACE_EVENT0("ppapi", "PluginInstanceImpl::BindGraphics"); +PP_Bool PepperPluginInstanceImpl::BindGraphics(PP_Instance instance, + PP_Resource device) { + TRACE_EVENT0("ppapi", "PepperPluginInstanceImpl::BindGraphics"); // The Graphics3D instance can't be destroyed until we call // UpdateLayer(). scoped_refptr< ::ppapi::Resource> old_graphics = bound_graphics_3d_.get(); @@ -1928,19 +1945,19 @@ PP_Bool PluginInstanceImpl::BindGraphics(PP_Instance instance, return PP_FALSE; } -PP_Bool PluginInstanceImpl::IsFullFrame(PP_Instance instance) { +PP_Bool PepperPluginInstanceImpl::IsFullFrame(PP_Instance instance) { return PP_FromBool(full_frame()); } -const ViewData* PluginInstanceImpl::GetViewData(PP_Instance instance) { +const ViewData* PepperPluginInstanceImpl::GetViewData(PP_Instance instance) { return &view_data_; } -PP_Bool PluginInstanceImpl::FlashIsFullscreen(PP_Instance instance) { +PP_Bool PepperPluginInstanceImpl::FlashIsFullscreen(PP_Instance instance) { return PP_FromBool(flash_fullscreen_); } -PP_Var PluginInstanceImpl::GetWindowObject(PP_Instance instance) { +PP_Var PepperPluginInstanceImpl::GetWindowObject(PP_Instance instance) { if (!container_) return PP_MakeUndefined(); @@ -1951,19 +1968,19 @@ PP_Var PluginInstanceImpl::GetWindowObject(PP_Instance instance) { return NPObjectToPPVar(this, frame->windowObject()); } -PP_Var PluginInstanceImpl::GetOwnerElementObject(PP_Instance instance) { +PP_Var PepperPluginInstanceImpl::GetOwnerElementObject(PP_Instance instance) { if (!container_) return PP_MakeUndefined(); return NPObjectToPPVar(this, container_->scriptableObjectForElement()); } -PP_Var PluginInstanceImpl::ExecuteScript(PP_Instance instance, - PP_Var script, - PP_Var* exception) { +PP_Var PepperPluginInstanceImpl::ExecuteScript(PP_Instance instance, + PP_Var script, + PP_Var* exception) { // Executing the script may remove the plugin from the DOM, so we need to keep // a reference to ourselves so that we can still process the result after the // WebBindings::evaluate() below. - scoped_refptr<PluginInstanceImpl> ref(this); + scoped_refptr<PepperPluginInstanceImpl> ref(this); TryCatch try_catch(exception); if (try_catch.has_exception()) return PP_MakeUndefined(); @@ -2008,17 +2025,17 @@ PP_Var PluginInstanceImpl::ExecuteScript(PP_Instance instance, return ret; } -uint32_t PluginInstanceImpl::GetAudioHardwareOutputSampleRate( +uint32_t PepperPluginInstanceImpl::GetAudioHardwareOutputSampleRate( PP_Instance instance) { return delegate()->GetAudioHardwareOutputSampleRate(); } -uint32_t PluginInstanceImpl::GetAudioHardwareOutputBufferSize( +uint32_t PepperPluginInstanceImpl::GetAudioHardwareOutputBufferSize( PP_Instance instance) { return delegate()->GetAudioHardwareOutputBufferSize(); } -PP_Var PluginInstanceImpl::GetDefaultCharSet(PP_Instance instance) { +PP_Var PepperPluginInstanceImpl::GetDefaultCharSet(PP_Instance instance) { std::string encoding = delegate()->GetDefaultEncoding(); return StringVar::StringToPPVar(encoding); } @@ -2027,45 +2044,46 @@ PP_Var PluginInstanceImpl::GetDefaultCharSet(PP_Instance instance) { // PPP_ContentDecryptor_Private calls made on |content_decryptor_delegate_|. // Therefore, |content_decryptor_delegate_| must have been initialized when // the following methods are called. -void PluginInstanceImpl::NeedKey(PP_Instance instance, - PP_Var key_system_var, - PP_Var session_id_var, - PP_Var init_data_var) { +void PepperPluginInstanceImpl::NeedKey(PP_Instance instance, + PP_Var key_system_var, + PP_Var session_id_var, + PP_Var init_data_var) { content_decryptor_delegate_->NeedKey( key_system_var, session_id_var, init_data_var); } -void PluginInstanceImpl::KeyAdded(PP_Instance instance, - PP_Var key_system_var, - PP_Var session_id_var) { +void PepperPluginInstanceImpl::KeyAdded(PP_Instance instance, + PP_Var key_system_var, + PP_Var session_id_var) { content_decryptor_delegate_->KeyAdded(key_system_var, session_id_var); } -void PluginInstanceImpl::KeyMessage(PP_Instance instance, - PP_Var key_system_var, - PP_Var session_id_var, - PP_Var message_var, - PP_Var default_url_var) { +void PepperPluginInstanceImpl::KeyMessage(PP_Instance instance, + PP_Var key_system_var, + PP_Var session_id_var, + PP_Var message_var, + PP_Var default_url_var) { content_decryptor_delegate_->KeyMessage( key_system_var, session_id_var, message_var, default_url_var); } -void PluginInstanceImpl::KeyError(PP_Instance instance, - PP_Var key_system_var, - PP_Var session_id_var, - int32_t media_error, - int32_t system_code) { +void PepperPluginInstanceImpl::KeyError(PP_Instance instance, + PP_Var key_system_var, + PP_Var session_id_var, + int32_t media_error, + int32_t system_code) { content_decryptor_delegate_->KeyError( key_system_var, session_id_var, media_error, system_code); } -void PluginInstanceImpl::DeliverBlock(PP_Instance instance, - PP_Resource decrypted_block, - const PP_DecryptedBlockInfo* block_info) { +void PepperPluginInstanceImpl::DeliverBlock( + PP_Instance instance, + PP_Resource decrypted_block, + const PP_DecryptedBlockInfo* block_info) { content_decryptor_delegate_->DeliverBlock(decrypted_block, block_info); } -void PluginInstanceImpl::DecoderInitializeDone( +void PepperPluginInstanceImpl::DecoderInitializeDone( PP_Instance instance, PP_DecryptorStreamType decoder_type, uint32_t request_id, @@ -2074,7 +2092,7 @@ void PluginInstanceImpl::DecoderInitializeDone( decoder_type, request_id, success); } -void PluginInstanceImpl::DecoderDeinitializeDone( +void PepperPluginInstanceImpl::DecoderDeinitializeDone( PP_Instance instance, PP_DecryptorStreamType decoder_type, uint32_t request_id) { @@ -2082,56 +2100,60 @@ void PluginInstanceImpl::DecoderDeinitializeDone( request_id); } -void PluginInstanceImpl::DecoderResetDone(PP_Instance instance, - PP_DecryptorStreamType decoder_type, - uint32_t request_id) { +void PepperPluginInstanceImpl::DecoderResetDone( + PP_Instance instance, + PP_DecryptorStreamType decoder_type, + uint32_t request_id) { content_decryptor_delegate_->DecoderResetDone(decoder_type, request_id); } -void PluginInstanceImpl::DeliverFrame(PP_Instance instance, - PP_Resource decrypted_frame, - const PP_DecryptedFrameInfo* frame_info) { +void PepperPluginInstanceImpl::DeliverFrame( + PP_Instance instance, + PP_Resource decrypted_frame, + const PP_DecryptedFrameInfo* frame_info) { content_decryptor_delegate_->DeliverFrame(decrypted_frame, frame_info); } -void PluginInstanceImpl::DeliverSamples( +void PepperPluginInstanceImpl::DeliverSamples( PP_Instance instance, PP_Resource audio_frames, const PP_DecryptedBlockInfo* block_info) { content_decryptor_delegate_->DeliverSamples(audio_frames, block_info); } -void PluginInstanceImpl::NumberOfFindResultsChanged(PP_Instance instance, - int32_t total, - PP_Bool final_result) { +void PepperPluginInstanceImpl::NumberOfFindResultsChanged( + PP_Instance instance, + int32_t total, + PP_Bool final_result) { DCHECK_NE(find_identifier_, -1); delegate_->NumberOfFindResultsChanged(find_identifier_, total, PP_ToBool(final_result)); } -void PluginInstanceImpl::SelectedFindResultChanged(PP_Instance instance, - int32_t index) { +void PepperPluginInstanceImpl::SelectedFindResultChanged(PP_Instance instance, + int32_t index) { DCHECK_NE(find_identifier_, -1); delegate_->SelectedFindResultChanged(find_identifier_, index); } -PP_Bool PluginInstanceImpl::IsFullscreen(PP_Instance instance) { +PP_Bool PepperPluginInstanceImpl::IsFullscreen(PP_Instance instance) { return PP_FromBool(view_data_.is_fullscreen); } -PP_Bool PluginInstanceImpl::SetFullscreen(PP_Instance instance, - PP_Bool fullscreen) { +PP_Bool PepperPluginInstanceImpl::SetFullscreen(PP_Instance instance, + PP_Bool fullscreen) { return PP_FromBool(SetFullscreen(PP_ToBool(fullscreen))); } -PP_Bool PluginInstanceImpl::GetScreenSize(PP_Instance instance, PP_Size* size) { +PP_Bool PepperPluginInstanceImpl::GetScreenSize(PP_Instance instance, + PP_Size* size) { gfx::Size screen_size = delegate()->GetScreenSize(); *size = PP_MakeSize(screen_size.width(), screen_size.height()); return PP_TRUE; } -::ppapi::Resource* PluginInstanceImpl::GetSingletonResource( +::ppapi::Resource* PepperPluginInstanceImpl::GetSingletonResource( PP_Instance instance, ::ppapi::SingletonResourceID id) { // Flash APIs and some others aren't implemented in-process. @@ -2157,15 +2179,15 @@ PP_Bool PluginInstanceImpl::GetScreenSize(PP_Instance instance, PP_Size* size) { return NULL; } -int32_t PluginInstanceImpl::RequestInputEvents(PP_Instance instance, - uint32_t event_classes) { +int32_t PepperPluginInstanceImpl::RequestInputEvents(PP_Instance instance, + uint32_t event_classes) { input_event_mask_ |= event_classes; filtered_input_event_mask_ &= ~(event_classes); RequestInputEventsHelper(event_classes); return ValidateRequestInputEvents(false, event_classes); } -int32_t PluginInstanceImpl::RequestFilteringInputEvents( +int32_t PepperPluginInstanceImpl::RequestFilteringInputEvents( PP_Instance instance, uint32_t event_classes) { filtered_input_event_mask_ |= event_classes; @@ -2174,14 +2196,15 @@ int32_t PluginInstanceImpl::RequestFilteringInputEvents( return ValidateRequestInputEvents(true, event_classes); } -void PluginInstanceImpl::ClearInputEventRequest(PP_Instance instance, - uint32_t event_classes) { +void PepperPluginInstanceImpl::ClearInputEventRequest(PP_Instance instance, + uint32_t event_classes) { input_event_mask_ &= ~(event_classes); filtered_input_event_mask_ &= ~(event_classes); RequestInputEventsHelper(event_classes); } -void PluginInstanceImpl::ZoomChanged(PP_Instance instance, double factor) { +void PepperPluginInstanceImpl::ZoomChanged(PP_Instance instance, + double factor) { // We only want to tell the page to change its zoom if the whole page is the // plugin. If we're in an iframe, then don't do anything. if (!IsFullPagePlugin()) @@ -2189,9 +2212,9 @@ void PluginInstanceImpl::ZoomChanged(PP_Instance instance, double factor) { container()->zoomLevelChanged(WebView::zoomFactorToZoomLevel(factor)); } -void PluginInstanceImpl::ZoomLimitsChanged(PP_Instance instance, - double minimum_factor, - double maximium_factor) { +void PepperPluginInstanceImpl::ZoomLimitsChanged(PP_Instance instance, + double minimum_factor, + double maximium_factor) { if (minimum_factor > maximium_factor) { NOTREACHED(); return; @@ -2199,14 +2222,15 @@ void PluginInstanceImpl::ZoomLimitsChanged(PP_Instance instance, delegate()->ZoomLimitsChanged(minimum_factor, maximium_factor); } -void PluginInstanceImpl::PostMessage(PP_Instance instance, PP_Var message) { +void PepperPluginInstanceImpl::PostMessage(PP_Instance instance, + PP_Var message) { message_channel_->PostMessageToJavaScript(message); } -PP_Bool PluginInstanceImpl::SetCursor(PP_Instance instance, - PP_MouseCursor_Type type, - PP_Resource image, - const PP_Point* hot_spot) { +PP_Bool PepperPluginInstanceImpl::SetCursor(PP_Instance instance, + PP_MouseCursor_Type type, + PP_Resource image, + const PP_Point* hot_spot) { if (!ValidateSetCursorParams(type, image, hot_spot)) return PP_FALSE; @@ -2242,8 +2266,9 @@ PP_Bool PluginInstanceImpl::SetCursor(PP_Instance instance, return PP_TRUE; } -int32_t PluginInstanceImpl::LockMouse(PP_Instance instance, - scoped_refptr<TrackedCallback> callback) { +int32_t PepperPluginInstanceImpl::LockMouse( + PP_Instance instance, + scoped_refptr<TrackedCallback> callback) { if (TrackedCallback::IsPending(lock_mouse_callback_)) return PP_ERROR_INPROGRESS; @@ -2271,12 +2296,12 @@ int32_t PluginInstanceImpl::LockMouse(PP_Instance instance, return PP_OK_COMPLETIONPENDING; } -void PluginInstanceImpl::UnlockMouse(PP_Instance instance) { +void PepperPluginInstanceImpl::UnlockMouse(PP_Instance instance) { delegate()->UnlockMouse(this); } -void PluginInstanceImpl::SetTextInputType(PP_Instance instance, - PP_TextInput_Type type) { +void PepperPluginInstanceImpl::SetTextInputType(PP_Instance instance, + PP_TextInput_Type type) { int itype = type; if (itype < 0 || itype > ui::TEXT_INPUT_TYPE_URL) itype = ui::TEXT_INPUT_TYPE_NONE; @@ -2284,20 +2309,21 @@ void PluginInstanceImpl::SetTextInputType(PP_Instance instance, delegate()->PluginTextInputTypeChanged(this); } -void PluginInstanceImpl::UpdateCaretPosition(PP_Instance instance, - const PP_Rect& caret, - const PP_Rect& bounding_box) { +void PepperPluginInstanceImpl::UpdateCaretPosition( + PP_Instance instance, + const PP_Rect& caret, + const PP_Rect& bounding_box) { text_input_caret_ = PP_ToGfxRect(caret); text_input_caret_bounds_ = PP_ToGfxRect(bounding_box); text_input_caret_set_ = true; delegate()->PluginCaretPositionChanged(this); } -void PluginInstanceImpl::CancelCompositionText(PP_Instance instance) { +void PepperPluginInstanceImpl::CancelCompositionText(PP_Instance instance) { delegate()->PluginRequestedCancelComposition(this); } -void PluginInstanceImpl::SelectionChanged(PP_Instance instance) { +void PepperPluginInstanceImpl::SelectionChanged(PP_Instance instance) { // TODO(kinaba): currently the browser always calls RequestSurroundingText. // It can be optimized so that it won't call it back until the information // is really needed. @@ -2308,22 +2334,22 @@ void PluginInstanceImpl::SelectionChanged(PP_Instance instance) { // lifetime of the instance. base::MessageLoop::current()->PostTask( FROM_HERE, - base::Bind(&PluginInstanceImpl::RequestSurroundingText, + base::Bind(&PepperPluginInstanceImpl::RequestSurroundingText, AsWeakPtr(), static_cast<size_t>(kExtraCharsForTextInput))); } -void PluginInstanceImpl::UpdateSurroundingText(PP_Instance instance, - const char* text, - uint32_t caret, - uint32_t anchor) { +void PepperPluginInstanceImpl::UpdateSurroundingText(PP_Instance instance, + const char* text, + uint32_t caret, + uint32_t anchor) { surrounding_text_ = text; selection_caret_ = caret; selection_anchor_ = anchor; delegate()->PluginSelectionChanged(this); } -PP_Var PluginInstanceImpl::ResolveRelativeToDocument( +PP_Var PepperPluginInstanceImpl::ResolveRelativeToDocument( PP_Instance instance, PP_Var relative, PP_URLComponents_Dev* components) { @@ -2338,8 +2364,8 @@ PP_Var PluginInstanceImpl::ResolveRelativeToDocument( components); } -PP_Bool PluginInstanceImpl::DocumentCanRequest(PP_Instance instance, - PP_Var url) { +PP_Bool PepperPluginInstanceImpl::DocumentCanRequest(PP_Instance instance, + PP_Var url) { StringVar* url_string = StringVar::FromPPVar(url); if (!url_string) return PP_FALSE; @@ -2355,8 +2381,9 @@ PP_Bool PluginInstanceImpl::DocumentCanRequest(PP_Instance instance, return BoolToPPBool(security_origin.canRequest(gurl)); } -PP_Bool PluginInstanceImpl::DocumentCanAccessDocument(PP_Instance instance, - PP_Instance target) { +PP_Bool PepperPluginInstanceImpl::DocumentCanAccessDocument( + PP_Instance instance, + PP_Instance target) { WebKit::WebSecurityOrigin our_origin; if (!SecurityOriginForInstance(instance, &our_origin)) return PP_FALSE; @@ -2368,21 +2395,22 @@ PP_Bool PluginInstanceImpl::DocumentCanAccessDocument(PP_Instance instance, return BoolToPPBool(our_origin.canAccess(target_origin)); } -PP_Var PluginInstanceImpl::GetDocumentURL(PP_Instance instance, - PP_URLComponents_Dev* components) { +PP_Var PepperPluginInstanceImpl::GetDocumentURL( + PP_Instance instance, + PP_URLComponents_Dev* components) { WebKit::WebDocument document = container()->element().document(); return ::ppapi::PPB_URLUtil_Shared::GenerateURLReturn(document.url(), components); } -PP_Var PluginInstanceImpl::GetPluginInstanceURL( +PP_Var PepperPluginInstanceImpl::GetPluginInstanceURL( PP_Instance instance, PP_URLComponents_Dev* components) { return ::ppapi::PPB_URLUtil_Shared::GenerateURLReturn(plugin_url_, components); } -PP_ExternalPluginResult PluginInstanceImpl::ResetAsProxied( +PP_ExternalPluginResult PepperPluginInstanceImpl::ResetAsProxied( scoped_refptr<PluginModule> module) { // Save the original module and switch over to the new one now that this // plugin is using the IPC-based proxy. @@ -2453,54 +2481,53 @@ PP_ExternalPluginResult PluginInstanceImpl::ResetAsProxied( return PP_EXTERNAL_PLUGIN_OK; } -bool PluginInstanceImpl::IsValidInstanceOf(PluginModule* module) { +bool PepperPluginInstanceImpl::IsValidInstanceOf(PluginModule* module) { DCHECK(module); return module == module_.get() || module == original_module_.get(); } -NPP PluginInstanceImpl::instanceNPP() { +NPP PepperPluginInstanceImpl::instanceNPP() { return npp_.get(); } -v8::Isolate* PluginInstanceImpl::GetIsolate() const { +v8::Isolate* PepperPluginInstanceImpl::GetIsolate() const { return isolate_; } -PluginInstance* PluginInstance::Get(PP_Instance instance_id) { +PepperPluginInstance* PepperPluginInstance::Get(PP_Instance instance_id) { return HostGlobals::Get()->GetInstance(instance_id); } -content::RenderView* PluginInstanceImpl::GetRenderView() { +RenderView* PepperPluginInstanceImpl::GetRenderView() { return render_view_; } -WebKit::WebPluginContainer* PluginInstanceImpl::GetContainer() { +WebKit::WebPluginContainer* PepperPluginInstanceImpl::GetContainer() { return container_; } -::ppapi::VarTracker* PluginInstanceImpl::GetVarTracker() { +::ppapi::VarTracker* PepperPluginInstanceImpl::GetVarTracker() { return HostGlobals::Get()->GetVarTracker(); } -const GURL& PluginInstanceImpl::GetPluginURL() { +const GURL& PepperPluginInstanceImpl::GetPluginURL() { return plugin_url_; } -base::FilePath PluginInstanceImpl::GetModulePath() { +base::FilePath PepperPluginInstanceImpl::GetModulePath() { return module_->path(); } -PP_Resource PluginInstanceImpl::CreateExternalFileReference( +PP_Resource PepperPluginInstanceImpl::CreateExternalFileReference( const base::FilePath& external_file_path) { - webkit::ppapi::PPB_FileRef_Impl* ref = - webkit::ppapi::PPB_FileRef_Impl::CreateExternal( - pp_instance(), external_file_path, ""); + PPB_FileRef_Impl* ref = PPB_FileRef_Impl::CreateExternal( + pp_instance(), external_file_path, ""); return ref->GetReference(); } -PP_Resource PluginInstanceImpl::CreateImage(gfx::ImageSkia* source_image, - float scale) { +PP_Resource PepperPluginInstanceImpl::CreateImage(gfx::ImageSkia* source_image, + float scale) { ui::ScaleFactor scale_factor = ui::GetScaleFactorFromScale(scale); gfx::ImageSkiaRep image_skia_rep = source_image->GetRepresentation( scale_factor); @@ -2508,19 +2535,18 @@ PP_Resource PluginInstanceImpl::CreateImage(gfx::ImageSkia* source_image, if (image_skia_rep.is_null() || image_skia_rep.scale_factor() != scale_factor) return 0; - scoped_refptr<webkit::ppapi::PPB_ImageData_Impl> image_data( - new webkit::ppapi::PPB_ImageData_Impl( - pp_instance(), - webkit::ppapi::PPB_ImageData_Impl::PLATFORM)); + scoped_refptr<PPB_ImageData_Impl> image_data(new PPB_ImageData_Impl( + pp_instance(), + PPB_ImageData_Impl::PLATFORM)); if (!image_data->Init( - webkit::ppapi::PPB_ImageData_Impl::GetNativeImageDataFormat(), + PPB_ImageData_Impl::GetNativeImageDataFormat(), image_skia_rep.pixel_width(), image_skia_rep.pixel_height(), false)) { return 0; } - webkit::ppapi::ImageDataAutoMapper mapper(image_data.get()); + ImageDataAutoMapper mapper(image_data.get()); if (!mapper.is_valid()) return 0; @@ -2532,7 +2558,7 @@ PP_Resource PluginInstanceImpl::CreateImage(gfx::ImageSkia* source_image, return image_data->GetReference(); } -PP_ExternalPluginResult PluginInstanceImpl::SwitchToOutOfProcessProxy( +PP_ExternalPluginResult PepperPluginInstanceImpl::SwitchToOutOfProcessProxy( const base::FilePath& file_path, ::ppapi::PpapiPermissions permissions, const IPC::ChannelHandle& channel_handle, @@ -2542,10 +2568,10 @@ PP_ExternalPluginResult PluginInstanceImpl::SwitchToOutOfProcessProxy( // the IPC based out-of-process proxy. We can't use the existing module, // because it is configured for the in-process plugin, and we must keep it // that way to allow the page to create other instances. - scoped_refptr<webkit::ppapi::PluginModule> external_plugin_module( + scoped_refptr<PluginModule> external_plugin_module( module_->CreateModuleForExternalPluginInstance()); - content::RendererPpapiHost* renderer_ppapi_host = + RendererPpapiHost* renderer_ppapi_host = delegate_->CreateExternalPluginModule( external_plugin_module, file_path, @@ -2562,11 +2588,11 @@ PP_ExternalPluginResult PluginInstanceImpl::SwitchToOutOfProcessProxy( return external_plugin_module->InitAsProxiedExternalPlugin(this); } -void PluginInstanceImpl::SetAlwaysOnTop(bool on_top) { +void PepperPluginInstanceImpl::SetAlwaysOnTop(bool on_top) { always_on_top_ = on_top; } -void PluginInstanceImpl::DoSetCursor(WebCursorInfo* cursor) { +void PepperPluginInstanceImpl::DoSetCursor(WebCursorInfo* cursor) { cursor_.reset(cursor); if (fullscreen_container_) { fullscreen_container_->DidChangeCursor(*cursor); @@ -2575,16 +2601,16 @@ void PluginInstanceImpl::DoSetCursor(WebCursorInfo* cursor) { } } -bool PluginInstanceImpl::IsFullPagePlugin() { +bool PepperPluginInstanceImpl::IsFullPagePlugin() { WebFrame* frame = container()->element().document().frame(); return frame->view()->mainFrame()->document().isPluginDocument(); } -void PluginInstanceImpl::FlashSetFullscreen(bool fullscreen, - bool delay_report) { - TRACE_EVENT0("ppapi", "PluginInstanceImpl::FlashSetFullscreen"); +void PepperPluginInstanceImpl::FlashSetFullscreen(bool fullscreen, + bool delay_report) { + TRACE_EVENT0("ppapi", "PepperPluginInstanceImpl::FlashSetFullscreen"); // Keep a reference on the stack. See NOTE above. - scoped_refptr<PluginInstanceImpl> ref(this); + scoped_refptr<PepperPluginInstanceImpl> ref(this); // We check whether we are trying to switch to the state we're already going // to (i.e. if we're already switching to fullscreen but the fullscreen @@ -2607,21 +2633,23 @@ void PluginInstanceImpl::FlashSetFullscreen(bool fullscreen, ReportGeometry(); } else { base::MessageLoop::current()->PostTask( - FROM_HERE, base::Bind(&PluginInstanceImpl::ReportGeometry, this)); + FROM_HERE, + base::Bind(&PepperPluginInstanceImpl::ReportGeometry, this)); } } } -bool PluginInstanceImpl::IsRectTopmost(const gfx::Rect& rect) { +bool PepperPluginInstanceImpl::IsRectTopmost(const gfx::Rect& rect) { if (flash_fullscreen_) return true; return container_->isRectTopmost(rect); } -int32_t PluginInstanceImpl::Navigate(const ::ppapi::URLRequestInfoData& request, - const char* target, - bool from_user_action) { +int32_t PepperPluginInstanceImpl::Navigate( + const ::ppapi::URLRequestInfoData& request, + const char* target, + bool from_user_action) { if (!container_) return PP_ERROR_FAILED; @@ -2663,7 +2691,7 @@ int32_t PluginInstanceImpl::Navigate(const ::ppapi::URLRequestInfoData& request, return PP_OK; } -bool PluginInstanceImpl::CanAccessMainFrame() const { +bool PepperPluginInstanceImpl::CanAccessMainFrame() const { if (!container_) return false; WebKit::WebDocument containing_document = container_->element().document(); @@ -2680,7 +2708,7 @@ bool PluginInstanceImpl::CanAccessMainFrame() const { main_document.securityOrigin()); } -void PluginInstanceImpl::KeepSizeAttributesBeforeFullscreen() { +void PepperPluginInstanceImpl::KeepSizeAttributesBeforeFullscreen() { WebElement element = container_->element(); width_before_fullscreen_ = element.getAttribute(WebString::fromUTF8(kWidth)); height_before_fullscreen_ = @@ -2690,7 +2718,7 @@ void PluginInstanceImpl::KeepSizeAttributesBeforeFullscreen() { style_before_fullscreen_ = element.getAttribute(WebString::fromUTF8(kStyle)); } -void PluginInstanceImpl::SetSizeAttributesForFullscreen() { +void PepperPluginInstanceImpl::SetSizeAttributesForFullscreen() { screen_size_for_fullscreen_ = delegate()->GetScreenSize(); std::string width = StringPrintf("%d", screen_size_for_fullscreen_.width()); std::string height = StringPrintf("%d", screen_size_for_fullscreen_.height()); @@ -2713,7 +2741,7 @@ void PluginInstanceImpl::SetSizeAttributesForFullscreen() { container_->element().setAttribute(kStyle, WebString::fromUTF8(style)); } -void PluginInstanceImpl::ResetSizeAttributesAfterFullscreen() { +void PepperPluginInstanceImpl::ResetSizeAttributesAfterFullscreen() { screen_size_for_fullscreen_ = gfx::Size(); WebElement element = container_->element(); element.setAttribute(WebString::fromUTF8(kWidth), width_before_fullscreen_); @@ -2722,5 +2750,4 @@ void PluginInstanceImpl::ResetSizeAttributesAfterFullscreen() { element.setAttribute(WebString::fromUTF8(kStyle), style_before_fullscreen_); } -} // namespace ppapi -} // namespace webkit +} // namespace content diff --git a/content/renderer/pepper/ppapi_plugin_instance_impl.h b/content/renderer/pepper/pepper_plugin_instance_impl.h index c5d22c4..9b01645 100644 --- a/content/renderer/pepper/ppapi_plugin_instance_impl.h +++ b/content/renderer/pepper/pepper_plugin_instance_impl.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CONTENT_RENDERER_PEPPER_PPAPI_PLUGIN_INSTANCE_IMPL_H_ -#define CONTENT_RENDERER_PEPPER_PPAPI_PLUGIN_INSTANCE_IMPL_H_ +#ifndef CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_INSTANCE_IMPL_H_ +#define CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_INSTANCE_IMPL_H_ #include <set> #include <string> @@ -16,7 +16,7 @@ #include "base/strings/string16.h" #include "cc/layers/texture_layer_client.h" #include "content/common/content_export.h" -#include "content/public/renderer/ppapi_plugin_instance.h" +#include "content/public/renderer/pepper_plugin_instance.h" #include "content/renderer/pepper/plugin_delegate.h" #include "content/renderer/pepper/ppp_pdf.h" #include "ppapi/c/dev/pp_cursor_type_dev.h" @@ -92,8 +92,7 @@ namespace v8 { class Isolate; } -namespace webkit { -namespace ppapi { +namespace content { class ContentDecryptorDelegate; class FullscreenContainer; @@ -107,21 +106,21 @@ class PPB_URLLoader_Impl; // Represents one time a plugin appears on one web page. // -// Note: to get from a PP_Instance to a PluginInstance*, use the +// Note: to get from a PP_Instance to a PepperPluginInstance*, use the // ResourceTracker. -class CONTENT_EXPORT PluginInstanceImpl - : public base::RefCounted<PluginInstanceImpl>, - public base::SupportsWeakPtr<PluginInstanceImpl>, - public NON_EXPORTED_BASE(PluginInstance), +class CONTENT_EXPORT PepperPluginInstanceImpl + : public base::RefCounted<PepperPluginInstanceImpl>, + public base::SupportsWeakPtr<PepperPluginInstanceImpl>, + public NON_EXPORTED_BASE(PepperPluginInstance), public ::ppapi::PPB_Instance_Shared { public: - // Create and return a PluginInstanceImpl object which supports the most + // Create and return a PepperPluginInstanceImpl object which supports the most // recent version of PPP_Instance possible by querying the given // get_plugin_interface function. If the plugin does not support any valid // PPP_Instance interface, returns NULL. - static PluginInstanceImpl* Create( + static PepperPluginInstanceImpl* Create( PluginDelegate* delegate, - content::RenderView* render_view, + RenderView* render_view, PluginModule* module, WebKit::WebPluginContainer* container, const GURL& plugin_url); @@ -352,8 +351,8 @@ class CONTENT_EXPORT PluginInstanceImpl ContentDecryptorDelegate* GetContentDecryptorDelegate(); - // webkit::ppapi::PluginInstance implementation - virtual content::RenderView* GetRenderView() OVERRIDE; + // PluginInstance implementation + virtual RenderView* GetRenderView() OVERRIDE; virtual WebKit::WebPluginContainer* GetContainer() OVERRIDE; virtual ::ppapi::VarTracker* GetVarTracker() OVERRIDE; virtual const GURL& GetPluginURL() OVERRIDE; @@ -508,11 +507,11 @@ class CONTENT_EXPORT PluginInstanceImpl v8::Isolate* GetIsolate() const; private: - friend class base::RefCounted<PluginInstanceImpl>; + friend class base::RefCounted<PepperPluginInstanceImpl>; friend class PpapiUnittest; // Delete should be called by the WebPlugin before this destructor. - virtual ~PluginInstanceImpl(); + virtual ~PepperPluginInstanceImpl(); // Class to record document load notifications and play them back once the // real document loader becomes available. Used only by NaCl instances. @@ -540,7 +539,7 @@ class CONTENT_EXPORT PluginInstanceImpl }; // Implements PPB_Gamepad_API. This is just to avoid having an excessive - // number of interfaces implemented by PluginInstanceImpl. + // number of interfaces implemented by PepperPluginInstanceImpl. class GamepadImpl : public ::ppapi::thunk::PPB_Gamepad_API, public ::ppapi::Resource { public: @@ -554,16 +553,16 @@ class CONTENT_EXPORT PluginInstanceImpl PluginDelegate* delegate_; }; - // See the static Create functions above for creating PluginInstanceImpl + // See the static Create functions above for creating PepperPluginInstanceImpl // objects. This constructor is private so that we can hide the // PPP_Instance_Combined details while still having 1 constructor to maintain // for member initialization. - PluginInstanceImpl(PluginDelegate* delegate, - content::RenderView* render_view, - PluginModule* module, - ::ppapi::PPP_Instance_Combined* instance_interface, - WebKit::WebPluginContainer* container, - const GURL& plugin_url); + PepperPluginInstanceImpl(PluginDelegate* delegate, + RenderView* render_view, + PluginModule* module, + ::ppapi::PPP_Instance_Combined* instance_interface, + WebKit::WebPluginContainer* container, + const GURL& plugin_url); bool LoadFindInterface(); bool LoadInputEventInterface(); @@ -649,7 +648,7 @@ class CONTENT_EXPORT PluginInstanceImpl void ResetSizeAttributesAfterFullscreen(); PluginDelegate* delegate_; - content::RenderView* render_view_; + RenderView* render_view_; scoped_refptr<PluginModule> module_; scoped_ptr< ::ppapi::PPP_Instance_Combined> instance_interface_; // If this is the NaCl plugin, we create a new module when we switch to the @@ -689,7 +688,7 @@ class CONTENT_EXPORT PluginInstanceImpl // already a weak ptr pending (HasWeakPtrs is true), code should update the // view_data_ but not send updates. This also allows us to cancel scheduled // view change events. - base::WeakPtrFactory<PluginInstanceImpl> view_change_weak_ptr_factory_; + base::WeakPtrFactory<PepperPluginInstanceImpl> view_change_weak_ptr_factory_; // The current device context for painting in 2D and 3D. scoped_refptr<PPB_Graphics3D_Impl> bound_graphics_3d_; @@ -855,10 +854,9 @@ class CONTENT_EXPORT PluginInstanceImpl v8::Isolate* isolate_; friend class PpapiPluginInstanceTest; - DISALLOW_COPY_AND_ASSIGN(PluginInstanceImpl); + DISALLOW_COPY_AND_ASSIGN(PepperPluginInstanceImpl); }; -} // namespace ppapi -} // namespace webkit +} // namespace content -#endif // CONTENT_RENDERER_PEPPER_PPAPI_PLUGIN_INSTANCE_IMPL_H_ +#endif // CONTENT_RENDERER_PEPPER_PEPPER_PLUGIN_INSTANCE_IMPL_H_ diff --git a/content/renderer/pepper/ppapi_plugin_instance_unittest.cc b/content/renderer/pepper/pepper_plugin_instance_unittest.cc index ceaac04..5aa6e4a 100644 --- a/content/renderer/pepper/ppapi_plugin_instance_unittest.cc +++ b/content/renderer/pepper/pepper_plugin_instance_unittest.cc @@ -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 "content/renderer/pepper/ppapi_plugin_instance_impl.h" +#include "content/renderer/pepper/pepper_plugin_instance_impl.h" #include "base/basictypes.h" #include "base/memory/ref_counted.h" @@ -13,8 +13,7 @@ #include "ui/gfx/rect.h" #include "ui/gfx/safe_integer_conversions.h" -namespace webkit { -namespace ppapi { +namespace content { namespace { @@ -41,7 +40,7 @@ class MockPlatformGraphics2D : public PluginDelegate::PlatformGraphics2D { const PP_Point* top_left) OVERRIDE { return false; } - virtual bool BindToInstance(PluginInstanceImpl* new_instance) OVERRIDE { + virtual bool BindToInstance(PepperPluginInstanceImpl* new_instance) OVERRIDE { bound_instance_ = new_instance; return true; } @@ -62,7 +61,7 @@ class MockPlatformGraphics2D : public PluginDelegate::PlatformGraphics2D { private: PPB_ImageData_Impl* image_data_; float scale_; - PluginInstanceImpl* bound_instance_; + PepperPluginInstanceImpl* bound_instance_; DISALLOW_COPY_AND_ASSIGN(MockPlatformGraphics2D); }; @@ -123,5 +122,4 @@ TEST_F(PpapiPluginInstanceTest, GetBitmap2xScale) { EXPECT_EQ(scale, bitmap_scale); } -} // namespace ppapi -} // namespace webkit +} // namespace content diff --git a/content/renderer/pepper/pepper_plugin_registry.cc b/content/renderer/pepper/pepper_plugin_registry.cc index 96634d1..a5ae346 100644 --- a/content/renderer/pepper/pepper_plugin_registry.cc +++ b/content/renderer/pepper/pepper_plugin_registry.cc @@ -40,8 +40,7 @@ const PepperPluginInfo* PepperPluginRegistry::GetInfoForPlugin( return &plugin_list_[plugin_list_.size() - 1]; } -webkit::ppapi::PluginModule* PepperPluginRegistry::GetLiveModule( - const base::FilePath& path) { +PluginModule* PepperPluginRegistry::GetLiveModule(const base::FilePath& path) { NonOwningModuleMap::iterator it = live_modules_.find(path); if (it == live_modules_.end()) return NULL; @@ -49,13 +48,12 @@ webkit::ppapi::PluginModule* PepperPluginRegistry::GetLiveModule( } void PepperPluginRegistry::AddLiveModule(const base::FilePath& path, - webkit::ppapi::PluginModule* module) { + PluginModule* module) { DCHECK(live_modules_.find(path) == live_modules_.end()); live_modules_[path] = module; } -void PepperPluginRegistry::PluginModuleDead( - webkit::ppapi::PluginModule* dead_module) { +void PepperPluginRegistry::PluginModuleDead(PluginModule* dead_module) { // DANGER: Don't dereference the dead_module pointer! It may be in the // process of being deleted. @@ -92,9 +90,9 @@ PepperPluginRegistry::PepperPluginRegistry() { if (current.is_out_of_process) continue; // Out of process plugins need no special pre-initialization. - scoped_refptr<webkit::ppapi::PluginModule> module = - new webkit::ppapi::PluginModule(current.name, current.path, - ppapi::PpapiPermissions(current.permissions)); + scoped_refptr<PluginModule> module = new PluginModule( + current.name, current.path, + ppapi::PpapiPermissions(current.permissions)); AddLiveModule(current.path, module.get()); if (current.is_internal) { if (!module->InitAsInternalPlugin(current.internal_entry_points)) { diff --git a/content/renderer/pepper/pepper_plugin_registry.h b/content/renderer/pepper/pepper_plugin_registry.h index ee8fd7cb..7bd6ff9 100644 --- a/content/renderer/pepper/pepper_plugin_registry.h +++ b/content/renderer/pepper/pepper_plugin_registry.h @@ -11,13 +11,8 @@ #include "base/memory/ref_counted.h" #include "content/public/common/pepper_plugin_info.h" -namespace webkit { -namespace ppapi { -class PluginModule; -} -} - namespace content { +class PluginModule; // This class holds references to all of the known pepper plugin modules. // @@ -40,16 +35,15 @@ class PepperPluginRegistry { // both preloaded in-process or currently active (non crashed) out-of-process // plugins matching the given name. Returns NULL if the plugin hasn't been // loaded. - webkit::ppapi::PluginModule* GetLiveModule(const base::FilePath& path); + PluginModule* GetLiveModule(const base::FilePath& path); // Notifies the registry that a new non-preloaded module has been created. // This is normally called for out-of-process plugins. Once this is called, // the module is available to be returned by GetModule(). The module will // automatically unregister itself by calling PluginModuleDestroyed(). - void AddLiveModule(const base::FilePath& path, - webkit::ppapi::PluginModule* module); + void AddLiveModule(const base::FilePath& path, PluginModule* module); - void PluginModuleDead(webkit::ppapi::PluginModule* dead_module); + void PluginModuleDead(PluginModule* dead_module); private: PepperPluginRegistry(); @@ -59,8 +53,7 @@ class PepperPluginRegistry { // Plugins that have been preloaded so they can be executed in-process in // the renderer (the sandbox prevents on-demand loading). - typedef std::map<base::FilePath, - scoped_refptr<webkit::ppapi::PluginModule> > + typedef std::map<base::FilePath, scoped_refptr<PluginModule> > OwningModuleMap; OwningModuleMap preloaded_modules_; @@ -70,8 +63,7 @@ class PepperPluginRegistry { // non-crashed modules. If an out-of-process module crashes, it may // continue as long as there are WebKit references to it, but it will not // appear in this list. - typedef std::map<base::FilePath, webkit::ppapi::PluginModule*> - NonOwningModuleMap; + typedef std::map<base::FilePath, PluginModule*> NonOwningModuleMap; NonOwningModuleMap live_modules_; DISALLOW_COPY_AND_ASSIGN(PepperPluginRegistry); diff --git a/content/renderer/pepper/pepper_truetype_font_linux.cc b/content/renderer/pepper/pepper_truetype_font_linux.cc index 2e3326a..53abf13 100644 --- a/content/renderer/pepper/pepper_truetype_font_linux.cc +++ b/content/renderer/pepper/pepper_truetype_font_linux.cc @@ -65,11 +65,11 @@ PepperTrueTypeFontLinux::PepperTrueTypeFontLinux( } } - fd_ = content::MatchFontWithFallback( - desc_.family.c_str(), - desc_.weight >= PP_TRUETYPEFONTWEIGHT_BOLD, - desc_.style & PP_TRUETYPEFONTSTYLE_ITALIC, - desc_.charset); + fd_ = MatchFontWithFallback( + desc_.family.c_str(), + desc_.weight >= PP_TRUETYPEFONTWEIGHT_BOLD, + desc_.style & PP_TRUETYPEFONTSTYLE_ITALIC, + desc_.charset); } PepperTrueTypeFontLinux::~PepperTrueTypeFontLinux() { @@ -89,11 +89,11 @@ int32_t PepperTrueTypeFontLinux::GetTableTags(std::vector<uint32_t>* tags) { // Get the 2 byte numTables field at an offset of 4 in the font. uint8_t num_tables_buf[2]; size_t output_length = sizeof(num_tables_buf); - if (!content::GetFontTable(fd_, - 0 /* tag */, - 4 /* offset */, - reinterpret_cast<uint8_t*>(&num_tables_buf), - &output_length)) + if (!GetFontTable(fd_, + 0 /* tag */, + 4 /* offset */, + reinterpret_cast<uint8_t*>(&num_tables_buf), + &output_length)) return PP_ERROR_FAILED; DCHECK(output_length == sizeof(num_tables_buf)); // Font data is stored in big-endian order. @@ -105,11 +105,11 @@ int32_t PepperTrueTypeFontLinux::GetTableTags(std::vector<uint32_t>* tags) { output_length = num_tables * kTableEntrySize; scoped_ptr<uint8_t[]> table_entries(new uint8_t[output_length]); // Get the table directory entries, which follow the font header. - if (!content::GetFontTable(fd_, - 0 /* tag */, - kFontHeaderSize /* offset */, - table_entries.get(), - &output_length)) + if (!GetFontTable(fd_, + 0 /* tag */, + kFontHeaderSize /* offset */, + table_entries.get(), + &output_length)) return PP_ERROR_FAILED; DCHECK(output_length == num_tables * kTableEntrySize); @@ -134,14 +134,14 @@ int32_t PepperTrueTypeFontLinux::GetTable(uint32_t table_tag, size_t table_size = 0; // Tags are byte swapped on Linux. table_tag = base::ByteSwap(table_tag); - if (!content::GetFontTable(fd_, table_tag, offset, NULL, &table_size)) + if (!GetFontTable(fd_, table_tag, offset, NULL, &table_size)) return PP_ERROR_FAILED; // Only retrieve as much as the caller requested. table_size = std::min(table_size, static_cast<size_t>(max_data_length)); data->resize(table_size); - if (!content::GetFontTable(fd_, table_tag, offset, - reinterpret_cast<uint8_t*>(&(*data)[0]), - &table_size)) + if (!GetFontTable(fd_, table_tag, offset, + reinterpret_cast<uint8_t*>(&(*data)[0]), + &table_size)) return PP_ERROR_FAILED; return base::checked_numeric_cast<int32_t>(table_size); diff --git a/content/renderer/pepper/pepper_truetype_font_win.cc b/content/renderer/pepper/pepper_truetype_font_win.cc index 95da297..e515bd1 100644 --- a/content/renderer/pepper/pepper_truetype_font_win.cc +++ b/content/renderer/pepper/pepper_truetype_font_win.cc @@ -152,7 +152,7 @@ DWORD PepperTrueTypeFontWin::GetFontData(HDC hdc, LOGFONTW logfont; if (!::GetObject(font_, sizeof(LOGFONTW), &logfont)) return GDI_ERROR; - content::RenderThread* render_thread = content::RenderThread::Get(); + RenderThread* render_thread = RenderThread::Get(); if (!render_thread) return GDI_ERROR; render_thread->PreCacheFont(logfont); diff --git a/content/renderer/pepper/pepper_url_loader_host.cc b/content/renderer/pepper/pepper_url_loader_host.cc index 3087ebc..e60096a 100644 --- a/content/renderer/pepper/pepper_url_loader_host.cc +++ b/content/renderer/pepper/pepper_url_loader_host.cc @@ -4,7 +4,7 @@ #include "content/renderer/pepper/pepper_url_loader_host.h" -#include "content/renderer/pepper/ppapi_plugin_instance_impl.h" +#include "content/renderer/pepper/pepper_plugin_instance_impl.h" #include "content/renderer/pepper/renderer_ppapi_host_impl.h" #include "content/renderer/pepper/url_request_info_util.h" #include "content/renderer/pepper/url_response_info_util.h" @@ -83,7 +83,7 @@ PepperURLLoaderHost::~PepperURLLoaderHost() { // will get queued inside WebKit. if (main_document_loader_) { // The PluginInstance has a non-owning pointer to us. - webkit::ppapi::PluginInstanceImpl* instance_object = + PepperPluginInstanceImpl* instance_object = renderer_ppapi_host_->GetPluginInstanceImpl(pp_instance()); if (instance_object) { DCHECK(instance_object->document_loader() == this); @@ -235,8 +235,7 @@ int32_t PepperURLLoaderHost::InternalOnHostMsgOpen( // the file refs. ppapi::URLRequestInfoData filled_in_request_data = request_data; - if (webkit::ppapi::URLRequestRequiresUniversalAccess( - filled_in_request_data) && + if (URLRequestRequiresUniversalAccess(filled_in_request_data) && !has_universal_access_) { ppapi::PpapiGlobals::Get()->LogWithSource( pp_instance(), PP_LOGLEVEL_ERROR, std::string(), @@ -254,8 +253,7 @@ int32_t PepperURLLoaderHost::InternalOnHostMsgOpen( if (!frame) return PP_ERROR_FAILED; WebURLRequest web_request; - if (!webkit::ppapi::CreateWebURLRequest(&filled_in_request_data, frame, - &web_request)) + if (!CreateWebURLRequest(&filled_in_request_data, frame, &web_request)) return PP_ERROR_FAILED; web_request.setRequestorProcessID(renderer_ppapi_host_->GetPluginPID()); @@ -331,7 +329,7 @@ void PepperURLLoaderHost::Close() { } WebKit::WebFrame* PepperURLLoaderHost::GetFrame() { - webkit::ppapi::PluginInstance* instance_object = + PepperPluginInstance* instance_object = renderer_ppapi_host_->GetPluginInstance(pp_instance()); if (!instance_object) return NULL; diff --git a/content/renderer/pepper/pepper_url_request_unittest.cc b/content/renderer/pepper/pepper_url_request_unittest.cc index 08cae5a..20e7f92 100644 --- a/content/renderer/pepper/pepper_url_request_unittest.cc +++ b/content/renderer/pepper/pepper_url_request_unittest.cc @@ -51,10 +51,9 @@ class TestWebFrameClient : public WebFrameClient { using ppapi::proxy::URLRequestInfoResource; using ppapi::URLRequestInfoData; -namespace webkit { -namespace ppapi { +namespace content { -class URLRequestInfoTest : public content::RenderViewTest { +class URLRequestInfoTest : public RenderViewTest { public: URLRequestInfoTest() : pp_instance_(1234) { } @@ -253,5 +252,4 @@ TEST_F(URLRequestInfoTest, SetHeaders) { // TODO(bbudge) Unit tests for AppendDataToBody, AppendFileToBody. -} // namespace ppapi -} // namespace webkit +} // namespace content diff --git a/content/renderer/pepper/pepper_video_capture_host.cc b/content/renderer/pepper/pepper_video_capture_host.cc index cef1e88..b1aa2e8 100644 --- a/content/renderer/pepper/pepper_video_capture_host.cc +++ b/content/renderer/pepper/pepper_video_capture_host.cc @@ -5,7 +5,7 @@ #include "content/renderer/pepper/pepper_video_capture_host.h" #include "content/renderer/pepper/host_globals.h" -#include "content/renderer/pepper/ppapi_plugin_instance_impl.h" +#include "content/renderer/pepper/pepper_plugin_instance_impl.h" #include "content/renderer/pepper/renderer_ppapi_host_impl.h" #include "ppapi/host/dispatch_host_message.h" #include "ppapi/host/ppapi_host.h" @@ -22,8 +22,6 @@ using ppapi::HostResource; using ppapi::TrackedCallback; using ppapi::thunk::EnterResourceNoLock; using ppapi::thunk::PPB_Buffer_API; -using webkit::ppapi::HostGlobals; -using webkit::ppapi::PPB_Buffer_Impl; namespace { @@ -241,8 +239,8 @@ void PepperVideoCaptureHost::OnDeviceInfoReceived( info, buffer_host_resources, size))); } -webkit::ppapi::PluginDelegate* PepperVideoCaptureHost::GetPluginDelegate() { - webkit::ppapi::PluginInstanceImpl* instance = +PluginDelegate* PepperVideoCaptureHost::GetPluginDelegate() { + PepperPluginInstanceImpl* instance = renderer_ppapi_host_->GetPluginInstanceImpl(pp_instance()); if (instance) return instance->delegate(); @@ -257,13 +255,13 @@ int32_t PepperVideoCaptureHost::OnOpen( if (platform_video_capture_.get()) return PP_ERROR_FAILED; - webkit::ppapi::PluginDelegate* plugin_delegate = GetPluginDelegate(); + PluginDelegate* plugin_delegate = GetPluginDelegate(); if (!plugin_delegate) return PP_ERROR_FAILED; SetRequestedInfo(requested_info, buffer_count); - webkit::ppapi::PluginInstance* instance = + PepperPluginInstance* instance = renderer_ppapi_host_->GetPluginInstance(pp_instance()); if (!instance) return PP_ERROR_FAILED; diff --git a/content/renderer/pepper/pepper_video_capture_host.h b/content/renderer/pepper/pepper_video_capture_host.h index 9fdc299..e01c1b1 100644 --- a/content/renderer/pepper/pepper_video_capture_host.h +++ b/content/renderer/pepper/pepper_video_capture_host.h @@ -22,7 +22,7 @@ class RendererPpapiHostImpl; class PepperVideoCaptureHost : public ppapi::host::ResourceHost, - public webkit::ppapi::PluginDelegate::PlatformVideoCaptureEventHandler, + public PluginDelegate::PlatformVideoCaptureEventHandler, public PepperDeviceEnumerationHostHelper::Delegate { public: PepperVideoCaptureHost(RendererPpapiHostImpl* host, @@ -53,7 +53,7 @@ class PepperVideoCaptureHost const media::VideoCaptureParams& device_info) OVERRIDE; // PepperDeviceEnumerationHostHelper::Delegate implementation. - virtual webkit::ppapi::PluginDelegate* GetPluginDelegate() OVERRIDE; + virtual PluginDelegate* GetPluginDelegate() OVERRIDE; private: int32_t OnOpen(ppapi::host::HostMessageContext* context, @@ -78,8 +78,7 @@ class PepperVideoCaptureHost bool SetStatus(PP_VideoCaptureStatus_Dev status, bool forced); - scoped_refptr<webkit::ppapi::PluginDelegate::PlatformVideoCapture> - platform_video_capture_; + scoped_refptr<PluginDelegate::PlatformVideoCapture> platform_video_capture_; // Buffers of video frame. struct BufferInfo { @@ -88,7 +87,7 @@ class PepperVideoCaptureHost bool in_use; void* data; - scoped_refptr<webkit::ppapi::PPB_Buffer_Impl> buffer; + scoped_refptr<PPB_Buffer_Impl> buffer; }; RendererPpapiHostImpl* renderer_ppapi_host_; diff --git a/content/renderer/pepper/pepper_video_destination_host.cc b/content/renderer/pepper/pepper_video_destination_host.cc index 2ab0657..4c19b90 100644 --- a/content/renderer/pepper/pepper_video_destination_host.cc +++ b/content/renderer/pepper/pepper_video_destination_host.cc @@ -53,7 +53,7 @@ int32_t PepperVideoDestinationHost::OnHostMsgOpen( if (!gurl.is_valid()) return PP_ERROR_BADARGUMENT; - content::FrameWriterInterface* frame_writer = NULL; + FrameWriterInterface* frame_writer = NULL; if (!VideoDestinationHandler::Open(NULL /* factory */, NULL /* registry */, gurl.spec(), @@ -76,10 +76,10 @@ int32_t PepperVideoDestinationHost::OnHostMsgPutFrame( image_data_resource.host_resource(), true); if (enter.failed()) return PP_ERROR_BADRESOURCE; - webkit::ppapi::PPB_ImageData_Impl* image_data_impl = - static_cast<webkit::ppapi::PPB_ImageData_Impl*>(enter.object()); + PPB_ImageData_Impl* image_data_impl = + static_cast<PPB_ImageData_Impl*>(enter.object()); - if (!webkit::ppapi::PPB_ImageData_Impl::IsImageDataFormatSupported( + if (!PPB_ImageData_Impl::IsImageDataFormatSupported( image_data_impl->format())) return PP_ERROR_BADARGUMENT; diff --git a/content/renderer/pepper/pepper_video_destination_host.h b/content/renderer/pepper/pepper_video_destination_host.h index d65c489..fd5cfe7 100644 --- a/content/renderer/pepper/pepper_video_destination_host.h +++ b/content/renderer/pepper/pepper_video_destination_host.h @@ -42,7 +42,7 @@ class CONTENT_EXPORT PepperVideoDestinationHost base::WeakPtrFactory<PepperVideoDestinationHost> weak_factory_; - scoped_ptr<content::FrameWriterInterface> frame_writer_; + scoped_ptr<FrameWriterInterface> frame_writer_; DISALLOW_COPY_AND_ASSIGN(PepperVideoDestinationHost); }; diff --git a/content/renderer/pepper/pepper_video_source_host.cc b/content/renderer/pepper/pepper_video_source_host.cc index 165c5c0..eb37144 100644 --- a/content/renderer/pepper/pepper_video_source_host.cc +++ b/content/renderer/pepper/pepper_video_source_host.cc @@ -66,7 +66,7 @@ PepperVideoSourceHost::PepperVideoSourceHost( : ResourceHost(host->GetPpapiHost(), instance, resource), renderer_ppapi_host_(host), weak_factory_(this), - source_handler_(new content::VideoSourceHandler(NULL)), + source_handler_(new VideoSourceHandler(NULL)), frame_receiver_(new FrameReceiver(weak_factory_.GetWeakPtr())), get_frame_pending_(false) { } @@ -160,9 +160,9 @@ void PepperVideoSourceHost::SendGetFrameReply() { return; } - webkit::ppapi::PPB_ImageData_Impl* image_data = - static_cast<webkit::ppapi::PPB_ImageData_Impl*>(enter_resource.object()); - webkit::ppapi::ImageDataAutoMapper mapper(image_data); + PPB_ImageData_Impl* image_data = + static_cast<PPB_ImageData_Impl*>(enter_resource.object()); + ImageDataAutoMapper mapper(image_data); if (!mapper.is_valid()) { SendGetFrameErrorReply(PP_ERROR_FAILED); return; diff --git a/content/renderer/pepper/pepper_video_source_host.h b/content/renderer/pepper/pepper_video_source_host.h index 355f43b..e5fbaa8 100644 --- a/content/renderer/pepper/pepper_video_source_host.h +++ b/content/renderer/pepper/pepper_video_source_host.h @@ -36,12 +36,12 @@ class CONTENT_EXPORT PepperVideoSourceHost : public ppapi::host::ResourceHost { private: // This helper object receives frames on a video worker thread and passes // them on to us. - class FrameReceiver : public content::FrameReaderInterface, + class FrameReceiver : public FrameReaderInterface, public base::RefCountedThreadSafe<FrameReceiver> { public: explicit FrameReceiver(const base::WeakPtr<PepperVideoSourceHost>& host); - // content::FrameReaderInterface implementation. + // FrameReaderInterface implementation. virtual bool GotFrame(cricket::VideoFrame* frame) OVERRIDE; void OnGotFrame(scoped_ptr<cricket::VideoFrame> frame); @@ -75,7 +75,7 @@ class CONTENT_EXPORT PepperVideoSourceHost : public ppapi::host::ResourceHost { ppapi::host::ReplyMessageContext reply_context_; - scoped_ptr<content::VideoSourceHandler> source_handler_; + scoped_ptr<VideoSourceHandler> source_handler_; scoped_refptr<FrameReceiver> frame_receiver_; std::string stream_url_; scoped_ptr<cricket::VideoFrame> last_frame_; diff --git a/content/renderer/pepper/ppapi_webplugin_impl.cc b/content/renderer/pepper/pepper_webplugin_impl.cc index a3bca36..1adebba 100644 --- a/content/renderer/pepper/ppapi_webplugin_impl.cc +++ b/content/renderer/pepper/pepper_webplugin_impl.cc @@ -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 "content/renderer/pepper/ppapi_webplugin_impl.h" +#include "content/renderer/pepper/pepper_webplugin_impl.h" #include <cmath> @@ -10,8 +10,8 @@ #include "base/message_loop/message_loop.h" #include "content/renderer/pepper/message_channel.h" #include "content/renderer/pepper/npobject_var.h" +#include "content/renderer/pepper/pepper_plugin_instance_impl.h" #include "content/renderer/pepper/plugin_module.h" -#include "content/renderer/pepper/ppapi_plugin_instance_impl.h" #include "ppapi/shared_impl/ppapi_globals.h" #include "ppapi/shared_impl/var_tracker.h" #include "third_party/WebKit/public/platform/WebPoint.h" @@ -43,23 +43,22 @@ using WebKit::WebURL; using WebKit::WebVector; using WebKit::WebView; -namespace webkit { -namespace ppapi { +namespace content { -struct WebPluginImpl::InitData { +struct PepperWebPluginImpl::InitData { scoped_refptr<PluginModule> module; base::WeakPtr<PluginDelegate> delegate; - base::WeakPtr<content::RenderView> render_view; + base::WeakPtr<RenderView> render_view; std::vector<std::string> arg_names; std::vector<std::string> arg_values; GURL url; }; -WebPluginImpl::WebPluginImpl( +PepperWebPluginImpl::PepperWebPluginImpl( PluginModule* plugin_module, const WebPluginParams& params, const base::WeakPtr<PluginDelegate>& plugin_delegate, - const base::WeakPtr<content::RenderView>& render_view) + const base::WeakPtr<RenderView>& render_view) : init_data_(new InitData()), full_frame_(params.loadManually), instance_object_(PP_MakeUndefined()), @@ -78,14 +77,14 @@ WebPluginImpl::WebPluginImpl( base::debug::SetCrashKeyValue("subresource_url", init_data_->url.spec()); } -WebPluginImpl::~WebPluginImpl() { +PepperWebPluginImpl::~PepperWebPluginImpl() { } -WebKit::WebPluginContainer* WebPluginImpl::container() const { +WebKit::WebPluginContainer* PepperWebPluginImpl::container() const { return container_; } -bool WebPluginImpl::initialize(WebPluginContainer* container) { +bool PepperWebPluginImpl::initialize(WebPluginContainer* container) { // The plugin delegate may have gone away. if (!init_data_->delegate.get()) return false; @@ -121,7 +120,7 @@ bool WebPluginImpl::initialize(WebPluginContainer* container) { return true; } -void WebPluginImpl::destroy() { +void PepperWebPluginImpl::destroy() { // Tell |container_| to clear references to this plugin's script objects. if (container_) container_->clearScriptObjects(); @@ -136,7 +135,7 @@ void WebPluginImpl::destroy() { base::MessageLoop::current()->DeleteSoon(FROM_HERE, this); } -NPObject* WebPluginImpl::scriptableObject() { +NPObject* PepperWebPluginImpl::scriptableObject() { // Call through the plugin to get its instance object. The plugin should pass // us a reference which we release in destroy(). if (instance_object_.type == PP_VARTYPE_UNDEFINED) @@ -158,20 +157,20 @@ NPObject* WebPluginImpl::scriptableObject() { return message_channel_np_object; } -NPP WebPluginImpl::pluginNPP() { +NPP PepperWebPluginImpl::pluginNPP() { return instance_->instanceNPP(); } -bool WebPluginImpl::getFormValue(WebString& value) { +bool PepperWebPluginImpl::getFormValue(WebString& value) { return false; } -void WebPluginImpl::paint(WebCanvas* canvas, const WebRect& rect) { +void PepperWebPluginImpl::paint(WebCanvas* canvas, const WebRect& rect) { if (!instance_->FlashIsFullscreenOrPending()) instance_->Paint(canvas, plugin_rect_, rect); } -void WebPluginImpl::updateGeometry( +void PepperWebPluginImpl::updateGeometry( const WebRect& window_rect, const WebRect& clip_rect, const WebVector<WebRect>& cut_outs_rects, @@ -185,124 +184,124 @@ void WebPluginImpl::updateGeometry( } } -void WebPluginImpl::updateFocus(bool focused) { +void PepperWebPluginImpl::updateFocus(bool focused) { instance_->SetWebKitFocus(focused); } -void WebPluginImpl::updateVisibility(bool visible) { +void PepperWebPluginImpl::updateVisibility(bool visible) { } -bool WebPluginImpl::acceptsInputEvents() { +bool PepperWebPluginImpl::acceptsInputEvents() { return true; } -bool WebPluginImpl::handleInputEvent(const WebKit::WebInputEvent& event, - WebKit::WebCursorInfo& cursor_info) { +bool PepperWebPluginImpl::handleInputEvent(const WebKit::WebInputEvent& event, + WebKit::WebCursorInfo& cursor_info) { if (instance_->FlashIsFullscreenOrPending()) return false; return instance_->HandleInputEvent(event, &cursor_info); } -void WebPluginImpl::didReceiveResponse( +void PepperWebPluginImpl::didReceiveResponse( const WebKit::WebURLResponse& response) { DCHECK(!instance_->document_loader()); instance_->HandleDocumentLoad(response); } -void WebPluginImpl::didReceiveData(const char* data, int data_length) { +void PepperWebPluginImpl::didReceiveData(const char* data, int data_length) { WebKit::WebURLLoaderClient* document_loader = instance_->document_loader(); if (document_loader) document_loader->didReceiveData(NULL, data, data_length, 0); } -void WebPluginImpl::didFinishLoading() { +void PepperWebPluginImpl::didFinishLoading() { WebKit::WebURLLoaderClient* document_loader = instance_->document_loader(); if (document_loader) document_loader->didFinishLoading(NULL, 0.0); } -void WebPluginImpl::didFailLoading(const WebKit::WebURLError& error) { +void PepperWebPluginImpl::didFailLoading(const WebKit::WebURLError& error) { WebKit::WebURLLoaderClient* document_loader = instance_->document_loader(); if (document_loader) document_loader->didFail(NULL, error); } -void WebPluginImpl::didFinishLoadingFrameRequest(const WebKit::WebURL& url, - void* notify_data) { +void PepperWebPluginImpl::didFinishLoadingFrameRequest( + const WebKit::WebURL& url, + void* notify_data) { } -void WebPluginImpl::didFailLoadingFrameRequest( +void PepperWebPluginImpl::didFailLoadingFrameRequest( const WebKit::WebURL& url, void* notify_data, const WebKit::WebURLError& error) { } -bool WebPluginImpl::hasSelection() const { +bool PepperWebPluginImpl::hasSelection() const { return !selectionAsText().isEmpty(); } -WebString WebPluginImpl::selectionAsText() const { +WebString PepperWebPluginImpl::selectionAsText() const { return instance_->GetSelectedText(false); } -WebString WebPluginImpl::selectionAsMarkup() const { +WebString PepperWebPluginImpl::selectionAsMarkup() const { return instance_->GetSelectedText(true); } -WebURL WebPluginImpl::linkAtPosition(const WebPoint& position) const { +WebURL PepperWebPluginImpl::linkAtPosition(const WebPoint& position) const { return GURL(instance_->GetLinkAtPosition(position)); } -void WebPluginImpl::setZoomLevel(double level, bool text_only) { +void PepperWebPluginImpl::setZoomLevel(double level, bool text_only) { instance_->Zoom(WebView::zoomLevelToZoomFactor(level), text_only); } -bool WebPluginImpl::startFind(const WebKit::WebString& search_text, - bool case_sensitive, - int identifier) { +bool PepperWebPluginImpl::startFind(const WebKit::WebString& search_text, + bool case_sensitive, + int identifier) { return instance_->StartFind(search_text, case_sensitive, identifier); } -void WebPluginImpl::selectFindResult(bool forward) { +void PepperWebPluginImpl::selectFindResult(bool forward) { instance_->SelectFindResult(forward); } -void WebPluginImpl::stopFind() { +void PepperWebPluginImpl::stopFind() { instance_->StopFind(); } -bool WebPluginImpl::supportsPaginatedPrint() { +bool PepperWebPluginImpl::supportsPaginatedPrint() { return instance_->SupportsPrintInterface(); } -bool WebPluginImpl::isPrintScalingDisabled() { +bool PepperWebPluginImpl::isPrintScalingDisabled() { return instance_->IsPrintScalingDisabled(); } -int WebPluginImpl::printBegin(const WebPrintParams& print_params) { +int PepperWebPluginImpl::printBegin(const WebPrintParams& print_params) { return instance_->PrintBegin(print_params); } -bool WebPluginImpl::printPage(int page_number, - WebKit::WebCanvas* canvas) { +bool PepperWebPluginImpl::printPage(int page_number, + WebKit::WebCanvas* canvas) { return instance_->PrintPage(page_number, canvas); } -void WebPluginImpl::printEnd() { +void PepperWebPluginImpl::printEnd() { return instance_->PrintEnd(); } -bool WebPluginImpl::canRotateView() { +bool PepperWebPluginImpl::canRotateView() { return instance_->CanRotateView(); } -void WebPluginImpl::rotateView(RotationType type) { +void PepperWebPluginImpl::rotateView(RotationType type) { instance_->RotateView(type); } -bool WebPluginImpl::isPlaceholder() { +bool PepperWebPluginImpl::isPlaceholder() { return false; } -} // namespace ppapi -} // namespace webkit +} // namespace content diff --git a/content/renderer/pepper/ppapi_webplugin_impl.h b/content/renderer/pepper/pepper_webplugin_impl.h index ed26b75..11bd750 100644 --- a/content/renderer/pepper/ppapi_webplugin_impl.h +++ b/content/renderer/pepper/pepper_webplugin_impl.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CONTENT_RENDERER_PEPPER_PPAPI_WEBPLUGIN_IMPL_H_ -#define CONTENT_RENDERER_PEPPER_PPAPI_WEBPLUGIN_IMPL_H_ +#ifndef CONTENT_RENDERER_PEPPER_PPEPPER_WEBPLUGIN_IMPL_H_ +#define CONTENT_RENDERER_PEPPER_PPEPPER_WEBPLUGIN_IMPL_H_ #include <string> #include <vector> @@ -26,22 +26,21 @@ struct WebPluginParams; struct WebPrintParams; } -namespace webkit { -namespace ppapi { +namespace content { +class PepperPluginInstanceImpl; class PluginDelegate; -class PluginInstanceImpl; class PluginModule; class PPB_URLLoader_Impl; -class WebPluginImpl : public WebKit::WebPlugin { +class PepperWebPluginImpl : public WebKit::WebPlugin { public: - WebPluginImpl(PluginModule* module, - const WebKit::WebPluginParams& params, - const base::WeakPtr<PluginDelegate>& plugin_delegate, - const base::WeakPtr<content::RenderView>& render_view); + PepperWebPluginImpl(PluginModule* module, + const WebKit::WebPluginParams& params, + const base::WeakPtr<PluginDelegate>& plugin_delegate, + const base::WeakPtr<RenderView>& render_view); - PluginInstanceImpl* instance() { return instance_.get(); } + PepperPluginInstanceImpl* instance() { return instance_.get(); } // WebKit::WebPlugin implementation. virtual WebKit::WebPluginContainer* container() const; @@ -92,24 +91,23 @@ class WebPluginImpl : public WebKit::WebPlugin { virtual bool isPlaceholder() OVERRIDE; private: - friend class base::DeleteHelper<WebPluginImpl>; + friend class base::DeleteHelper<PepperWebPluginImpl>; - virtual ~WebPluginImpl(); + virtual ~PepperWebPluginImpl(); struct InitData; scoped_ptr<InitData> init_data_; // Cleared upon successful initialization. // True if the instance represents the entire document in a frame instead of // being an embedded resource. bool full_frame_; - scoped_refptr<PluginInstanceImpl> instance_; + scoped_refptr<PepperPluginInstanceImpl> instance_; gfx::Rect plugin_rect_; PP_Var instance_object_; WebKit::WebPluginContainer* container_; - DISALLOW_COPY_AND_ASSIGN(WebPluginImpl); + DISALLOW_COPY_AND_ASSIGN(PepperWebPluginImpl); }; -} // namespace ppapi -} // namespace webkit +} // namespace content -#endif // CONTENT_RENDERER_PEPPER_PPAPI_WEBPLUGIN_IMPL_H_ +#endif // CONTENT_RENDERER_PEPPER_PPEPPER_WEBPLUGIN_IMPL_H_ diff --git a/content/renderer/pepper/plugin_delegate.h b/content/renderer/pepper/plugin_delegate.h index ad8ea45..45decd2 100644 --- a/content/renderer/pepper/plugin_delegate.h +++ b/content/renderer/pepper/plugin_delegate.h @@ -105,13 +105,11 @@ class P2PTransport; class NetworkListObserver; } // namespace webkit_glue -namespace webkit { - -namespace ppapi { +namespace content { class FileIO; class FullscreenContainer; -class PluginInstanceImpl; +class PepperPluginInstanceImpl; class PluginModule; class PPB_Broker_Impl; class PPB_Flash_Menu_Impl; @@ -183,7 +181,7 @@ class PluginDelegate { // to clear the existing device. Returns true on success. In this case, a // repaint of the page will also be scheduled. Failure means that the device // is already bound to a different instance, and nothing will happen. - virtual bool BindToInstance(PluginInstanceImpl* new_instance) = 0; + virtual bool BindToInstance(PepperPluginInstanceImpl* new_instance) = 0; // Paints the current backing store to the web page. virtual void Paint(WebKit::WebCanvas* canvas, @@ -334,27 +332,26 @@ class PluginDelegate { // When there are no more references, this renderer's dispatcher is // destroyed, allowing the broker to shutdown if appropriate. // Callers should not reference this object after calling Disconnect(). - virtual void Disconnect(webkit::ppapi::PPB_Broker_Impl* client) = 0; + virtual void Disconnect(PPB_Broker_Impl* client) = 0; protected: virtual ~Broker() {} }; // Notification that the given plugin is focused or unfocused. - virtual void PluginFocusChanged(webkit::ppapi::PluginInstanceImpl* instance, + virtual void PluginFocusChanged(PepperPluginInstanceImpl* instance, bool focused) = 0; // Notification that the text input status of the given plugin is changed. virtual void PluginTextInputTypeChanged( - webkit::ppapi::PluginInstanceImpl* instance) = 0; + PepperPluginInstanceImpl* instance) = 0; // Notification that the caret position in the given plugin is changed. virtual void PluginCaretPositionChanged( - webkit::ppapi::PluginInstanceImpl* instance) = 0; + PepperPluginInstanceImpl* instance) = 0; // Notification that the plugin requested to cancel the current composition. virtual void PluginRequestedCancelComposition( - webkit::ppapi::PluginInstanceImpl* instance) = 0; + PepperPluginInstanceImpl* instance) = 0; // Notification that the text selection in the given plugin is changed. - virtual void PluginSelectionChanged( - webkit::ppapi::PluginInstanceImpl* instance) = 0; + virtual void PluginSelectionChanged(PepperPluginInstanceImpl* instance) = 0; // Requests simulating IME events for testing purpose. virtual void SimulateImeSetComposition( const base::string16& text, @@ -366,19 +363,19 @@ class PluginDelegate { // Notification that the given plugin has crashed. When a plugin crashes, all // instances associated with that plugin will notify that they've crashed via // this function. - virtual void PluginCrashed(PluginInstanceImpl* instance) = 0; + virtual void PluginCrashed(PepperPluginInstanceImpl* instance) = 0; // Indicates that the given instance has been created. - virtual void InstanceCreated(PluginInstanceImpl* instance) = 0; + virtual void InstanceCreated(PepperPluginInstanceImpl* instance) = 0; // Indicates that the given instance is being destroyed. This is called from // the destructor, so it's important that the instance is not dereferenced // from this call. - virtual void InstanceDeleted(PluginInstanceImpl* instance) = 0; + virtual void InstanceDeleted(PepperPluginInstanceImpl* instance) = 0; // Creates the resource creation API for the given instance. virtual scoped_ptr< ::ppapi::thunk::ResourceCreationAPI> - CreateResourceCreationAPI(PluginInstanceImpl* instance) = 0; + CreateResourceCreationAPI(PepperPluginInstanceImpl* instance) = 0; // Returns a pointer (ownership not transferred) to the bitmap to paint the // sad plugin screen with. Returns NULL on failure. @@ -393,7 +390,7 @@ class PluginDelegate { virtual PlatformImage2D* CreateImage2D(int width, int height) = 0; // Returns the internal PlatformGraphics2D implementation. - virtual PlatformGraphics2D* GetGraphics2D(PluginInstanceImpl* instance, + virtual PlatformGraphics2D* GetGraphics2D(PepperPluginInstanceImpl* instance, PP_Resource graphics_2d) = 0; // The caller will own the pointer returned from this. @@ -441,7 +438,7 @@ class PluginDelegate { // BrokerConnected has been called. // The caller is responsible for calling Disconnect() on the returned pointer // to clean up the corresponding resources allocated during this call. - virtual Broker* ConnectToBroker(webkit::ppapi::PPB_Broker_Impl* client) = 0; + virtual Broker* ConnectToBroker(PPB_Broker_Impl* client) = 0; // Notifies that the number of find results has changed. virtual void NumberOfFindResultsChanged(int identifier, @@ -589,7 +586,7 @@ class PluginDelegate { // Create a fullscreen container for a plugin instance. This effectively // switches the plugin to fullscreen. virtual FullscreenContainer* CreateFullscreenContainer( - PluginInstanceImpl* instance) = 0; + PepperPluginInstanceImpl* instance) = 0; // Gets the size of the screen. The fullscreen window will be created at that // size. @@ -613,7 +610,7 @@ class PluginDelegate { // possible. If true is returned then the lock is pending. Success or // failure will be delivered asynchronously via // PluginInstance::OnLockMouseACK(). - virtual bool LockMouse(PluginInstanceImpl* instance) = 0; + virtual bool LockMouse(PepperPluginInstanceImpl* instance) = 0; // Unlocks the mouse if |instance| currently owns the mouse lock. Whenever an // plugin instance has lost the mouse lock, it will be notified by @@ -621,19 +618,19 @@ class PluginDelegate { // the only cause of losing mouse lock. For example, a user may press the Esc // key to quit the mouse lock mode, which also results in an OnMouseLockLost() // call to the current mouse lock owner. - virtual void UnlockMouse(PluginInstanceImpl* instance) = 0; + virtual void UnlockMouse(PepperPluginInstanceImpl* instance) = 0; // Returns true iff |instance| currently owns the mouse lock. - virtual bool IsMouseLocked(PluginInstanceImpl* instance) = 0; + virtual bool IsMouseLocked(PepperPluginInstanceImpl* instance) = 0; // Notifies that |instance| has changed the cursor. // This will update the cursor appearance if it is currently over the plugin // instance. - virtual void DidChangeCursor(PluginInstanceImpl* instance, + virtual void DidChangeCursor(PepperPluginInstanceImpl* instance, const WebKit::WebCursorInfo& cursor) = 0; // Notifies that |instance| has received a mouse event. - virtual void DidReceiveMouseEvent(PluginInstanceImpl* instance) = 0; + virtual void DidReceiveMouseEvent(PepperPluginInstanceImpl* instance) = 0; // Determines if the browser entered fullscreen mode. virtual bool IsInFullscreenMode() = 0; @@ -672,12 +669,12 @@ class PluginDelegate { // // The loader object should set itself on the PluginInstance as the document // loader using set_document_loader. - virtual void HandleDocumentLoad(PluginInstanceImpl* instance, + virtual void HandleDocumentLoad(PepperPluginInstanceImpl* instance, const WebKit::WebURLResponse& response) = 0; // Sets up the renderer host and out-of-process proxy for an external plugin // module. Returns the renderer host, or NULL if it couldn't be created. - virtual content::RendererPpapiHost* CreateExternalPluginModule( + virtual RendererPpapiHost* CreateExternalPluginModule( scoped_refptr<PluginModule> module, const base::FilePath& path, ::ppapi::PpapiPermissions permissions, @@ -686,7 +683,6 @@ class PluginDelegate { int plugin_child_id) = 0; }; -} // namespace ppapi -} // namespace webkit +} // namespace content #endif // CONTENT_RENDERER_PEPPER_PLUGIN_DELEGATE_H_ diff --git a/content/renderer/pepper/plugin_module.cc b/content/renderer/pepper/plugin_module.cc index 44253b2..d822202 100644 --- a/content/renderer/pepper/plugin_module.cc +++ b/content/renderer/pepper/plugin_module.cc @@ -15,9 +15,9 @@ #include "base/time/time.h" #include "content/renderer/pepper/common.h" #include "content/renderer/pepper/host_globals.h" +#include "content/renderer/pepper/pepper_plugin_instance_impl.h" #include "content/renderer/pepper/pepper_plugin_registry.h" #include "content/renderer/pepper/ppapi_interface_factory.h" -#include "content/renderer/pepper/ppapi_plugin_instance_impl.h" #include "content/renderer/pepper/ppb_gpu_blacklist_private_impl.h" #include "content/renderer/pepper/ppb_image_data_impl.h" #include "content/renderer/pepper/ppb_proxy_impl.h" @@ -141,8 +141,7 @@ using ppapi::thunk::EnterResource; using ppapi::thunk::PPB_Graphics2D_API; using ppapi::thunk::PPB_InputEvent_API; -namespace webkit { -namespace ppapi { +namespace content { namespace { @@ -155,7 +154,7 @@ namespace { // TODO(raymes): I'm not sure if it is completely necessary to leak the // HostGlobals. Figure out the shutdown sequence and find a way to do this // more elegantly. -webkit::ppapi::HostGlobals* host_globals = NULL; +HostGlobals* host_globals = NULL; // Maintains all currently loaded plugin libs for validating PP_Module // identifiers. @@ -240,7 +239,8 @@ PP_Bool IsOutOfProcess() { } void SimulateInputEvent(PP_Instance instance, PP_Resource input_event) { - PluginInstanceImpl* plugin_instance = host_globals->GetInstance(instance); + PepperPluginInstanceImpl* plugin_instance = + host_globals->GetInstance(instance); if (!plugin_instance) return; @@ -253,7 +253,8 @@ void SimulateInputEvent(PP_Instance instance, PP_Resource input_event) { } PP_Var GetDocumentURL(PP_Instance instance, PP_URLComponents_Dev* components) { - PluginInstanceImpl* plugin_instance = host_globals->GetInstance(instance); + PepperPluginInstanceImpl* plugin_instance = + host_globals->GetInstance(instance); if (!plugin_instance) return PP_MakeUndefined(); return plugin_instance->GetDocumentURL(instance, components); @@ -343,9 +344,9 @@ const void* GetInterface(const char* name) { // given structure. Returns true on success. bool LoadEntryPointsFromLibrary( const base::NativeLibrary& library, - content::PepperPluginInfo::EntryPoints* entry_points) { + PepperPluginInfo::EntryPoints* entry_points) { entry_points->get_interface = - reinterpret_cast<content::PepperPluginInfo::GetInterfaceFunc>( + reinterpret_cast<PepperPluginInfo::GetInterfaceFunc>( base::GetFunctionPointerFromNativeLibrary(library, "PPP_GetInterface")); if (!entry_points->get_interface) { @@ -354,7 +355,7 @@ bool LoadEntryPointsFromLibrary( } entry_points->initialize_module = - reinterpret_cast<content::PepperPluginInfo::PPP_InitializeModuleFunc>( + reinterpret_cast<PepperPluginInfo::PPP_InitializeModuleFunc>( base::GetFunctionPointerFromNativeLibrary(library, "PPP_InitializeModule")); if (!entry_points->initialize_module) { @@ -365,7 +366,7 @@ bool LoadEntryPointsFromLibrary( // It's okay for PPP_ShutdownModule to not be defined and shutdown_module to // be NULL. entry_points->shutdown_module = - reinterpret_cast<content::PepperPluginInfo::PPP_ShutdownModuleFunc>( + reinterpret_cast<PepperPluginInfo::PPP_ShutdownModuleFunc>( base::GetFunctionPointerFromNativeLibrary(library, "PPP_ShutdownModule")); @@ -426,7 +427,7 @@ PluginModule::~PluginModule() { if (!is_crashed_) { // When the plugin crashes, we immediately tell the lifetime delegate that // we're gone, so we don't want to tell it again. - content::PepperPluginRegistry::GetInstance()->PluginModuleDead(this); + PepperPluginRegistry::GetInstance()->PluginModuleDead(this); } // Don't add stuff here, the two notifications that the module object has @@ -444,7 +445,7 @@ PluginModule::EmbedderState* PluginModule::GetEmbedderState() { } bool PluginModule::InitAsInternalPlugin( - const content::PepperPluginInfo::EntryPoints& entry_points) { + const PepperPluginInfo::EntryPoints& entry_points) { if (InitializeModule(entry_points)) { entry_points_ = entry_points; return true; @@ -457,7 +458,7 @@ bool PluginModule::InitAsLibrary(const base::FilePath& path) { if (!library) return false; - content::PepperPluginInfo::EntryPoints entry_points; + PepperPluginInfo::EntryPoints entry_points; if (!LoadEntryPointsFromLibrary(library, &entry_points) || !InitializeModule(entry_points)) { @@ -487,7 +488,7 @@ scoped_refptr<PluginModule> } PP_ExternalPluginResult PluginModule::InitAsProxiedExternalPlugin( - PluginInstanceImpl* instance) { + PepperPluginInstanceImpl* instance) { DCHECK(out_of_process_proxy_.get()); // InitAsProxied (for the trusted/out-of-process case) initializes only the // module, and one or more instances are added later. In this case, the @@ -522,8 +523,7 @@ const PPB_Core* PluginModule::GetCore() { } // static -content::PepperPluginInfo::GetInterfaceFunc - PluginModule::GetLocalGetInterfaceFunc() { +PepperPluginInfo::GetInterfaceFunc PluginModule::GetLocalGetInterfaceFunc() { return &GetInterface; } @@ -532,12 +532,12 @@ bool PluginModule::SupportsInterface(const char* name) { return !!InternalGetInterface(name); } -PluginInstanceImpl* PluginModule::CreateInstance( +PepperPluginInstanceImpl* PluginModule::CreateInstance( PluginDelegate* delegate, - content::RenderView* render_view, + RenderView* render_view, WebKit::WebPluginContainer* container, const GURL& plugin_url) { - PluginInstanceImpl* instance = PluginInstanceImpl::Create( + PepperPluginInstanceImpl* instance = PepperPluginInstanceImpl::Create( delegate, render_view, this, container, plugin_url); if (!instance) { LOG(WARNING) << "Plugin doesn't support instance interface, failing."; @@ -548,7 +548,7 @@ PluginInstanceImpl* PluginModule::CreateInstance( return instance; } -PluginInstanceImpl* PluginModule::GetSomeInstance() const { +PepperPluginInstanceImpl* PluginModule::GetSomeInstance() const { // This will generally crash later if there is not actually any instance to // return, so we force a crash now to make bugs easier to track down. CHECK(!instances_.empty()); @@ -565,11 +565,11 @@ const void* PluginModule::GetPluginInterface(const char* name) const { return entry_points_.get_interface(name); } -void PluginModule::InstanceCreated(PluginInstanceImpl* instance) { +void PluginModule::InstanceCreated(PepperPluginInstanceImpl* instance) { instances_.insert(instance); } -void PluginModule::InstanceDeleted(PluginInstanceImpl* instance) { +void PluginModule::InstanceDeleted(PepperPluginInstanceImpl* instance) { if (out_of_process_proxy_) out_of_process_proxy_->RemoveInstance(instance->pp_instance()); instances_.erase(instance); @@ -588,7 +588,7 @@ void PluginModule::PluginCrashed() { i != instances_.end(); ++i) (*i)->InstanceCrashed(); - content::PepperPluginRegistry::GetInstance()->PluginModuleDead(this); + PepperPluginRegistry::GetInstance()->PluginModuleDead(this); } void PluginModule::SetReserveInstanceIDCallback( @@ -619,7 +619,7 @@ void PluginModule::ResetHostGlobalsForTest() { } bool PluginModule::InitializeModule( - const content::PepperPluginInfo::EntryPoints& entry_points) { + const PepperPluginInfo::EntryPoints& entry_points) { DCHECK(!out_of_process_proxy_.get()) << "Don't call for proxied modules."; DCHECK(entry_points.initialize_module != NULL); int retval = entry_points.initialize_module(pp_module(), &GetInterface); @@ -630,5 +630,4 @@ bool PluginModule::InitializeModule( return true; } -} // namespace ppapi -} // namespace webkit +} // namespace content diff --git a/content/renderer/pepper/plugin_module.h b/content/renderer/pepper/plugin_module.h index a8230f5..d259d84 100644 --- a/content/renderer/pepper/plugin_module.h +++ b/content/renderer/pepper/plugin_module.h @@ -44,16 +44,15 @@ namespace WebKit { class WebPluginContainer; } // namespace WebKit -namespace webkit { -namespace ppapi { - +namespace content { + +class PepperPluginInstanceImpl; class PluginDelegate; -class PluginInstanceImpl; // Represents one plugin library loaded into one renderer. This library may // have multiple instances. // -// Note: to get from a PP_Instance to a PluginInstance*, use the +// Note: to get from a PP_Instance to a PepperPluginInstance*, use the // ResourceTracker. class CONTENT_EXPORT PluginModule : public base::RefCounted<PluginModule>, @@ -67,7 +66,7 @@ class CONTENT_EXPORT PluginModule : virtual ~EmbedderState() {} }; - typedef std::set<PluginInstanceImpl*> PluginInstanceSet; + typedef std::set<PepperPluginInstanceImpl*> PluginInstanceSet; // You must call one of the Init functions after the constructor to create a // module of the type you desire. @@ -90,8 +89,7 @@ class CONTENT_EXPORT PluginModule : // Initializes this module as an internal plugin with the given entrypoints. // This is used for "plugins" compiled into Chrome. Returns true on success. // False means that the plugin can not be used. - bool InitAsInternalPlugin( - const content::PepperPluginInfo::EntryPoints& entry_points); + bool InitAsInternalPlugin(const PepperPluginInfo::EntryPoints& entry_points); // Initializes this module using the given library path as the plugin. // Returns true on success. False means that the plugin can not be used. @@ -111,7 +109,7 @@ class CONTENT_EXPORT PluginModule : // Returns a result code indicating whether the proxy started successfully or // there was an error. PP_ExternalPluginResult InitAsProxiedExternalPlugin( - PluginInstanceImpl* instance); + PepperPluginInstanceImpl* instance); bool IsProxied() const; @@ -130,7 +128,7 @@ class CONTENT_EXPORT PluginModule : // Returns a pointer to the local GetInterface function for retrieving // PPB interfaces. - static content::PepperPluginInfo::GetInterfaceFunc GetLocalGetInterfaceFunc(); + static PepperPluginInfo::GetInterfaceFunc GetLocalGetInterfaceFunc(); // Returns whether an interface is supported. This method can be called from // the browser process and used for interface matching before plugin @@ -147,16 +145,17 @@ class CONTENT_EXPORT PluginModule : const base::FilePath& path() const { return path_; } const ::ppapi::PpapiPermissions& permissions() const { return permissions_; } - PluginInstanceImpl* CreateInstance(PluginDelegate* delegate, - content::RenderView* render_view, - WebKit::WebPluginContainer* container, - const GURL& plugin_url); + PepperPluginInstanceImpl* CreateInstance( + PluginDelegate* delegate, + RenderView* render_view, + WebKit::WebPluginContainer* container, + const GURL& plugin_url); // Returns "some" plugin instance associated with this module. This is not // guaranteed to be any one in particular. This is normally used to execute // callbacks up to the browser layer that are not inherently per-instance, // but the delegate lives only on the plugin instance so we need one of them. - PluginInstanceImpl* GetSomeInstance() const; + PepperPluginInstanceImpl* GetSomeInstance() const; const PluginInstanceSet& GetAllInstances() const { return instances_; } @@ -167,8 +166,8 @@ class CONTENT_EXPORT PluginModule : // This module is associated with a set of instances. The PluginInstance // object declares its association with this module in its destructor and // releases us in its destructor. - void InstanceCreated(PluginInstanceImpl* instance); - void InstanceDeleted(PluginInstanceImpl* instance); + void InstanceCreated(PepperPluginInstanceImpl* instance); + void InstanceDeleted(PepperPluginInstanceImpl* instance); scoped_refptr< ::ppapi::CallbackTracker> GetCallbackTracker(); @@ -207,8 +206,7 @@ class CONTENT_EXPORT PluginModule : // Calls the InitializeModule entrypoint. The entrypoint must have been // set and the plugin must not be out of process (we don't maintain // entrypoints in that case). - bool InitializeModule( - const content::PepperPluginInfo::EntryPoints& entry_points); + bool InitializeModule(const PepperPluginInfo::EntryPoints& entry_points); // See EmbedderState above. scoped_ptr<EmbedderState> embedder_state_; @@ -244,7 +242,7 @@ class CONTENT_EXPORT PluginModule : // Contains pointers to the entry points of the actual plugin implementation. // These will be NULL for out-of-process plugins, which is indicated by the // presence of the out_of_process_proxy_ value. - content::PepperPluginInfo::EntryPoints entry_points_; + PepperPluginInfo::EntryPoints entry_points_; // The name and file location of the module. const std::string name_; @@ -261,7 +259,6 @@ class CONTENT_EXPORT PluginModule : DISALLOW_COPY_AND_ASSIGN(PluginModule); }; -} // namespace ppapi -} // namespace webkit +} // namespace content #endif // CONTENT_RENDERER_PEPPER_PLUGIN_MODULE_H_ diff --git a/content/renderer/pepper/plugin_object.cc b/content/renderer/pepper/plugin_object.cc index 9955d0cf8..62346f5 100644 --- a/content/renderer/pepper/plugin_object.cc +++ b/content/renderer/pepper/plugin_object.cc @@ -10,8 +10,8 @@ #include "base/strings/string_number_conversions.h" #include "base/strings/string_util.h" #include "content/renderer/pepper/npapi_glue.h" +#include "content/renderer/pepper/pepper_plugin_instance_impl.h" #include "content/renderer/pepper/plugin_module.h" -#include "content/renderer/pepper/ppapi_plugin_instance_impl.h" #include "ppapi/c/dev/ppb_var_deprecated.h" #include "ppapi/c/dev/ppp_class_deprecated.h" #include "ppapi/c/pp_resource.h" @@ -29,8 +29,7 @@ using ppapi::StringVar; using ppapi::Var; using WebKit::WebBindings; -namespace webkit { -namespace ppapi { +namespace content { namespace { @@ -83,8 +82,7 @@ bool WrapperClass_Invoke(NPObject* object, NPIdentifier method_name, // object to ensure that it is not destroyed courtsey an incoming // ExecuteScript call which destroys the plugin module and in turn the // dispatcher. - scoped_refptr<webkit::ppapi::PluginModule> ref( - accessor.object()->instance()->module()); + scoped_refptr<PluginModule> ref(accessor.object()->instance()->module()); return result_converter.SetResult(accessor.object()->ppp_class()->Call( accessor.object()->ppp_class_data(), accessor.identifier(), @@ -104,8 +102,7 @@ bool WrapperClass_InvokeDefault(NPObject* np_object, const NPVariant* argv, // object to ensure that it is not destroyed courtsey an incoming // ExecuteScript call which destroys the plugin module and in turn the // dispatcher. - scoped_refptr<webkit::ppapi::PluginModule> ref( - obj->instance()->module()); + scoped_refptr<PluginModule> ref(obj->instance()->module()); result_converter.SetResult(obj->ppp_class()->Call( obj->ppp_class_data(), PP_MakeUndefined(), argc, args.array(), @@ -265,7 +262,7 @@ struct PluginObject::NPObjectWrapper : public NPObject { PluginObject* obj; }; -PluginObject::PluginObject(PluginInstanceImpl* instance, +PluginObject::PluginObject(PepperPluginInstanceImpl* instance, NPObjectWrapper* object_wrapper, const PPP_Class_Deprecated* ppp_class, void* ppp_class_data) @@ -290,7 +287,7 @@ PluginObject::~PluginObject() { instance_->RemovePluginObject(this); } -PP_Var PluginObject::Create(PluginInstanceImpl* instance, +PP_Var PluginObject::Create(PepperPluginInstanceImpl* instance, const PPP_Class_Deprecated* ppp_class, void* ppp_class_data) { // This will internally end up calling our AllocateObjectWrapper via the @@ -355,6 +352,5 @@ NPObject* PluginObject::AllocateObjectWrapper() { return wrapper; } -} // namespace ppapi -} // namespace webkit +} // namespace content diff --git a/content/renderer/pepper/plugin_object.h b/content/renderer/pepper/plugin_object.h index c222e50..362979a 100644 --- a/content/renderer/pepper/plugin_object.h +++ b/content/renderer/pepper/plugin_object.h @@ -14,10 +14,9 @@ struct PPP_Class_Deprecated; typedef struct NPObject NPObject; typedef struct _NPVariant NPVariant; -namespace webkit { -namespace ppapi { +namespace content { -class PluginInstanceImpl; +class PepperPluginInstanceImpl; // A PluginObject is a JS-accessible object implemented by the plugin. // @@ -29,11 +28,11 @@ class PluginObject { // Allocates a new PluginObject and returns it as a PP_Var with a // refcount of 1. - static PP_Var Create(PluginInstanceImpl* instance, + static PP_Var Create(PepperPluginInstanceImpl* instance, const PPP_Class_Deprecated* ppp_class, void* ppp_class_data); - PluginInstanceImpl* instance() const { return instance_; } + PepperPluginInstanceImpl* instance() const { return instance_; } const PPP_Class_Deprecated* ppp_class() { return ppp_class_; } void* ppp_class_data() { return ppp_class_data_; }; @@ -68,12 +67,12 @@ class PluginObject { // // The NPObjectWrapper (an NPObject) should already have the reference // incremented on it, and this class will take ownership of that reference. - PluginObject(PluginInstanceImpl* instance, + PluginObject(PepperPluginInstanceImpl* instance, NPObjectWrapper* object_wrapper, const PPP_Class_Deprecated* ppp_class, void* ppp_class_data); - PluginInstanceImpl* instance_; + PepperPluginInstanceImpl* instance_; // Holds a pointer to the NPObject wrapper backing the var. This class // derives from NPObject and we hold a reference to it, so it must be @@ -89,7 +88,6 @@ class PluginObject { DISALLOW_COPY_AND_ASSIGN(PluginObject); }; -} // namespace ppapi -} // namespace webkit +} // namespace content #endif // CONTENT_RENDERER_PEPPER_PLUGIN_OBJECT_H_ diff --git a/content/renderer/pepper/ppapi_interface_factory.cc b/content/renderer/pepper/ppapi_interface_factory.cc index acb6858..b09efae 100644 --- a/content/renderer/pepper/ppapi_interface_factory.cc +++ b/content/renderer/pepper/ppapi_interface_factory.cc @@ -8,8 +8,7 @@ #include "base/logging.h" -namespace webkit { -namespace ppapi { +namespace content { base::LazyInstance<PpapiInterfaceFactoryManager> g_ppapi_interface_factory_manager = LAZY_INSTANCE_INITIALIZER; @@ -57,6 +56,5 @@ PpapiInterfaceFactoryManager* PpapiInterfaceFactoryManager::GetInstance() { return &g_ppapi_interface_factory_manager.Get(); } -} // namespace ppapi -} // namespace webkit +} // namespace content diff --git a/content/renderer/pepper/ppapi_interface_factory.h b/content/renderer/pepper/ppapi_interface_factory.h index 6654f61..72c5efb 100644 --- a/content/renderer/pepper/ppapi_interface_factory.h +++ b/content/renderer/pepper/ppapi_interface_factory.h @@ -12,8 +12,7 @@ #include "base/lazy_instance.h" #include "content/common/content_export.h" -namespace webkit { -namespace ppapi { +namespace content { // This class provides functionality to manage custom PPAPI interface // factories. @@ -49,8 +48,7 @@ class PpapiInterfaceFactoryManager { DISALLOW_COPY_AND_ASSIGN(PpapiInterfaceFactoryManager); }; -} // namespace ppapi -} // namespace webkit +} // namespace content #endif // CONTENT_RENDERER_PEPPER_PLUGIN_INTERFACE_FACTORY_H_ diff --git a/content/renderer/pepper/ppapi_unittest.cc b/content/renderer/pepper/ppapi_unittest.cc index e6edf94..8c8562a 100644 --- a/content/renderer/pepper/ppapi_unittest.cc +++ b/content/renderer/pepper/ppapi_unittest.cc @@ -8,16 +8,15 @@ #include "content/renderer/pepper/gfx_conversion.h" #include "content/renderer/pepper/host_globals.h" #include "content/renderer/pepper/mock_plugin_delegate.h" +#include "content/renderer/pepper/pepper_plugin_instance_impl.h" #include "content/renderer/pepper/plugin_module.h" #include "content/renderer/pepper/ppapi_interface_factory.h" -#include "content/renderer/pepper/ppapi_plugin_instance_impl.h" #include "ppapi/c/pp_var.h" #include "ppapi/c/ppp_instance.h" #include "ppapi/shared_impl/ppapi_globals.h" #include "ppapi/shared_impl/ppapi_permissions.h" -namespace webkit { -namespace ppapi { +namespace content { namespace { @@ -84,13 +83,13 @@ void PpapiUnittest::SetUp() { module_ = new PluginModule("Mock plugin", base::FilePath(), ::ppapi::PpapiPermissions()); ::ppapi::PpapiGlobals::Get()->ResetMainThreadMessageLoopForTesting(); - content::PepperPluginInfo::EntryPoints entry_points; + PepperPluginInfo::EntryPoints entry_points; entry_points.get_interface = &MockGetInterface; entry_points.initialize_module = &MockInitializeModule; ASSERT_TRUE(module_->InitAsInternalPlugin(entry_points)); // Initialize the mock instance. - instance_ = PluginInstanceImpl::Create( + instance_ = PepperPluginInstanceImpl::Create( delegate_.get(), NULL, module(), NULL, GURL()); } @@ -165,5 +164,4 @@ TEST_F(PpapiCustomInterfaceFactoryTest, BasicFactoryTest) { EXPECT_FALSE(result()); } -} // namespace ppapi -} // namespace webkit +} // namespace content diff --git a/content/renderer/pepper/ppapi_unittest.h b/content/renderer/pepper/ppapi_unittest.h index e7fd8f2..72c27f7 100644 --- a/content/renderer/pepper/ppapi_unittest.h +++ b/content/renderer/pepper/ppapi_unittest.h @@ -15,11 +15,10 @@ namespace base { class MessageLoop; } -namespace webkit { -namespace ppapi { +namespace content { class MockPluginDelegate; -class PluginInstanceImpl; +class PepperPluginInstanceImpl; class PluginModule; class PpapiUnittest : public testing::Test { @@ -32,7 +31,7 @@ class PpapiUnittest : public testing::Test { MockPluginDelegate* delegate() { return delegate_.get(); } PluginModule* module() const { return module_.get(); } - PluginInstanceImpl* instance() const { return instance_.get(); } + PepperPluginInstanceImpl* instance() const { return instance_.get(); } // Provides access to the interfaces implemented by the test. The default one // implements PPP_INSTANCE. @@ -52,14 +51,13 @@ class PpapiUnittest : public testing::Test { // Note: module must be declared first since we want it to get destroyed last. scoped_refptr<PluginModule> module_; - scoped_refptr<PluginInstanceImpl> instance_; + scoped_refptr<PepperPluginInstanceImpl> instance_; scoped_ptr<base::MessageLoop> message_loop_; DISALLOW_COPY_AND_ASSIGN(PpapiUnittest); }; -} // namespace ppapi -} // namespace webkit +} // namespace content #endif // CONTENT_RENDERER_PEPPER_PPAPI_UNITTEST_H_ diff --git a/content/renderer/pepper/ppb_audio_impl.cc b/content/renderer/pepper/ppb_audio_impl.cc index 5263826..d971888 100644 --- a/content/renderer/pepper/ppb_audio_impl.cc +++ b/content/renderer/pepper/ppb_audio_impl.cc @@ -22,8 +22,7 @@ using ppapi::thunk::PPB_Audio_API; using ppapi::thunk::PPB_AudioConfig_API; using ppapi::TrackedCallback; -namespace webkit { -namespace ppapi { +namespace content { // PPB_Audio_Impl -------------------------------------------------------------- @@ -157,5 +156,4 @@ void PPB_Audio_Impl::OnSetStreamInfo( socket_handle, sample_frame_count_); } -} // namespace ppapi -} // namespace webkit +} // namespace content diff --git a/content/renderer/pepper/ppb_audio_impl.h b/content/renderer/pepper/ppb_audio_impl.h index 49146cb..4c30974 100644 --- a/content/renderer/pepper/ppb_audio_impl.h +++ b/content/renderer/pepper/ppb_audio_impl.h @@ -19,8 +19,7 @@ #include "ppapi/shared_impl/resource.h" #include "ppapi/shared_impl/scoped_pp_resource.h" -namespace webkit { -namespace ppapi { +namespace content { // Some of the backend functionality of this class is implemented by the // PPB_Audio_Shared so it can be shared with the proxy. @@ -80,7 +79,6 @@ class PPB_Audio_Impl : public ::ppapi::Resource, DISALLOW_COPY_AND_ASSIGN(PPB_Audio_Impl); }; -} // namespace ppapi -} // namespace webkit +} // namespace content #endif // CONTENT_RENDERER_PEPPER_PPB_AUDIO_IMPL_H_ diff --git a/content/renderer/pepper/ppb_broker_impl.cc b/content/renderer/pepper/ppb_broker_impl.cc index 7401b28..4ba2f88 100644 --- a/content/renderer/pepper/ppb_broker_impl.cc +++ b/content/renderer/pepper/ppb_broker_impl.cc @@ -6,8 +6,8 @@ #include "base/logging.h" #include "content/renderer/pepper/common.h" +#include "content/renderer/pepper/pepper_plugin_instance_impl.h" #include "content/renderer/pepper/plugin_module.h" -#include "content/renderer/pepper/ppapi_plugin_instance_impl.h" #include "content/renderer/pepper/resource_helper.h" #include "ppapi/shared_impl/platform_file.h" #include "third_party/WebKit/public/web/WebDocument.h" @@ -18,8 +18,7 @@ using ppapi::PlatformFileToInt; using ppapi::thunk::PPB_Broker_API; using ppapi::TrackedCallback; -namespace webkit { -namespace ppapi { +namespace content { // PPB_Broker_Impl ------------------------------------------------------ @@ -53,7 +52,8 @@ int32_t PPB_Broker_Impl::Connect( return PP_ERROR_FAILED; } - PluginInstanceImpl* plugin_instance = ResourceHelper::GetPluginInstance(this); + PepperPluginInstanceImpl* plugin_instance = + ResourceHelper::GetPluginInstance(this); if (!plugin_instance) return PP_ERROR_FAILED; @@ -80,7 +80,8 @@ int32_t PPB_Broker_Impl::GetHandle(int32_t* handle) { } GURL PPB_Broker_Impl::GetDocumentUrl() { - PluginInstanceImpl* plugin_instance = ResourceHelper::GetPluginInstance(this); + PepperPluginInstanceImpl* plugin_instance = + ResourceHelper::GetPluginInstance(this); return plugin_instance->container()->element().document().url(); } @@ -99,5 +100,4 @@ void PPB_Broker_Impl::BrokerConnected(int32_t handle, int32_t result) { connect_callback_->Run(result); } -} // namespace ppapi -} // namespace webkit +} // namespace content diff --git a/content/renderer/pepper/ppb_broker_impl.h b/content/renderer/pepper/ppb_broker_impl.h index 0c7a76f..1257d75 100644 --- a/content/renderer/pepper/ppb_broker_impl.h +++ b/content/renderer/pepper/ppb_broker_impl.h @@ -15,8 +15,7 @@ #include "ppapi/shared_impl/tracked_callback.h" #include "ppapi/thunk/ppb_broker_api.h" -namespace webkit { -namespace ppapi { +namespace content { class PPB_Broker_Impl : public ::ppapi::Resource, public ::ppapi::thunk::PPB_Broker_API, @@ -54,7 +53,6 @@ class PPB_Broker_Impl : public ::ppapi::Resource, DISALLOW_COPY_AND_ASSIGN(PPB_Broker_Impl); }; -} // namespace ppapi -} // namespace webkit +} // namespace content #endif // CONTENT_RENDERER_PEPPER_PPB_BROKER_IMPL_H_ diff --git a/content/renderer/pepper/ppb_buffer_impl.cc b/content/renderer/pepper/ppb_buffer_impl.cc index 24599e7..808ebfb 100644 --- a/content/renderer/pepper/ppb_buffer_impl.cc +++ b/content/renderer/pepper/ppb_buffer_impl.cc @@ -17,8 +17,7 @@ using ::ppapi::thunk::PPB_Buffer_API; -namespace webkit { -namespace ppapi { +namespace content { PPB_Buffer_Impl::PPB_Buffer_Impl(PP_Instance instance) : Resource(::ppapi::OBJECT_IS_IMPL, instance), @@ -109,5 +108,4 @@ BufferAutoMapper::~BufferAutoMapper() { api_->Unmap(); } -} // namespace ppapi -} // namespace webkit +} // namespace content diff --git a/content/renderer/pepper/ppb_buffer_impl.h b/content/renderer/pepper/ppb_buffer_impl.h index 5da2c72..ba042d6 100644 --- a/content/renderer/pepper/ppb_buffer_impl.h +++ b/content/renderer/pepper/ppb_buffer_impl.h @@ -12,8 +12,7 @@ #include "ppapi/shared_impl/resource.h" #include "ppapi/thunk/ppb_buffer_api.h" -namespace webkit { -namespace ppapi { +namespace content { class PPB_Buffer_Impl : public ::ppapi::Resource, public ::ppapi::thunk::PPB_Buffer_API { @@ -74,7 +73,6 @@ class BufferAutoMapper { DISALLOW_COPY_AND_ASSIGN(BufferAutoMapper); }; -} // namespace ppapi -} // namespace webkit +} // namespace content #endif // CONTENT_RENDERER_PEPPER_PPB_BUFFER_IMPL_H_ diff --git a/content/renderer/pepper/ppb_file_ref_impl.cc b/content/renderer/pepper/ppb_file_ref_impl.cc index 9a97bed..e0e2edc 100644 --- a/content/renderer/pepper/ppb_file_ref_impl.cc +++ b/content/renderer/pepper/ppb_file_ref_impl.cc @@ -9,9 +9,9 @@ #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" #include "content/renderer/pepper/common.h" +#include "content/renderer/pepper/pepper_plugin_instance_impl.h" #include "content/renderer/pepper/plugin_delegate.h" #include "content/renderer/pepper/plugin_module.h" -#include "content/renderer/pepper/ppapi_plugin_instance_impl.h" #include "content/renderer/pepper/resource_helper.h" #include "net/base/escape.h" #include "ppapi/c/pp_errors.h" @@ -33,8 +33,7 @@ using ppapi::thunk::EnterResourceNoLock; using ppapi::thunk::PPB_FileRef_API; using ppapi::thunk::PPB_FileSystem_API; -namespace webkit { -namespace ppapi { +namespace content { namespace { @@ -232,7 +231,7 @@ PPB_FileRef_Impl::~PPB_FileRef_Impl() { PPB_FileRef_Impl* PPB_FileRef_Impl::CreateInternal(PP_Instance instance, PP_Resource pp_file_system, const std::string& path) { - PluginInstanceImpl* plugin_instance = + PepperPluginInstanceImpl* plugin_instance = ResourceHelper::PPInstanceToPluginInstance(instance); if (!plugin_instance || !plugin_instance->delegate()) return 0; @@ -309,7 +308,8 @@ int32_t PPB_FileRef_Impl::MakeDirectory( if (!IsValidNonExternalFileSystem()) return PP_ERROR_NOACCESS; - PluginInstanceImpl* plugin_instance = ResourceHelper::GetPluginInstance(this); + PepperPluginInstanceImpl* plugin_instance = + ResourceHelper::GetPluginInstance(this); if (!plugin_instance) return PP_ERROR_FAILED; plugin_instance->delegate()->MakeDirectory( @@ -324,7 +324,8 @@ int32_t PPB_FileRef_Impl::Touch(PP_Time last_access_time, if (!IsValidNonExternalFileSystem()) return PP_ERROR_NOACCESS; - PluginInstanceImpl* plugin_instance = ResourceHelper::GetPluginInstance(this); + PepperPluginInstanceImpl* plugin_instance = + ResourceHelper::GetPluginInstance(this); if (!plugin_instance) return PP_ERROR_FAILED; plugin_instance->delegate()->Touch( @@ -339,7 +340,8 @@ int32_t PPB_FileRef_Impl::Delete(scoped_refptr<TrackedCallback> callback) { if (!IsValidNonExternalFileSystem()) return PP_ERROR_NOACCESS; - PluginInstanceImpl* plugin_instance = ResourceHelper::GetPluginInstance(this); + PepperPluginInstanceImpl* plugin_instance = + ResourceHelper::GetPluginInstance(this); if (!plugin_instance) return PP_ERROR_FAILED; plugin_instance->delegate()->Delete( @@ -362,7 +364,8 @@ int32_t PPB_FileRef_Impl::Rename(PP_Resource new_pp_file_ref, // TODO(viettrungluu): Also cancel when the new file ref is destroyed? // http://crbug.com/67624 - PluginInstanceImpl* plugin_instance = ResourceHelper::GetPluginInstance(this); + PepperPluginInstanceImpl* plugin_instance = + ResourceHelper::GetPluginInstance(this); if (!plugin_instance) return PP_ERROR_FAILED; plugin_instance->delegate()->Rename( @@ -405,7 +408,8 @@ GURL PPB_FileRef_Impl::GetFileSystemURL() const { // We need to trim off the '/' before calling Resolve, as FileSystem URLs // start with a storage type identifier that looks like a path segment. - PluginInstanceImpl* plugin_instance = ResourceHelper::GetPluginInstance(this); + PepperPluginInstanceImpl* plugin_instance = + ResourceHelper::GetPluginInstance(this); PluginDelegate* delegate = plugin_instance ? plugin_instance->delegate() : NULL; if (!delegate) @@ -415,7 +419,8 @@ GURL PPB_FileRef_Impl::GetFileSystemURL() const { } bool PPB_FileRef_Impl::IsValidNonExternalFileSystem() const { - PluginInstanceImpl* plugin_instance = ResourceHelper::GetPluginInstance(this); + PepperPluginInstanceImpl* plugin_instance = + ResourceHelper::GetPluginInstance(this); PluginDelegate* delegate = plugin_instance ? plugin_instance->delegate() : NULL; return delegate && @@ -425,7 +430,8 @@ bool PPB_FileRef_Impl::IsValidNonExternalFileSystem() const { } bool PPB_FileRef_Impl::HasValidFileSystem() const { - PluginInstanceImpl* plugin_instance = ResourceHelper::GetPluginInstance(this); + PepperPluginInstanceImpl* plugin_instance = + ResourceHelper::GetPluginInstance(this); PluginDelegate* delegate = plugin_instance ? plugin_instance->delegate() : NULL; return delegate && delegate->IsFileSystemOpened(pp_instance(), file_system_); @@ -440,7 +446,7 @@ int32_t PPB_FileRef_Impl::Query(PP_FileInfo* info, int32_t PPB_FileRef_Impl::QueryInHost( linked_ptr<PP_FileInfo> info, scoped_refptr<TrackedCallback> callback) { - scoped_refptr<PluginInstanceImpl> plugin_instance = + scoped_refptr<PepperPluginInstanceImpl> plugin_instance = ResourceHelper::GetPluginInstance(this); if (!plugin_instance.get()) return PP_ERROR_FAILED; @@ -462,7 +468,7 @@ int32_t PPB_FileRef_Impl::QueryInHost( if (!HasValidFileSystem()) return PP_ERROR_NOACCESS; - PluginInstanceImpl* plugin_instance = + PepperPluginInstanceImpl* plugin_instance = ResourceHelper::GetPluginInstance(this); PluginDelegate* delegate = plugin_instance ? plugin_instance->delegate() : NULL; @@ -493,7 +499,8 @@ int32_t PPB_FileRef_Impl::ReadDirectoryEntriesInHost( if (!IsValidNonExternalFileSystem()) return PP_ERROR_NOACCESS; - PluginInstanceImpl* plugin_instance = ResourceHelper::GetPluginInstance(this); + PepperPluginInstanceImpl* plugin_instance = + ResourceHelper::GetPluginInstance(this); if (!plugin_instance) return PP_ERROR_FAILED; @@ -507,5 +514,4 @@ int32_t PPB_FileRef_Impl::ReadDirectoryEntriesInHost( return PP_OK_COMPLETIONPENDING; } -} // namespace ppapi -} // namespace webkit +} // namespace content diff --git a/content/renderer/pepper/ppb_file_ref_impl.h b/content/renderer/pepper/ppb_file_ref_impl.h index 30612cd..75dda3e 100644 --- a/content/renderer/pepper/ppb_file_ref_impl.h +++ b/content/renderer/pepper/ppb_file_ref_impl.h @@ -17,8 +17,7 @@ #include "ppapi/shared_impl/var.h" #include "url/gurl.h" -namespace webkit { -namespace ppapi { +namespace content { using ::ppapi::StringVar; @@ -120,7 +119,6 @@ class PPB_FileRef_Impl : public ::ppapi::PPB_FileRef_Shared { DISALLOW_COPY_AND_ASSIGN(PPB_FileRef_Impl); }; -} // namespace ppapi -} // namespace webkit +} // namespace content #endif // CONTENT_RENDERER_PEPPER_PPB_FILE_REF_IMPL_H_ diff --git a/content/renderer/pepper/ppb_flash_message_loop_impl.cc b/content/renderer/pepper/ppb_flash_message_loop_impl.cc index 105c5a0..c13ecb8 100644 --- a/content/renderer/pepper/ppb_flash_message_loop_impl.cc +++ b/content/renderer/pepper/ppb_flash_message_loop_impl.cc @@ -10,8 +10,7 @@ using ppapi::thunk::PPB_Flash_MessageLoop_API; -namespace webkit { -namespace ppapi { +namespace content { class PPB_Flash_MessageLoop_Impl::State : public base::RefCounted<PPB_Flash_MessageLoop_Impl::State> { @@ -112,5 +111,4 @@ void PPB_Flash_MessageLoop_Impl::InternalQuit(int32_t result) { state_->run_callback().Run(result); } -} // namespace ppapi -} // namespace webkit +} // namespace content diff --git a/content/renderer/pepper/ppb_flash_message_loop_impl.h b/content/renderer/pepper/ppb_flash_message_loop_impl.h index ef6903c..4bd303d 100644 --- a/content/renderer/pepper/ppb_flash_message_loop_impl.h +++ b/content/renderer/pepper/ppb_flash_message_loop_impl.h @@ -11,8 +11,7 @@ #include "ppapi/shared_impl/resource.h" #include "ppapi/thunk/ppb_flash_message_loop_api.h" -namespace webkit { -namespace ppapi { +namespace content { class PPB_Flash_MessageLoop_Impl : public ::ppapi::Resource, @@ -48,7 +47,6 @@ class PPB_Flash_MessageLoop_Impl DISALLOW_COPY_AND_ASSIGN(PPB_Flash_MessageLoop_Impl); }; -} // namespace ppapi -} // namespace webkit +} // namespace content #endif // CONTENT_RENDERER_PEPPER_PPB_FLASH_MESSAGE_LOOP_IMPL_H_ diff --git a/content/renderer/pepper/ppb_gpu_blacklist_private_impl.cc b/content/renderer/pepper/ppb_gpu_blacklist_private_impl.cc index 81c4292..7649cae 100644 --- a/content/renderer/pepper/ppb_gpu_blacklist_private_impl.cc +++ b/content/renderer/pepper/ppb_gpu_blacklist_private_impl.cc @@ -11,8 +11,7 @@ // todo(nfullagar): Remove this private interface when the SRPC proxy is // permanently disabled. -namespace webkit { -namespace ppapi { +namespace content { namespace { @@ -35,6 +34,5 @@ const PPB_GpuBlacklist_Private* PPB_GpuBlacklist_Private_Impl::GetInterface() { return &ppb_gpu_blacklist; } -} // namespace ppapi -} // namespace webkit +} // namespace content diff --git a/content/renderer/pepper/ppb_gpu_blacklist_private_impl.h b/content/renderer/pepper/ppb_gpu_blacklist_private_impl.h index 189afe31..7ff2e90 100644 --- a/content/renderer/pepper/ppb_gpu_blacklist_private_impl.h +++ b/content/renderer/pepper/ppb_gpu_blacklist_private_impl.h @@ -7,16 +7,14 @@ #include "ppapi/c/private/ppb_gpu_blacklist_private.h" -namespace webkit { -namespace ppapi { +namespace content { class PPB_GpuBlacklist_Private_Impl { public: static const PPB_GpuBlacklist_Private* GetInterface(); }; -} // namespace ppapi -} // namespace webkit +} // namespace content #endif // CONTENT_RENDERER_PEPPER_PPB_GPU_BLACKLIST_PRIVATE_IMPL_H_ diff --git a/content/renderer/pepper/ppb_graphics_3d_impl.cc b/content/renderer/pepper/ppb_graphics_3d_impl.cc index 26a7789..596febc 100644 --- a/content/renderer/pepper/ppb_graphics_3d_impl.cc +++ b/content/renderer/pepper/ppb_graphics_3d_impl.cc @@ -8,8 +8,8 @@ #include "base/command_line.h" #include "base/message_loop/message_loop.h" #include "base/strings/utf_string_conversions.h" +#include "content/renderer/pepper/pepper_plugin_instance_impl.h" #include "content/renderer/pepper/plugin_module.h" -#include "content/renderer/pepper/ppapi_plugin_instance_impl.h" #include "content/renderer/pepper/resource_helper.h" #include "gpu/command_buffer/client/gles2_implementation.h" #include "ppapi/c/ppp_graphics_3d.h" @@ -29,8 +29,7 @@ using WebKit::WebFrame; using WebKit::WebPluginContainer; using WebKit::WebString; -namespace webkit { -namespace ppapi { +namespace content { namespace { const int32 kCommandBufferSize = 1024 * 1024; @@ -236,7 +235,8 @@ bool PPB_Graphics3D_Impl::Init(PPB_Graphics3D_API* share_context, bool PPB_Graphics3D_Impl::InitRaw(PPB_Graphics3D_API* share_context, const int32_t* attrib_list) { - PluginInstanceImpl* plugin_instance = ResourceHelper::GetPluginInstance(this); + PepperPluginInstanceImpl* plugin_instance = + ResourceHelper::GetPluginInstance(this); if (!plugin_instance) return false; @@ -307,7 +307,7 @@ void PPB_Graphics3D_Impl::SendContextLost() { // By the time we run this, the instance may have been deleted, or in the // process of being deleted. Even in the latter case, we don't want to send a // callback after DidDestroy. - PluginInstanceImpl* instance = ResourceHelper::GetPluginInstance(this); + PepperPluginInstanceImpl* instance = ResourceHelper::GetPluginInstance(this); if (!instance || !instance->container()) return; @@ -324,5 +324,4 @@ void PPB_Graphics3D_Impl::SendContextLost() { ppp_graphics_3d->Graphics3DContextLost(this_pp_instance); } -} // namespace ppapi -} // namespace webkit +} // namespace content diff --git a/content/renderer/pepper/ppb_graphics_3d_impl.h b/content/renderer/pepper/ppb_graphics_3d_impl.h index e84a766..4d29bdc 100644 --- a/content/renderer/pepper/ppb_graphics_3d_impl.h +++ b/content/renderer/pepper/ppb_graphics_3d_impl.h @@ -10,8 +10,7 @@ #include "ppapi/shared_impl/ppb_graphics_3d_shared.h" #include "ppapi/shared_impl/resource.h" -namespace webkit { -namespace ppapi { +namespace content { class PPB_Graphics3D_Impl : public ::ppapi::PPB_Graphics3D_Shared { public: @@ -88,7 +87,6 @@ class PPB_Graphics3D_Impl : public ::ppapi::PPB_Graphics3D_Shared { DISALLOW_COPY_AND_ASSIGN(PPB_Graphics3D_Impl); }; -} // namespace ppapi -} // namespace webkit +} // namespace content #endif // CONTENT_RENDERER_PEPPER_PPB_GRAPHICS_3D_IMPL_H_ diff --git a/content/renderer/pepper/ppb_image_data_impl.cc b/content/renderer/pepper/ppb_image_data_impl.cc index e17b348..a7e9895 100644 --- a/content/renderer/pepper/ppb_image_data_impl.cc +++ b/content/renderer/pepper/ppb_image_data_impl.cc @@ -20,8 +20,7 @@ using ::ppapi::thunk::PPB_ImageData_API; -namespace webkit { -namespace ppapi { +namespace content { PPB_ImageData_Impl::PPB_ImageData_Impl(PP_Instance instance, PPB_ImageData_Shared::ImageDataType type) @@ -274,5 +273,4 @@ const SkBitmap* ImageDataSimpleBackend::GetMappedBitmap() const { return &skia_bitmap_; } -} // namespace ppapi -} // namespace webkit +} // namespace content diff --git a/content/renderer/pepper/ppb_image_data_impl.h b/content/renderer/pepper/ppb_image_data_impl.h index 58cba82..95aecea 100644 --- a/content/renderer/pepper/ppb_image_data_impl.h +++ b/content/renderer/pepper/ppb_image_data_impl.h @@ -18,8 +18,7 @@ class SkBitmap; class SkCanvas; -namespace webkit { -namespace ppapi { +namespace content { class CONTENT_EXPORT PPB_ImageData_Impl : public ::ppapi::Resource, @@ -191,7 +190,6 @@ class ImageDataAutoMapper { DISALLOW_COPY_AND_ASSIGN(ImageDataAutoMapper); }; -} // namespace ppapi -} // namespace webkit +} // namespace content #endif // CONTENT_RENDERER_PEPPER_PPB_IMAGE_DATA_IMPL_H_ diff --git a/content/renderer/pepper/ppb_network_monitor_private_impl.cc b/content/renderer/pepper/ppb_network_monitor_private_impl.cc index 75a8935..eb9d99e 100644 --- a/content/renderer/pepper/ppb_network_monitor_private_impl.cc +++ b/content/renderer/pepper/ppb_network_monitor_private_impl.cc @@ -11,8 +11,7 @@ #include "net/base/ip_endpoint.h" #include "net/base/net_util.h" -namespace webkit { -namespace ppapi { +namespace content { PPB_NetworkMonitor_Private_Impl::PPB_NetworkMonitor_Private_Impl( PP_Instance instance, @@ -85,5 +84,4 @@ void PPB_NetworkMonitor_Private_Impl::OnNetworkListChanged( callback_(user_data_, list_resource); } -} // namespace ppapi -} // namespace webkit +} // namespace content diff --git a/content/renderer/pepper/ppb_network_monitor_private_impl.h b/content/renderer/pepper/ppb_network_monitor_private_impl.h index c603eb1..3a6b481 100644 --- a/content/renderer/pepper/ppb_network_monitor_private_impl.h +++ b/content/renderer/pepper/ppb_network_monitor_private_impl.h @@ -13,8 +13,7 @@ #include "ppapi/thunk/ppb_network_monitor_private_api.h" #include "webkit/glue/network_list_observer.h" -namespace webkit { -namespace ppapi { +namespace content { class PPB_NetworkMonitor_Private_Impl : public ::ppapi::Resource, @@ -47,7 +46,6 @@ class PPB_NetworkMonitor_Private_Impl DISALLOW_COPY_AND_ASSIGN(PPB_NetworkMonitor_Private_Impl); }; -} // namespace ppapi -} // namespace webkit +} // namespace content #endif // CONTENT_RENDERER_PEPPER_PPB_NETWORK_MONITOR_PRIVATE_IMPL_H_ diff --git a/content/renderer/pepper/ppb_proxy_impl.cc b/content/renderer/pepper/ppb_proxy_impl.cc index caf63f7..a9d99f3 100644 --- a/content/renderer/pepper/ppb_proxy_impl.cc +++ b/content/renderer/pepper/ppb_proxy_impl.cc @@ -14,8 +14,7 @@ using ppapi::PpapiGlobals; using ppapi::thunk::EnterResource; using ppapi::thunk::PPB_URLLoader_API; -namespace webkit { -namespace ppapi { +namespace content { namespace { @@ -75,5 +74,4 @@ const PPB_Proxy_Private* PPB_Proxy_Impl::GetInterface() { return &ppb_proxy; } -} // namespace ppapi -} // namespace webkit +} // namespace content diff --git a/content/renderer/pepper/ppb_proxy_impl.h b/content/renderer/pepper/ppb_proxy_impl.h index 04e12fc..f7341c0 100644 --- a/content/renderer/pepper/ppb_proxy_impl.h +++ b/content/renderer/pepper/ppb_proxy_impl.h @@ -7,16 +7,14 @@ struct PPB_Proxy_Private; -namespace webkit { -namespace ppapi { +namespace content { class PPB_Proxy_Impl { public: static const PPB_Proxy_Private* GetInterface(); }; -} // namespace ppapi -} // namespace webkit +} // namespace content #endif // CONTENT_RENDERER_PEPPER_PPB_PROXY_IMPL_H_ diff --git a/content/renderer/pepper/ppb_scrollbar_impl.cc b/content/renderer/pepper/ppb_scrollbar_impl.cc index a326cad..9c6800a 100644 --- a/content/renderer/pepper/ppb_scrollbar_impl.cc +++ b/content/renderer/pepper/ppb_scrollbar_impl.cc @@ -9,8 +9,8 @@ #include "base/message_loop/message_loop.h" #include "content/renderer/pepper/common.h" #include "content/renderer/pepper/event_conversion.h" +#include "content/renderer/pepper/pepper_plugin_instance_impl.h" #include "content/renderer/pepper/plugin_module.h" -#include "content/renderer/pepper/ppapi_plugin_instance_impl.h" #include "content/renderer/pepper/ppb_image_data_impl.h" #include "content/renderer/pepper/resource_helper.h" #include "ppapi/c/dev/ppp_scrollbar_dev.h" @@ -33,8 +33,7 @@ using WebKit::WebRect; using WebKit::WebScrollbar; using WebKit::WebPluginScrollbar; -namespace webkit { -namespace ppapi { +namespace content { // static PP_Resource PPB_Scrollbar_Impl::Create(PP_Instance instance, @@ -54,7 +53,8 @@ PPB_Scrollbar_Impl::~PPB_Scrollbar_Impl() { } void PPB_Scrollbar_Impl::Init(bool vertical) { - PluginInstanceImpl* plugin_instance = ResourceHelper::GetPluginInstance(this); + PepperPluginInstanceImpl* plugin_instance = + ResourceHelper::GetPluginInstance(this); if (!plugin_instance) return; scrollbar_.reset(WebPluginScrollbar::createForPlugin( @@ -247,5 +247,4 @@ void PPB_Scrollbar_Impl::NotifyInvalidate() { Invalidate(&pp_rect); } -} // namespace ppapi -} // namespace webkit +} // namespace content diff --git a/content/renderer/pepper/ppb_scrollbar_impl.h b/content/renderer/pepper/ppb_scrollbar_impl.h index eed236f..559c303 100644 --- a/content/renderer/pepper/ppb_scrollbar_impl.h +++ b/content/renderer/pepper/ppb_scrollbar_impl.h @@ -16,8 +16,7 @@ #include "third_party/WebKit/public/web/WebPluginScrollbarClient.h" #include "ui/gfx/rect.h" -namespace webkit { -namespace ppapi { +namespace content { class PPB_Scrollbar_Impl : public PPB_Widget_Impl, public ::ppapi::thunk::PPB_Scrollbar_API, @@ -72,7 +71,6 @@ class PPB_Scrollbar_Impl : public PPB_Widget_Impl, DISALLOW_COPY_AND_ASSIGN(PPB_Scrollbar_Impl); }; -} // namespace ppapi -} // namespace webkit +} // namespace content #endif // CONTENT_RENDERER_PEPPER_PPB_SCROLLBAR_IMPL_H_ diff --git a/content/renderer/pepper/ppb_tcp_server_socket_private_impl.cc b/content/renderer/pepper/ppb_tcp_server_socket_private_impl.cc index 2e8ceda..5cc66fe 100644 --- a/content/renderer/pepper/ppb_tcp_server_socket_private_impl.cc +++ b/content/renderer/pepper/ppb_tcp_server_socket_private_impl.cc @@ -10,8 +10,7 @@ #include "content/renderer/pepper/ppb_tcp_socket_private_impl.h" #include "content/renderer/pepper/resource_helper.h" -namespace webkit { -namespace ppapi { +namespace content { PPB_TCPServerSocket_Private_Impl::PPB_TCPServerSocket_Private_Impl( PP_Instance instance) @@ -78,5 +77,4 @@ void PPB_TCPServerSocket_Private_Impl::SendStopListening() { plugin_delegate->TCPServerSocketStopListening(pp_resource(), socket_id_); } -} // namespace ppapi -} // namespace webkit +} // namespace content diff --git a/content/renderer/pepper/ppb_tcp_server_socket_private_impl.h b/content/renderer/pepper/ppb_tcp_server_socket_private_impl.h index f048c7b..12db9ae 100644 --- a/content/renderer/pepper/ppb_tcp_server_socket_private_impl.h +++ b/content/renderer/pepper/ppb_tcp_server_socket_private_impl.h @@ -8,8 +8,7 @@ #include "base/compiler_specific.h" #include "ppapi/shared_impl/private/ppb_tcp_server_socket_shared.h" -namespace webkit { -namespace ppapi { +namespace content { class PPB_TCPServerSocket_Private_Impl : public ::ppapi::PPB_TCPServerSocket_Shared { @@ -34,7 +33,6 @@ class PPB_TCPServerSocket_Private_Impl DISALLOW_COPY_AND_ASSIGN(PPB_TCPServerSocket_Private_Impl); }; -} // namespace ppapi -} // namespace webkit +} // namespace content #endif // CONTENT_RENDERER_PEPPER_PPB_TCP_SERVER_SOCKET_PRIVATE_IMPL_H_ diff --git a/content/renderer/pepper/ppb_tcp_socket_private_impl.cc b/content/renderer/pepper/ppb_tcp_socket_private_impl.cc index 7ebcc64..36e560b 100644 --- a/content/renderer/pepper/ppb_tcp_socket_private_impl.cc +++ b/content/renderer/pepper/ppb_tcp_socket_private_impl.cc @@ -5,13 +5,12 @@ #include "content/renderer/pepper/ppb_tcp_socket_private_impl.h" #include "content/renderer/pepper/host_globals.h" +#include "content/renderer/pepper/pepper_plugin_instance_impl.h" #include "content/renderer/pepper/plugin_delegate.h" -#include "content/renderer/pepper/ppapi_plugin_instance_impl.h" #include "content/renderer/pepper/resource_helper.h" #include "ppapi/shared_impl/socket_option_data.h" -namespace webkit { -namespace ppapi { +namespace content { PPB_TCPSocket_Private_Impl::PPB_TCPSocket_Private_Impl( PP_Instance instance, uint32 socket_id) @@ -123,12 +122,11 @@ void PPB_TCPSocket_Private_Impl::SendSetOption( PluginDelegate* PPB_TCPSocket_Private_Impl::GetPluginDelegate( PP_Instance instance) { - PluginInstanceImpl* plugin_instance = + PepperPluginInstanceImpl* plugin_instance = HostGlobals::Get()->GetInstance(instance); if (!plugin_instance) return NULL; return plugin_instance->delegate(); } -} // namespace ppapi -} // namespace webkit +} // namespace content diff --git a/content/renderer/pepper/ppb_tcp_socket_private_impl.h b/content/renderer/pepper/ppb_tcp_socket_private_impl.h index 7295094..c90e1a7 100644 --- a/content/renderer/pepper/ppb_tcp_socket_private_impl.h +++ b/content/renderer/pepper/ppb_tcp_socket_private_impl.h @@ -10,8 +10,7 @@ #include "base/compiler_specific.h" #include "ppapi/shared_impl/private/tcp_socket_private_impl.h" -namespace webkit { -namespace ppapi { +namespace content { class PluginDelegate; @@ -47,7 +46,6 @@ class PPB_TCPSocket_Private_Impl : public ::ppapi::TCPSocketPrivateImpl { DISALLOW_COPY_AND_ASSIGN(PPB_TCPSocket_Private_Impl); }; -} // namespace ppapi -} // namespace webkit +} // namespace content #endif // CONTENT_RENDERER_PEPPER_PPB_TCP_SOCKET_PRIVATE_IMPL_H_ diff --git a/content/renderer/pepper/ppb_uma_private_impl.cc b/content/renderer/pepper/ppb_uma_private_impl.cc index 8468dd7..c3c66a50 100644 --- a/content/renderer/pepper/ppb_uma_private_impl.cc +++ b/content/renderer/pepper/ppb_uma_private_impl.cc @@ -12,8 +12,7 @@ using ppapi::StringVar; -namespace webkit { -namespace ppapi { +namespace content { namespace { @@ -96,5 +95,4 @@ const PPB_UMA_Private* PPB_UMA_Private_Impl::GetInterface() { return &ppb_uma; } -} // namespace ppapi -} // namespace webkit +} // namespace content diff --git a/content/renderer/pepper/ppb_uma_private_impl.h b/content/renderer/pepper/ppb_uma_private_impl.h index 55a94f4..91eae47 100644 --- a/content/renderer/pepper/ppb_uma_private_impl.h +++ b/content/renderer/pepper/ppb_uma_private_impl.h @@ -7,15 +7,13 @@ #include "ppapi/c/private/ppb_uma_private.h" -namespace webkit { -namespace ppapi { +namespace content { class PPB_UMA_Private_Impl { public: static const PPB_UMA_Private* GetInterface(); }; -} // namespace ppapi -} // namespace webkit +} // namespace content #endif // CONTENT_RENDERER_PEPPER_PPB_UMA_PRIVATE_IMPL_H_ diff --git a/content/renderer/pepper/ppb_var_deprecated_impl.cc b/content/renderer/pepper/ppb_var_deprecated_impl.cc index cbfc6f9..c5353cf 100644 --- a/content/renderer/pepper/ppb_var_deprecated_impl.cc +++ b/content/renderer/pepper/ppb_var_deprecated_impl.cc @@ -10,9 +10,9 @@ #include "content/renderer/pepper/host_globals.h" #include "content/renderer/pepper/npapi_glue.h" #include "content/renderer/pepper/npobject_var.h" +#include "content/renderer/pepper/pepper_plugin_instance_impl.h" #include "content/renderer/pepper/plugin_module.h" #include "content/renderer/pepper/plugin_object.h" -#include "content/renderer/pepper/ppapi_plugin_instance_impl.h" #include "ppapi/c/dev/ppb_var_deprecated.h" #include "ppapi/c/ppb_var.h" #include "ppapi/c/pp_var.h" @@ -26,8 +26,7 @@ using ppapi::StringVar; using ppapi::Var; using WebKit::WebBindings; -namespace webkit { -namespace ppapi { +namespace content { namespace { @@ -119,7 +118,7 @@ class ObjectAccessorTryCatch : public TryCatch { NPObjectVar* object() { return object_.get(); } - PluginInstanceImpl* GetPluginInstance() { + PepperPluginInstanceImpl* GetPluginInstance() { return HostGlobals::Get()->GetInstance(object()->pp_instance()); } @@ -332,7 +331,7 @@ PP_Var CallDeprecated(PP_Var var, ObjectAccessorTryCatch accessor(var, exception); if (accessor.has_exception()) return PP_MakeUndefined(); - PluginInstanceImpl* plugin = accessor.GetPluginInstance(); + PepperPluginInstanceImpl* plugin = accessor.GetPluginInstance(); if (plugin && plugin->IsProcessingUserGesture()) { WebKit::WebScopedUserGesture user_gesture( plugin->CurrentUserGestureToken()); @@ -389,7 +388,8 @@ bool IsInstanceOfDeprecated(PP_Var var, PP_Var CreateObjectDeprecated(PP_Instance pp_instance, const PPP_Class_Deprecated* ppp_class, void* ppp_class_data) { - PluginInstanceImpl* instance = HostGlobals::Get()->GetInstance(pp_instance); + PepperPluginInstanceImpl* instance = + HostGlobals::Get()->GetInstance(pp_instance); if (!instance) { DLOG(ERROR) << "Create object passed an invalid instance."; return PP_MakeNull(); @@ -432,6 +432,5 @@ const PPB_Var_Deprecated* PPB_Var_Deprecated_Impl::GetVarDeprecatedInterface() { return &var_deprecated_interface; } -} // namespace ppapi -} // namespace webkit +} // namespace content diff --git a/content/renderer/pepper/ppb_var_deprecated_impl.h b/content/renderer/pepper/ppb_var_deprecated_impl.h index 459acfa..0531200 100644 --- a/content/renderer/pepper/ppb_var_deprecated_impl.h +++ b/content/renderer/pepper/ppb_var_deprecated_impl.h @@ -7,15 +7,13 @@ struct PPB_Var_Deprecated; -namespace webkit { -namespace ppapi { +namespace content { class PPB_Var_Deprecated_Impl { public: static const PPB_Var_Deprecated* GetVarDeprecatedInterface(); }; -} // namespace ppapi -} // namespace webkit +} // namespace content #endif // CONTENT_RENDERER_PEPPER_PPB_VAR_DEPRECATED_IMPL_H_ diff --git a/content/renderer/pepper/ppb_video_decoder_impl.cc b/content/renderer/pepper/ppb_video_decoder_impl.cc index c71f618..c5dc8fc 100644 --- a/content/renderer/pepper/ppb_video_decoder_impl.cc +++ b/content/renderer/pepper/ppb_video_decoder_impl.cc @@ -90,8 +90,7 @@ PP_VideoDecodeError_Dev MediaToPPError( } // namespace -namespace webkit { -namespace ppapi { +namespace content { PPB_VideoDecoder_Impl::PPB_VideoDecoder_Impl(PP_Instance instance) : PPB_VideoDecoder_Shared(instance), @@ -299,5 +298,4 @@ void PPB_VideoDecoder_Impl::NotifyInitializeDone() { NOTREACHED() << "PlatformVideoDecoder::Initialize() is synchronous!"; } -} // namespace ppapi -} // namespace webkit +} // namespace content diff --git a/content/renderer/pepper/ppb_video_decoder_impl.h b/content/renderer/pepper/ppb_video_decoder_impl.h index d2d07b8..b15fa90 100644 --- a/content/renderer/pepper/ppb_video_decoder_impl.h +++ b/content/renderer/pepper/ppb_video_decoder_impl.h @@ -25,8 +25,7 @@ class GLES2Implementation; } // namespace gles2 } // namespace gpu -namespace webkit { -namespace ppapi { +namespace content { class PPB_VideoDecoder_Impl : public ::ppapi::PPB_VideoDecoder_Shared, public media::VideoDecodeAccelerator::Client { @@ -82,7 +81,6 @@ class PPB_VideoDecoder_Impl : public ::ppapi::PPB_VideoDecoder_Shared, DISALLOW_COPY_AND_ASSIGN(PPB_VideoDecoder_Impl); }; -} // namespace ppapi -} // namespace webkit +} // namespace content #endif // CONTENT_RENDERER_PEPPER_PPB_VIDEO_DECODER_IMPL_H_ diff --git a/content/renderer/pepper/ppb_widget_impl.cc b/content/renderer/pepper/ppb_widget_impl.cc index 5854f01..39cdf4a 100644 --- a/content/renderer/pepper/ppb_widget_impl.cc +++ b/content/renderer/pepper/ppb_widget_impl.cc @@ -4,7 +4,7 @@ #include "content/renderer/pepper/ppb_widget_impl.h" -#include "content/renderer/pepper/ppapi_plugin_instance_impl.h" +#include "content/renderer/pepper/pepper_plugin_instance_impl.h" #include "content/renderer/pepper/ppb_image_data_impl.h" #include "content/renderer/pepper/plugin_module.h" #include "content/renderer/pepper/resource_helper.h" @@ -18,8 +18,7 @@ using ppapi::thunk::PPB_ImageData_API; using ppapi::thunk::PPB_InputEvent_API; using ppapi::thunk::PPB_Widget_API; -namespace webkit { -namespace ppapi { +namespace content { PPB_Widget_Impl::PPB_Widget_Impl(PP_Instance instance) : Resource(::ppapi::OBJECT_IS_IMPL, instance), @@ -65,7 +64,8 @@ void PPB_Widget_Impl::SetScale(float scale) { } void PPB_Widget_Impl::Invalidate(const PP_Rect* dirty) { - PluginInstanceImpl* plugin_instance = ResourceHelper::GetPluginInstance(this); + PepperPluginInstanceImpl* plugin_instance = + ResourceHelper::GetPluginInstance(this); if (!plugin_instance) return; const PPP_Widget_Dev* widget = static_cast<const PPP_Widget_Dev*>( @@ -75,6 +75,5 @@ void PPB_Widget_Impl::Invalidate(const PP_Rect* dirty) { widget->Invalidate(pp_instance(), pp_resource(), dirty); } -} // namespace ppapi -} // namespace webkit +} // namespace content diff --git a/content/renderer/pepper/ppb_widget_impl.h b/content/renderer/pepper/ppb_widget_impl.h index 7b1e950..5a5ef0d 100644 --- a/content/renderer/pepper/ppb_widget_impl.h +++ b/content/renderer/pepper/ppb_widget_impl.h @@ -18,8 +18,7 @@ namespace ppapi { struct InputEventData; } -namespace webkit { -namespace ppapi { +namespace content { class PPB_ImageData_Impl; @@ -59,7 +58,6 @@ class PPB_Widget_Impl : public ::ppapi::Resource, DISALLOW_COPY_AND_ASSIGN(PPB_Widget_Impl); }; -} // namespace ppapi -} // namespace webkit +} // namespace content #endif // CONTENT_RENDERER_PEPPER_PPB_WIDGET_IMPL_H_ diff --git a/content/renderer/pepper/ppb_x509_certificate_private_impl.cc b/content/renderer/pepper/ppb_x509_certificate_private_impl.cc index 0b848d2..6b60a42 100644 --- a/content/renderer/pepper/ppb_x509_certificate_private_impl.cc +++ b/content/renderer/pepper/ppb_x509_certificate_private_impl.cc @@ -7,8 +7,7 @@ #include "content/renderer/pepper/plugin_delegate.h" #include "content/renderer/pepper/resource_helper.h" -namespace webkit { -namespace ppapi { +namespace content { PPB_X509Certificate_Private_Impl::PPB_X509Certificate_Private_Impl( PP_Instance instance) : @@ -34,5 +33,4 @@ bool PPB_X509Certificate_Private_Impl::ParseDER( PPB_X509Certificate_Private_Impl::~PPB_X509Certificate_Private_Impl() { } -} // namespace ppapi -} // namespace webkit +} // namespace content diff --git a/content/renderer/pepper/ppb_x509_certificate_private_impl.h b/content/renderer/pepper/ppb_x509_certificate_private_impl.h index 6b8d856..76438c9 100644 --- a/content/renderer/pepper/ppb_x509_certificate_private_impl.h +++ b/content/renderer/pepper/ppb_x509_certificate_private_impl.h @@ -14,8 +14,7 @@ namespace ppapi { class PPB_X509Certificate_Fields; } -namespace webkit { -namespace ppapi { +namespace content { class PPB_X509Certificate_Private_Impl : public ::ppapi::PPB_X509Certificate_Private_Shared { @@ -31,7 +30,6 @@ class PPB_X509Certificate_Private_Impl : DISALLOW_COPY_AND_ASSIGN(PPB_X509Certificate_Private_Impl); }; -} // namespace ppapi -} // namespace webkit +} // namespace content #endif // CONTENT_RENDERER_PEPPER_PPB_X509_CERTIFICATE_PRIVATE_IMPL_H_ diff --git a/content/renderer/pepper/quota_file_io.cc b/content/renderer/pepper/quota_file_io.cc index 64d26a9..1493589 100644 --- a/content/renderer/pepper/quota_file_io.cc +++ b/content/renderer/pepper/quota_file_io.cc @@ -13,15 +13,14 @@ #include "base/stl_util.h" #include "base/task_runner_util.h" #include "content/renderer/pepper/host_globals.h" -#include "content/renderer/pepper/ppapi_plugin_instance_impl.h" +#include "content/renderer/pepper/pepper_plugin_instance_impl.h" #include "content/renderer/pepper/resource_helper.h" using base::PlatformFile; using base::PlatformFileError; using quota::StorageType; -namespace webkit { -namespace ppapi { +namespace content { namespace { StorageType PPFileSystemTypeToQuotaStorageType(PP_FileSystemType type) { @@ -288,7 +287,8 @@ bool QuotaFileIO::WillSetLength(int64_t length, } PluginDelegate* QuotaFileIO::GetPluginDelegate() const { - PluginInstanceImpl* instance = HostGlobals::Get()->GetInstance(pp_instance_); + PepperPluginInstanceImpl* instance = + HostGlobals::Get()->GetInstance(pp_instance_); if (instance) return instance->delegate(); return NULL; @@ -420,5 +420,4 @@ void QuotaFileIO::DidSetLength(PlatformFileError error, int64_t new_file_size) { inflight_operations_ = 0; } -} // namespace ppapi -} // namespace webkit +} // namespace content diff --git a/content/renderer/pepper/quota_file_io.h b/content/renderer/pepper/quota_file_io.h index 7c95464..fe390c6 100644 --- a/content/renderer/pepper/quota_file_io.h +++ b/content/renderer/pepper/quota_file_io.h @@ -16,8 +16,7 @@ #include "url/gurl.h" #include "webkit/common/quota/quota_types.h" -namespace webkit { -namespace ppapi { +namespace content { class PluginDelegate; @@ -111,7 +110,6 @@ class QuotaFileIO { DISALLOW_COPY_AND_ASSIGN(QuotaFileIO); }; -} // namespace ppapi -} // namespace webkit +} // namespace content #endif // CONTENT_RENDERER_PEPPER_QUOTA_FILE_IO_H_ diff --git a/content/renderer/pepper/quota_file_io_unittest.cc b/content/renderer/pepper/quota_file_io_unittest.cc index ad66e52..9928ebf 100644 --- a/content/renderer/pepper/quota_file_io_unittest.cc +++ b/content/renderer/pepper/quota_file_io_unittest.cc @@ -14,7 +14,7 @@ #include "base/message_loop/message_loop.h" #include "base/platform_file.h" #include "content/renderer/pepper/mock_plugin_delegate.h" -#include "content/renderer/pepper/ppapi_plugin_instance_impl.h" +#include "content/renderer/pepper/pepper_plugin_instance_impl.h" #include "content/renderer/pepper/ppapi_unittest.h" #include "content/renderer/pepper/quota_file_io.h" @@ -22,8 +22,7 @@ using base::MessageLoopProxy; using base::PlatformFile; using base::PlatformFileError; -namespace webkit { -namespace ppapi { +namespace content { namespace { class QuotaMockPluginDelegate : public MockPluginDelegate { @@ -497,5 +496,4 @@ TEST_F(QuotaFileIOTest, ParallelWrites) { EXPECT_EQ("123355559012345", read_buffer); } -} // namespace ppapi -} // namespace webkit +} // namespace content diff --git a/content/renderer/pepper/renderer_ppapi_host_impl.cc b/content/renderer/pepper/renderer_ppapi_host_impl.cc index 0d6768f..3d371bb 100644 --- a/content/renderer/pepper/renderer_ppapi_host_impl.cc +++ b/content/renderer/pepper/renderer_ppapi_host_impl.cc @@ -15,9 +15,9 @@ #include "content/renderer/pepper/pepper_in_process_resource_creation.h" #include "content/renderer/pepper/pepper_in_process_router.h" #include "content/renderer/pepper/pepper_plugin_delegate_impl.h" +#include "content/renderer/pepper/pepper_plugin_instance_impl.h" #include "content/renderer/pepper/plugin_delegate.h" #include "content/renderer/pepper/plugin_module.h" -#include "content/renderer/pepper/ppapi_plugin_instance_impl.h" #include "content/renderer/render_view_impl.h" #include "content/renderer/render_widget_fullscreen_pepper.h" #include "ipc/ipc_message.h" @@ -29,11 +29,6 @@ #include "third_party/WebKit/public/web/WebPluginContainer.h" #include "ui/gfx/point.h" -using webkit::ppapi::HostGlobals; -using webkit::ppapi::PluginInstance; -using webkit::ppapi::PluginInstanceImpl; -using webkit::ppapi::PluginModule; - namespace content { // static CONTENT_EXPORT RendererPpapiHost* @@ -113,7 +108,8 @@ RendererPpapiHostImpl* RendererPpapiHostImpl::CreateOnModuleForInProcess( // static RendererPpapiHostImpl* RendererPpapiHostImpl::GetForPPInstance( PP_Instance pp_instance) { - PluginInstanceImpl* instance = HostGlobals::Get()->GetInstance(pp_instance); + PepperPluginInstanceImpl* instance = + HostGlobals::Get()->GetInstance(pp_instance); if (!instance) return NULL; @@ -125,14 +121,14 @@ RendererPpapiHostImpl* RendererPpapiHostImpl::GetForPPInstance( scoped_ptr< ::ppapi::thunk::ResourceCreationAPI> RendererPpapiHostImpl::CreateInProcessResourceCreationAPI( - PluginInstanceImpl* instance) { + PepperPluginInstanceImpl* instance) { return scoped_ptr< ::ppapi::thunk::ResourceCreationAPI>( new PepperInProcessResourceCreation(this, instance)); } PepperBrowserConnection* RendererPpapiHostImpl::GetBrowserConnection(PP_Instance instance) const { - PluginInstanceImpl* instance_object = GetAndValidateInstance(instance); + PepperPluginInstanceImpl* instance_object = GetAndValidateInstance(instance); if (!instance_object) return NULL; @@ -146,7 +142,7 @@ RendererPpapiHostImpl::GetBrowserConnection(PP_Instance instance) const { return delegate->pepper_browser_connection(); } -webkit::ppapi::PluginInstanceImpl* RendererPpapiHostImpl::GetPluginInstanceImpl( +PepperPluginInstanceImpl* RendererPpapiHostImpl::GetPluginInstanceImpl( PP_Instance instance) const { return GetAndValidateInstance(instance); } @@ -157,7 +153,7 @@ ppapi::host::PpapiHost* RendererPpapiHostImpl::GetPpapiHost() { RenderView* RendererPpapiHostImpl::GetRenderViewForInstance( PP_Instance instance) const { - PluginInstanceImpl* instance_object = GetAndValidateInstance(instance); + PepperPluginInstanceImpl* instance_object = GetAndValidateInstance(instance); if (!instance_object) return NULL; @@ -171,14 +167,14 @@ bool RendererPpapiHostImpl::IsValidInstance(PP_Instance instance) const { return !!GetAndValidateInstance(instance); } -webkit::ppapi::PluginInstance* RendererPpapiHostImpl::GetPluginInstance( +PepperPluginInstance* RendererPpapiHostImpl::GetPluginInstance( PP_Instance instance) const { return GetAndValidateInstance(instance); } WebKit::WebPluginContainer* RendererPpapiHostImpl::GetContainerForInstance( PP_Instance instance) const { - PluginInstanceImpl* instance_object = GetAndValidateInstance(instance); + PepperPluginInstanceImpl* instance_object = GetAndValidateInstance(instance); if (!instance_object) return NULL; return instance_object->container(); @@ -191,7 +187,7 @@ base::ProcessId RendererPpapiHostImpl::GetPluginPID() const { } bool RendererPpapiHostImpl::HasUserGesture(PP_Instance instance) const { - PluginInstanceImpl* instance_object = GetAndValidateInstance(instance); + PepperPluginInstanceImpl* instance_object = GetAndValidateInstance(instance); if (!instance_object) return false; @@ -202,13 +198,11 @@ bool RendererPpapiHostImpl::HasUserGesture(PP_Instance instance) const { } int RendererPpapiHostImpl::GetRoutingIDForWidget(PP_Instance instance) const { - webkit::ppapi::PluginInstanceImpl* plugin_instance = - GetAndValidateInstance(instance); + PepperPluginInstanceImpl* plugin_instance = GetAndValidateInstance(instance); if (!plugin_instance) return 0; if (plugin_instance->flash_fullscreen()) { - webkit::ppapi::FullscreenContainer* container = - plugin_instance->fullscreen_container(); + FullscreenContainer* container = plugin_instance->fullscreen_container(); return static_cast<RenderWidgetFullscreenPepper*>(container)->routing_id(); } return GetRenderViewForInstance(instance)->GetRoutingID(); @@ -217,8 +211,7 @@ int RendererPpapiHostImpl::GetRoutingIDForWidget(PP_Instance instance) const { gfx::Point RendererPpapiHostImpl::PluginPointToRenderView( PP_Instance instance, const gfx::Point& pt) const { - webkit::ppapi::PluginInstanceImpl* plugin_instance = - GetAndValidateInstance(instance); + PepperPluginInstanceImpl* plugin_instance = GetAndValidateInstance(instance); if (!plugin_instance) return pt; @@ -269,9 +262,10 @@ void RendererPpapiHostImpl::CreateBrowserResourceHost( } } -PluginInstanceImpl* RendererPpapiHostImpl::GetAndValidateInstance( +PepperPluginInstanceImpl* RendererPpapiHostImpl::GetAndValidateInstance( PP_Instance pp_instance) const { - PluginInstanceImpl* instance = HostGlobals::Get()->GetInstance(pp_instance); + PepperPluginInstanceImpl* instance = + HostGlobals::Get()->GetInstance(pp_instance); if (!instance) return NULL; if (!instance->IsValidInstanceOf(module_)) diff --git a/content/renderer/pepper/renderer_ppapi_host_impl.h b/content/renderer/pepper/renderer_ppapi_host_impl.h index 6d576f7..c62009a 100644 --- a/content/renderer/pepper/renderer_ppapi_host_impl.h +++ b/content/renderer/pepper/renderer_ppapi_host_impl.h @@ -29,23 +29,17 @@ class ResourceCreationAPI; } // namespace ppapi -namespace webkit { -namespace ppapi { -class PluginInstanceImpl; -class PluginModule; -} -} - namespace content { class PepperBrowserConnection; class PepperInProcessRouter; +class PepperPluginInstanceImpl; +class PluginModule; // This class is attached to a PluginModule via the module's embedder state. // The plugin module manages our lifetime. -class RendererPpapiHostImpl - : public RendererPpapiHost, - public webkit::ppapi::PluginModule::EmbedderState { +class RendererPpapiHostImpl : public RendererPpapiHost, + public PluginModule::EmbedderState { public: virtual ~RendererPpapiHostImpl(); @@ -56,11 +50,11 @@ class RendererPpapiHostImpl // The module will take ownership of the new host impl. The returned value // does not pass ownership, it's just for the information of the caller. static RendererPpapiHostImpl* CreateOnModuleForOutOfProcess( - webkit::ppapi::PluginModule* module, + PluginModule* module, ppapi::proxy::HostDispatcher* dispatcher, const ppapi::PpapiPermissions& permissions); static RendererPpapiHostImpl* CreateOnModuleForInProcess( - webkit::ppapi::PluginModule* module, + PluginModule* module, const ppapi::PpapiPermissions& permissions); // Returns the RendererPpapiHostImpl associated with the given PP_Instance, @@ -80,18 +74,16 @@ class RendererPpapiHostImpl // creation object is associated with the instance, this will generally // happen automatically. scoped_ptr< ::ppapi::thunk::ResourceCreationAPI> - CreateInProcessResourceCreationAPI( - webkit::ppapi::PluginInstanceImpl* instance); + CreateInProcessResourceCreationAPI(PepperPluginInstanceImpl* instance); PepperBrowserConnection* GetBrowserConnection(PP_Instance instance) const; - webkit::ppapi::PluginInstanceImpl* GetPluginInstanceImpl( - PP_Instance instance) const; + PepperPluginInstanceImpl* GetPluginInstanceImpl(PP_Instance instance) const; // RendererPpapiHost implementation. virtual ppapi::host::PpapiHost* GetPpapiHost() OVERRIDE; virtual bool IsValidInstance(PP_Instance instance) const OVERRIDE; - virtual webkit::ppapi::PluginInstance* GetPluginInstance( + virtual PepperPluginInstance* GetPluginInstance( PP_Instance instance) const OVERRIDE; virtual RenderView* GetRenderViewForInstance( PP_Instance instance) const OVERRIDE; @@ -113,10 +105,10 @@ class RendererPpapiHostImpl const base::Callback<void(int)>& callback) const OVERRIDE; private: - RendererPpapiHostImpl(webkit::ppapi::PluginModule* module, + RendererPpapiHostImpl(PluginModule* module, ppapi::proxy::HostDispatcher* dispatcher, const ppapi::PpapiPermissions& permissions); - RendererPpapiHostImpl(webkit::ppapi::PluginModule* module, + RendererPpapiHostImpl(PluginModule* module, const ppapi::PpapiPermissions& permissions); // Retrieves the plugin instance object associated with the given PP_Instance @@ -125,10 +117,9 @@ class RendererPpapiHostImpl // // We use this to security check the PP_Instance values sent from a plugin to // make sure it's not trying to spoof another instance. - webkit::ppapi::PluginInstanceImpl* GetAndValidateInstance( - PP_Instance instance) const; + PepperPluginInstanceImpl* GetAndValidateInstance(PP_Instance instance) const; - webkit::ppapi::PluginModule* module_; // Non-owning pointer. + PluginModule* module_; // Non-owning pointer. // The dispatcher we use to send messagse when the plugin is out-of-process. // Will be null when running in-process. Non-owning pointer. diff --git a/content/renderer/pepper/resource_creation_impl.cc b/content/renderer/pepper/resource_creation_impl.cc index 63fbe35..cb8aa48 100644 --- a/content/renderer/pepper/resource_creation_impl.cc +++ b/content/renderer/pepper/resource_creation_impl.cc @@ -31,10 +31,9 @@ using ppapi::PPB_InputEvent_Shared; using ppapi::PPB_ResourceArray_Shared; using ppapi::StringVar; -namespace webkit { -namespace ppapi { +namespace content { -ResourceCreationImpl::ResourceCreationImpl(PluginInstanceImpl* instance) { +ResourceCreationImpl::ResourceCreationImpl(PepperPluginInstanceImpl* instance) { } ResourceCreationImpl::~ResourceCreationImpl() { @@ -313,5 +312,4 @@ PP_Resource ResourceCreationImpl::CreateX509CertificatePrivate( return PPB_X509Certificate_Private_Impl::CreateResource(instance); } -} // namespace ppapi -} // namespace webkit +} // namespace content diff --git a/content/renderer/pepper/resource_creation_impl.h b/content/renderer/pepper/resource_creation_impl.h index 8ed7ac4..7d09822 100644 --- a/content/renderer/pepper/resource_creation_impl.h +++ b/content/renderer/pepper/resource_creation_impl.h @@ -9,10 +9,9 @@ #include "base/compiler_specific.h" #include "ppapi/thunk/resource_creation_api.h" -namespace webkit { -namespace ppapi { +namespace content { -class PluginInstanceImpl; +class PepperPluginInstanceImpl; // This is an abstract class. ResourceCreationAPI functions that implement // "old-style" resources are handled here. See @@ -20,7 +19,7 @@ class PluginInstanceImpl; // that implement "new-style" resources. class ResourceCreationImpl : public ::ppapi::thunk::ResourceCreationAPI { public: - explicit ResourceCreationImpl(PluginInstanceImpl* instance); + explicit ResourceCreationImpl(PepperPluginInstanceImpl* instance); virtual ~ResourceCreationImpl(); // ResourceCreationAPI implementation. @@ -145,7 +144,6 @@ class ResourceCreationImpl : public ::ppapi::thunk::ResourceCreationAPI { DISALLOW_COPY_AND_ASSIGN(ResourceCreationImpl); }; -} // namespace ppapi -} // namespace webkit +} // namespace content #endif // CONTENT_RENDERER_PEPPER_RESOURCE_CREATION_IMPL_H_ diff --git a/content/renderer/pepper/resource_helper.cc b/content/renderer/pepper/resource_helper.cc index c665223..0f4ebda 100644 --- a/content/renderer/pepper/resource_helper.cc +++ b/content/renderer/pepper/resource_helper.cc @@ -6,36 +6,34 @@ #include "base/logging.h" #include "content/renderer/pepper/host_globals.h" +#include "content/renderer/pepper/pepper_plugin_instance_impl.h" #include "content/renderer/pepper/plugin_module.h" -#include "content/renderer/pepper/ppapi_plugin_instance_impl.h" #include "ppapi/shared_impl/resource.h" -namespace webkit { -namespace ppapi { +namespace content { // static -PluginInstanceImpl* ResourceHelper::GetPluginInstance( +PepperPluginInstanceImpl* ResourceHelper::GetPluginInstance( const ::ppapi::Resource* resource) { return PPInstanceToPluginInstance(resource->pp_instance()); } -PluginInstanceImpl* ResourceHelper::PPInstanceToPluginInstance( +PepperPluginInstanceImpl* ResourceHelper::PPInstanceToPluginInstance( PP_Instance instance) { return HostGlobals::Get()->GetInstance(instance); } PluginModule* ResourceHelper::GetPluginModule( const ::ppapi::Resource* resource) { - PluginInstanceImpl* instance = GetPluginInstance(resource); + PepperPluginInstanceImpl* instance = GetPluginInstance(resource); return instance ? instance->module() : NULL; } PluginDelegate* ResourceHelper::GetPluginDelegate( const ::ppapi::Resource* resource) { - PluginInstanceImpl* instance = GetPluginInstance(resource); + PepperPluginInstanceImpl* instance = GetPluginInstance(resource); return instance ? instance->delegate() : NULL; } -} // namespace ppapi -} // namespace webkit +} // namespace content diff --git a/content/renderer/pepper/resource_helper.h b/content/renderer/pepper/resource_helper.h index fa8483f..2f855f6 100644 --- a/content/renderer/pepper/resource_helper.h +++ b/content/renderer/pepper/resource_helper.h @@ -13,10 +13,9 @@ namespace ppapi { class Resource; } -namespace webkit { -namespace ppapi { +namespace content { -class PluginInstanceImpl; +class PepperPluginInstanceImpl; class PluginModule; class PluginDelegate; @@ -29,7 +28,7 @@ class ResourceHelper { public: // Returns the instance implementation object for the given resource, or NULL // if the resource has outlived its instance. - static PluginInstanceImpl* GetPluginInstance( + static PepperPluginInstanceImpl* GetPluginInstance( const ::ppapi::Resource* resource); // Returns the module for the given resource, or NULL if the resource has @@ -41,13 +40,13 @@ class ResourceHelper { static PluginDelegate* GetPluginDelegate(const ::ppapi::Resource* resource); // Returns the instance implementation object for the pp_instance. - static PluginInstanceImpl* PPInstanceToPluginInstance(PP_Instance instance); + static PepperPluginInstanceImpl* PPInstanceToPluginInstance( + PP_Instance instance); private: DISALLOW_IMPLICIT_CONSTRUCTORS(ResourceHelper); }; -} // namespace ppapi -} // namespace webkit +} // namespace content #endif // CONTENT_RENDERER_PEPPER_RESOURCE_IMPL_HELPER_H_ diff --git a/content/renderer/pepper/url_request_info_util.cc b/content/renderer/pepper/url_request_info_util.cc index 08fc076..d3c4506 100644 --- a/content/renderer/pepper/url_request_info_util.cc +++ b/content/renderer/pepper/url_request_info_util.cc @@ -35,8 +35,7 @@ using WebKit::WebFrame; using WebKit::WebURL; using WebKit::WebURLRequest; -namespace webkit { -namespace ppapi { +namespace content { namespace { @@ -201,5 +200,4 @@ bool URLRequestRequiresUniversalAccess( url_util::FindAndCompareScheme(data.url, "javascript", NULL); } -} // namespace ppapi -} // namespace webkit +} // namespace content diff --git a/content/renderer/pepper/url_request_info_util.h b/content/renderer/pepper/url_request_info_util.h index 88cabc8..4261535 100644 --- a/content/renderer/pepper/url_request_info_util.h +++ b/content/renderer/pepper/url_request_info_util.h @@ -17,8 +17,7 @@ class WebFrame; class WebURLRequest; } -namespace webkit { -namespace ppapi { +namespace content { // Creates the WebKit URL request from the current request info. Returns true // on success, false if the request is invalid (in which case *dest may be @@ -32,7 +31,6 @@ CONTENT_EXPORT bool CreateWebURLRequest(::ppapi::URLRequestInfoData* data, CONTENT_EXPORT bool URLRequestRequiresUniversalAccess( const ::ppapi::URLRequestInfoData& data); -} // namespace ppapi -} // namespace webkit +} // namespace content #endif // CONTENT_RENDERER_PEPPER_PPB_URL_REQUEST_INFO_UTIL_H_ diff --git a/content/renderer/pepper/url_response_info_util.cc b/content/renderer/pepper/url_response_info_util.cc index f07a9b9..883f772 100644 --- a/content/renderer/pepper/url_response_info_util.cc +++ b/content/renderer/pepper/url_response_info_util.cc @@ -13,7 +13,6 @@ #include "third_party/WebKit/public/platform/WebURL.h" #include "third_party/WebKit/public/platform/WebURLResponse.h" -using webkit::ppapi::PPB_FileRef_Impl; using WebKit::WebHTTPHeaderVisitor; using WebKit::WebString; using WebKit::WebURLResponse; diff --git a/content/renderer/pepper/usb_key_code_conversion.cc b/content/renderer/pepper/usb_key_code_conversion.cc index 2640417..5ad8226a 100644 --- a/content/renderer/pepper/usb_key_code_conversion.cc +++ b/content/renderer/pepper/usb_key_code_conversion.cc @@ -8,8 +8,7 @@ using WebKit::WebKeyboardEvent; -namespace webkit { -namespace ppapi { +namespace content { #if !defined(OS_LINUX) && !defined(OS_MACOSX) && !defined(OS_WIN) @@ -19,5 +18,4 @@ uint32_t UsbKeyCodeForKeyboardEvent(const WebKeyboardEvent& key_event) { #endif -} // namespace ppapi -} // namespace webkit +} // namespace content diff --git a/content/renderer/pepper/usb_key_code_conversion.h b/content/renderer/pepper/usb_key_code_conversion.h index 459e662..22583cc 100644 --- a/content/renderer/pepper/usb_key_code_conversion.h +++ b/content/renderer/pepper/usb_key_code_conversion.h @@ -11,8 +11,7 @@ namespace WebKit { class WebKeyboardEvent; } // namespace WebKit -namespace webkit { -namespace ppapi { +namespace content { // Returns a 32-bit "USB Key Code" for the key identifier by the supplied // WebKeyboardEvent. The supplied event must be a KeyDown or KeyUp. @@ -21,7 +20,6 @@ namespace ppapi { // is returned. uint32_t UsbKeyCodeForKeyboardEvent(const WebKit::WebKeyboardEvent& key_event); -} // namespace ppapi -} // namespace webkit +} // namespace content #endif // CONTENT_RENDERER_PEPPER_USB_KEY_CODE_CONVERSION_H_ diff --git a/content/renderer/pepper/usb_key_code_conversion_linux.cc b/content/renderer/pepper/usb_key_code_conversion_linux.cc index fd5e2b1..4c41b91 100644 --- a/content/renderer/pepper/usb_key_code_conversion_linux.cc +++ b/content/renderer/pepper/usb_key_code_conversion_linux.cc @@ -9,8 +9,7 @@ using WebKit::WebKeyboardEvent; -namespace webkit { -namespace ppapi { +namespace content { namespace { @@ -28,5 +27,4 @@ uint32_t UsbKeyCodeForKeyboardEvent(const WebKeyboardEvent& key_event) { return NativeKeycodeToUsbKeycode(key_event.nativeKeyCode); } -} // namespace ppapi -} // namespace webkit +} // namespace content diff --git a/content/renderer/pepper/usb_key_code_conversion_mac.cc b/content/renderer/pepper/usb_key_code_conversion_mac.cc index 4f55366..2a7e3d7 100644 --- a/content/renderer/pepper/usb_key_code_conversion_mac.cc +++ b/content/renderer/pepper/usb_key_code_conversion_mac.cc @@ -9,8 +9,7 @@ using WebKit::WebKeyboardEvent; -namespace webkit { -namespace ppapi { +namespace content { namespace { @@ -24,5 +23,4 @@ uint32_t UsbKeyCodeForKeyboardEvent(const WebKeyboardEvent& key_event) { return NativeKeycodeToUsbKeycode(key_event.nativeKeyCode); } -} // namespace ppapi -} // namespace webkit +} // namespace content diff --git a/content/renderer/pepper/usb_key_code_conversion_win.cc b/content/renderer/pepper/usb_key_code_conversion_win.cc index 5ef1d81..126f3d6 100644 --- a/content/renderer/pepper/usb_key_code_conversion_win.cc +++ b/content/renderer/pepper/usb_key_code_conversion_win.cc @@ -9,8 +9,7 @@ using WebKit::WebKeyboardEvent; -namespace webkit { -namespace ppapi { +namespace content { namespace { @@ -29,5 +28,4 @@ uint32_t UsbKeyCodeForKeyboardEvent(const WebKeyboardEvent& key_event) { return NativeKeycodeToUsbKeycode(scancode); } -} // namespace ppapi -} // namespace webkit +} // namespace content diff --git a/content/renderer/pepper/v8_var_converter.cc b/content/renderer/pepper/v8_var_converter.cc index 202a7cc..25f9b66 100644 --- a/content/renderer/pepper/v8_var_converter.cc +++ b/content/renderer/pepper/v8_var_converter.cc @@ -60,8 +60,7 @@ inline size_t hash_value(const HashedHandle& handle) { #endif } // namespace BASE_HASH_NAMESPACE -namespace webkit { -namespace ppapi { +namespace content { namespace V8VarConverter { namespace { @@ -466,5 +465,4 @@ bool FromV8Value(v8::Handle<v8::Value> val, } } // namespace V8VarConverter -} // namespace ppapi -} // namespace webkit +} // namespace content diff --git a/content/renderer/pepper/v8_var_converter.h b/content/renderer/pepper/v8_var_converter.h index 2a07bfb..87a6b36 100644 --- a/content/renderer/pepper/v8_var_converter.h +++ b/content/renderer/pepper/v8_var_converter.h @@ -12,8 +12,7 @@ #include "v8/include/v8.h" #include "content/common/content_export.h" -namespace webkit { -namespace ppapi { +namespace content { namespace V8VarConverter { // Converts the given PP_Var to a v8::Value. True is returned upon success. @@ -29,7 +28,6 @@ bool CONTENT_EXPORT FromV8Value(v8::Handle<v8::Value> val, PP_Var* result); } // namespace V8VarConverter -} // namespace ppapi -} // namespace webkit +} // namespace content #endif // CONTENT_RENDERER_PEPPER_V8_VAR_CONVERTER_H diff --git a/content/renderer/pepper/v8_var_converter_unittest.cc b/content/renderer/pepper/v8_var_converter_unittest.cc index 794c665..3c3365d 100644 --- a/content/renderer/pepper/v8_var_converter_unittest.cc +++ b/content/renderer/pepper/v8_var_converter_unittest.cc @@ -35,8 +35,7 @@ using ppapi::TestGlobals; using ppapi::TestEqual; using ppapi::VarTracker; -namespace webkit { -namespace ppapi { +namespace content { namespace { @@ -383,5 +382,4 @@ TEST_F(V8VarConverterTest, StrangeDictionaryKeyTest) { } } -} // namespace ppapi -} // namespace webkit +} // namespace content diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc index e8f17ad..c6d88c0 100644 --- a/content/renderer/render_view_impl.cc +++ b/content/renderer/render_view_impl.cc @@ -2235,7 +2235,7 @@ WebExternalPopupMenu* RenderViewImpl::createExternalPopupMenu( } RenderWidgetFullscreenPepper* RenderViewImpl::CreatePepperFullscreenContainer( - webkit::ppapi::PluginInstanceImpl* plugin) { + PepperPluginInstanceImpl* plugin) { #if defined(ENABLE_PLUGINS) GURL active_url; if (webview() && webview()->mainFrame()) @@ -5450,13 +5450,12 @@ void RenderViewImpl::DidFlushPaint() { } } -webkit::ppapi::PluginInstanceImpl* - RenderViewImpl::GetBitmapForOptimizedPluginPaint( - const gfx::Rect& paint_bounds, - TransportDIB** dib, - gfx::Rect* location, - gfx::Rect* clip, - float* scale_factor) { +PepperPluginInstanceImpl* RenderViewImpl::GetBitmapForOptimizedPluginPaint( + const gfx::Rect& paint_bounds, + TransportDIB** dib, + gfx::Rect* location, + gfx::Rect* clip, + float* scale_factor) { return pepper_helper_->GetBitmapForOptimizedPluginPaint( paint_bounds, dib, location, clip, scale_factor); } diff --git a/content/renderer/render_view_impl.h b/content/renderer/render_view_impl.h index d2eea4a..48b236d 100644 --- a/content/renderer/render_view_impl.h +++ b/content/renderer/render_view_impl.h @@ -84,14 +84,6 @@ namespace ui { struct SelectedFileInfo; } // namespace ui -namespace webkit { - -namespace ppapi { -class PluginInstanceImpl; -} // namespace ppapi - -} // namespace webkit - namespace WebKit { class WebApplicationCacheHost; class WebApplicationCacheHostClient; @@ -155,6 +147,7 @@ class MediaStreamDispatcher; class MouseLockDispatcher; class NavigationState; class NotificationProvider; +class PepperPluginInstanceImpl; class RenderViewObserver; class RenderViewTest; class RendererAccessibility; @@ -301,7 +294,7 @@ class CONTENT_EXPORT RenderViewImpl // Creates a fullscreen container for a pepper plugin instance. RenderWidgetFullscreenPepper* CreatePepperFullscreenContainer( - webkit::ppapi::PluginInstanceImpl* plugin); + PepperPluginInstanceImpl* plugin); // Informs the render view that a PPAPI plugin has gained or lost focus. void PpapiPluginFocusChanged(); @@ -757,7 +750,7 @@ class CONTENT_EXPORT RenderViewImpl virtual void WillInitiatePaint() OVERRIDE; virtual void DidInitiatePaint() OVERRIDE; virtual void DidFlushPaint() OVERRIDE; - virtual webkit::ppapi::PluginInstanceImpl* GetBitmapForOptimizedPluginPaint( + virtual PepperPluginInstanceImpl* GetBitmapForOptimizedPluginPaint( const gfx::Rect& paint_bounds, TransportDIB** dib, gfx::Rect* location, diff --git a/content/renderer/render_view_pepper_helper.cc b/content/renderer/render_view_pepper_helper.cc index de27dfc..c98bcd1 100644 --- a/content/renderer/render_view_pepper_helper.cc +++ b/content/renderer/render_view_pepper_helper.cc @@ -17,13 +17,13 @@ WebKit::WebPlugin* RenderViewPepperHelper::CreatePepperWebPlugin( return NULL; } -webkit::ppapi::PluginInstanceImpl* -RenderViewPepperHelper::GetBitmapForOptimizedPluginPaint( - const gfx::Rect& paint_bounds, - TransportDIB** dib, - gfx::Rect* location, - gfx::Rect* clip, - float* scale_factor) { +PepperPluginInstanceImpl* + RenderViewPepperHelper::GetBitmapForOptimizedPluginPaint( + const gfx::Rect& paint_bounds, + TransportDIB** dib, + gfx::Rect* location, + gfx::Rect* clip, + float* scale_factor) { return NULL; } diff --git a/content/renderer/render_view_pepper_helper.h b/content/renderer/render_view_pepper_helper.h index 4d13c3e..54d33d5 100644 --- a/content/renderer/render_view_pepper_helper.h +++ b/content/renderer/render_view_pepper_helper.h @@ -30,12 +30,6 @@ namespace ui { class Range; } -namespace webkit { -namespace ppapi { -class PluginInstanceImpl; -} -} - namespace WebKit { struct WebCompositionUnderline; struct WebPluginParams; @@ -43,6 +37,7 @@ class WebPlugin; } namespace content { +class PepperPluginInstanceImpl; struct WebPluginInfo; class CONTENT_EXPORT RenderViewPepperHelper { @@ -56,7 +51,7 @@ class CONTENT_EXPORT RenderViewPepperHelper { // Called by RenderView to implement the corresponding function in its base // class RenderWidget (see that for more). - virtual webkit::ppapi::PluginInstanceImpl* GetBitmapForOptimizedPluginPaint( + virtual PepperPluginInstanceImpl* GetBitmapForOptimizedPluginPaint( const gfx::Rect& paint_bounds, TransportDIB** dib, gfx::Rect* location, diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc index fa49316..605bae5 100644 --- a/content/renderer/render_widget.cc +++ b/content/renderer/render_widget.cc @@ -31,7 +31,7 @@ #include "content/renderer/gpu/mailbox_output_surface.h" #include "content/renderer/gpu/render_widget_compositor.h" #include "content/renderer/ime_event_guard.h" -#include "content/renderer/pepper/ppapi_plugin_instance_impl.h" +#include "content/renderer/pepper/pepper_plugin_instance_impl.h" #include "content/renderer/render_process.h" #include "content/renderer/render_process_visibility_manager.h" #include "content/renderer/render_thread_impl.h" @@ -965,7 +965,7 @@ void RenderWidget::PaintRect(const gfx::Rect& rect, TransportDIB* optimized_dib = NULL; gfx::Rect optimized_copy_rect, optimized_copy_location; float dib_scale_factor; - webkit::ppapi::PluginInstanceImpl* optimized_instance = + PepperPluginInstanceImpl* optimized_instance = GetBitmapForOptimizedPluginPaint(rect, &optimized_dib, &optimized_copy_location, &optimized_copy_rect, @@ -2021,13 +2021,12 @@ void RenderWidget::SetDeviceScaleFactor(float device_scale_factor) { } } -webkit::ppapi::PluginInstanceImpl* - RenderWidget::GetBitmapForOptimizedPluginPaint( - const gfx::Rect& paint_bounds, - TransportDIB** dib, - gfx::Rect* location, - gfx::Rect* clip, - float* scale_factor) { +PepperPluginInstanceImpl* RenderWidget::GetBitmapForOptimizedPluginPaint( + const gfx::Rect& paint_bounds, + TransportDIB** dib, + gfx::Rect* location, + gfx::Rect* clip, + float* scale_factor) { // Bare RenderWidgets don't support optimized plugin painting. return NULL; } diff --git a/content/renderer/render_widget.h b/content/renderer/render_widget.h index 640b82b..4f20cc6 100644 --- a/content/renderer/render_widget.h +++ b/content/renderer/render_widget.h @@ -64,13 +64,8 @@ namespace ui { class Range; } -namespace webkit { -namespace ppapi { -class PluginInstanceImpl; -} // namespace ppapi -} // namespace webkit - namespace content { +class PepperPluginInstanceImpl; class RenderWidgetCompositor; class RenderWidgetTest; struct GpuRenderingStats; @@ -381,7 +376,7 @@ class CONTENT_EXPORT RenderWidget // // A return value of null means optimized painting can not be used and we // should continue with the normal painting code path. - virtual webkit::ppapi::PluginInstanceImpl* GetBitmapForOptimizedPluginPaint( + virtual PepperPluginInstanceImpl* GetBitmapForOptimizedPluginPaint( const gfx::Rect& paint_bounds, TransportDIB** dib, gfx::Rect* location, diff --git a/content/renderer/render_widget_fullscreen_pepper.cc b/content/renderer/render_widget_fullscreen_pepper.cc index 1eb0ff9..7a04ac7 100644 --- a/content/renderer/render_widget_fullscreen_pepper.cc +++ b/content/renderer/render_widget_fullscreen_pepper.cc @@ -14,8 +14,8 @@ #include "content/public/common/content_switches.h" #include "content/renderer/gpu/render_widget_compositor.h" #include "content/renderer/pepper/pepper_platform_context_3d_impl.h" +#include "content/renderer/pepper/pepper_plugin_instance_impl.h" #include "content/renderer/pepper/plugin_delegate.h" -#include "content/renderer/pepper/ppapi_plugin_instance_impl.h" #include "content/renderer/render_thread_impl.h" #include "gpu/command_buffer/client/gles2_implementation.h" #include "skia/ext/platform_canvas.h" @@ -348,7 +348,8 @@ class PepperWidget : public WebWidget { // static RenderWidgetFullscreenPepper* RenderWidgetFullscreenPepper::Create( - int32 opener_id, webkit::ppapi::PluginInstanceImpl* plugin, + int32 opener_id, + PepperPluginInstanceImpl* plugin, const GURL& active_url, const WebKit::WebScreenInfo& screen_info) { DCHECK_NE(MSG_ROUTING_NONE, opener_id); @@ -360,7 +361,7 @@ RenderWidgetFullscreenPepper* RenderWidgetFullscreenPepper::Create( } RenderWidgetFullscreenPepper::RenderWidgetFullscreenPepper( - webkit::ppapi::PluginInstanceImpl* plugin, + PepperPluginInstanceImpl* plugin, const GURL& active_url, const WebKit::WebScreenInfo& screen_info) : RenderWidgetFullscreen(screen_info), @@ -467,13 +468,13 @@ void RenderWidgetFullscreenPepper::Close() { RenderWidget::Close(); } -webkit::ppapi::PluginInstanceImpl* -RenderWidgetFullscreenPepper::GetBitmapForOptimizedPluginPaint( - const gfx::Rect& paint_bounds, - TransportDIB** dib, - gfx::Rect* location, - gfx::Rect* clip, - float* scale_factor) { +PepperPluginInstanceImpl* + RenderWidgetFullscreenPepper::GetBitmapForOptimizedPluginPaint( + const gfx::Rect& paint_bounds, + TransportDIB** dib, + gfx::Rect* location, + gfx::Rect* clip, + float* scale_factor) { if (plugin_ && plugin_->GetBitmapForOptimizedPluginPaint( paint_bounds, dib, location, clip, scale_factor)) { return plugin_; diff --git a/content/renderer/render_widget_fullscreen_pepper.h b/content/renderer/render_widget_fullscreen_pepper.h index 840a979..29980e8 100644 --- a/content/renderer/render_widget_fullscreen_pepper.h +++ b/content/renderer/render_widget_fullscreen_pepper.h @@ -11,30 +11,22 @@ #include "content/renderer/render_widget_fullscreen.h" #include "third_party/WebKit/public/web/WebWidget.h" -namespace webkit { -namespace ppapi { - -class PluginInstanceImpl; - -} // namespace ppapi -} // namespace webkit - namespace WebKit { class WebLayer; } namespace content { +class PepperPluginInstanceImpl; // A RenderWidget that hosts a fullscreen pepper plugin. This provides a // FullscreenContainer that the plugin instance can callback into to e.g. // invalidate rects. -class RenderWidgetFullscreenPepper : - public RenderWidgetFullscreen, - public webkit::ppapi::FullscreenContainer { +class RenderWidgetFullscreenPepper : public RenderWidgetFullscreen, + public FullscreenContainer { public: static RenderWidgetFullscreenPepper* Create( int32 opener_id, - webkit::ppapi::PluginInstanceImpl* plugin, + PepperPluginInstanceImpl* plugin, const GURL& active_url, const WebKit::WebScreenInfo& screen_info); @@ -51,7 +43,7 @@ class RenderWidgetFullscreenPepper : virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; // Could be NULL when this widget is closing. - webkit::ppapi::PluginInstanceImpl* plugin() const { return plugin_; } + PepperPluginInstanceImpl* plugin() const { return plugin_; } MouseLockDispatcher* mouse_lock_dispatcher() const { return mouse_lock_dispatcher_.get(); @@ -60,7 +52,7 @@ class RenderWidgetFullscreenPepper : bool is_compositing() const { return !!layer_; } protected: - RenderWidgetFullscreenPepper(webkit::ppapi::PluginInstanceImpl* plugin, + RenderWidgetFullscreenPepper(PepperPluginInstanceImpl* plugin, const GURL& active_url, const WebKit::WebScreenInfo& screen_info); virtual ~RenderWidgetFullscreenPepper(); @@ -70,7 +62,7 @@ class RenderWidgetFullscreenPepper : virtual void DidInitiatePaint() OVERRIDE; virtual void DidFlushPaint() OVERRIDE; virtual void Close() OVERRIDE; - virtual webkit::ppapi::PluginInstanceImpl* GetBitmapForOptimizedPluginPaint( + virtual PepperPluginInstanceImpl* GetBitmapForOptimizedPluginPaint( const gfx::Rect& paint_bounds, TransportDIB** dib, gfx::Rect* location, @@ -90,7 +82,7 @@ class RenderWidgetFullscreenPepper : GURL active_url_; // The plugin instance this widget wraps. - webkit::ppapi::PluginInstanceImpl* plugin_; + PepperPluginInstanceImpl* plugin_; WebKit::WebLayer* layer_; diff --git a/content/renderer/renderer_main.cc b/content/renderer/renderer_main.cc index b179545..0bfa064 100644 --- a/content/renderer/renderer_main.cc +++ b/content/renderer/renderer_main.cc @@ -202,8 +202,8 @@ int RendererMain(const MainFunctionParams& parameters) { } #if defined(ENABLE_PLUGINS) - webkit::ppapi::PpapiInterfaceFactoryManager* factory_manager = - webkit::ppapi::PpapiInterfaceFactoryManager::GetInstance(); + PpapiInterfaceFactoryManager* factory_manager = + PpapiInterfaceFactoryManager::GetInstance(); factory_manager->RegisterFactory(ContentPPAPIInterfaceFactory); // Load pepper plugins before engaging the sandbox. diff --git a/content/renderer/webplugin_delegate_proxy.h b/content/renderer/webplugin_delegate_proxy.h index c0838a2..46bf027 100644 --- a/content/renderer/webplugin_delegate_proxy.h +++ b/content/renderer/webplugin_delegate_proxy.h @@ -35,12 +35,6 @@ namespace base { class WaitableEvent; } -namespace webkit { -namespace npapi { -class WebPlugin; -} -} - namespace content { class NPObjectStub; class PluginChannelHost; |