| Index: chrome/renderer/pepper_plugin_delegate_impl.cc
|
| ===================================================================
|
| --- chrome/renderer/pepper_plugin_delegate_impl.cc (revision 69282)
|
| +++ chrome/renderer/pepper_plugin_delegate_impl.cc (working copy)
|
| @@ -39,10 +39,10 @@
|
| #include "third_party/WebKit/WebKit/chromium/public/WebPluginContainer.h"
|
| #include "third_party/WebKit/WebKit/chromium/public/WebView.h"
|
| #include "webkit/fileapi/file_system_callback_dispatcher.h"
|
| -#include "webkit/glue/plugins/pepper_file_io.h"
|
| -#include "webkit/glue/plugins/pepper_plugin_instance.h"
|
| -#include "webkit/glue/plugins/pepper_plugin_module.h"
|
| #include "webkit/glue/plugins/webplugin.h"
|
| +#include "webkit/plugins/ppapi/ppb_file_io_impl.h"
|
| +#include "webkit/plugins/ppapi/plugin_instance.h"
|
| +#include "webkit/plugins/ppapi/plugin_module.h"
|
|
|
| #if defined(OS_MACOSX)
|
| #include "chrome/common/render_messages.h"
|
| @@ -60,7 +60,8 @@
|
| const int32 kDefaultCommandBufferSize = 1024 * 1024;
|
|
|
| // Implements the Image2D using a TransportDIB.
|
| -class PlatformImage2DImpl : public pepper::PluginDelegate::PlatformImage2D {
|
| +class PlatformImage2DImpl
|
| + : public webkit::plugins::ppapi::PluginDelegate::PlatformImage2D {
|
| public:
|
| // This constructor will take ownership of the dib pointer.
|
| PlatformImage2DImpl(int width, int height, TransportDIB* dib)
|
| @@ -98,7 +99,8 @@
|
|
|
| #ifdef ENABLE_GPU
|
|
|
| -class PlatformContext3DImpl : public pepper::PluginDelegate::PlatformContext3D {
|
| +class PlatformContext3DImpl
|
| + : public webkit::plugins::ppapi::PluginDelegate::PlatformContext3D {
|
| public:
|
| explicit PlatformContext3DImpl(WebKit::WebView* web_view)
|
| : web_view_(web_view),
|
| @@ -128,7 +130,7 @@
|
| #endif // ENABLE_GPU
|
|
|
| class PlatformAudioImpl
|
| - : public pepper::PluginDelegate::PlatformAudio,
|
| + : public webkit::plugins::ppapi::PluginDelegate::PlatformAudio,
|
| public AudioMessageFilter::Delegate,
|
| public base::RefCountedThreadSafe<PlatformAudioImpl> {
|
| public:
|
| @@ -147,7 +149,7 @@
|
| // Initialize this audio context. StreamCreated() will be called when the
|
| // stream is created.
|
| bool Initialize(uint32_t sample_rate, uint32_t sample_count,
|
| - pepper::PluginDelegate::PlatformAudio::Client* client);
|
| + webkit::plugins::ppapi::PluginDelegate::PlatformAudio::Client* client);
|
|
|
| virtual bool StartPlayback() {
|
| return filter_ && filter_->Send(
|
| @@ -179,7 +181,7 @@
|
| virtual void OnVolume(double volume) { }
|
|
|
| // The client to notify when the stream is created.
|
| - pepper::PluginDelegate::PlatformAudio::Client* client_;
|
| + webkit::plugins::ppapi::PluginDelegate::PlatformAudio::Client* client_;
|
| // MessageFilter used to send/receive IPC.
|
| scoped_refptr<AudioMessageFilter> filter_;
|
| // Our ID on the MessageFilter.
|
| @@ -275,7 +277,7 @@
|
|
|
| bool PlatformAudioImpl::Initialize(
|
| uint32_t sample_rate, uint32_t sample_count,
|
| - pepper::PluginDelegate::PlatformAudio::Client* client) {
|
| + webkit::plugins::ppapi::PluginDelegate::PlatformAudio::Client* client) {
|
|
|
| DCHECK(client);
|
| // Make sure we don't call init more than once.
|
| @@ -335,7 +337,7 @@
|
|
|
| // Implements the VideoDecoder.
|
| class PlatformVideoDecoderImpl
|
| - : public pepper::PluginDelegate::PlatformVideoDecoder {
|
| + : public webkit::plugins::ppapi::PluginDelegate::PlatformVideoDecoder {
|
| public:
|
| PlatformVideoDecoderImpl()
|
| : input_buffer_size_(0),
|
| @@ -419,7 +421,8 @@
|
| DISALLOW_COPY_AND_ASSIGN(PlatformVideoDecoderImpl);
|
| };
|
|
|
| -class DispatcherWrapper : public pepper::PluginDelegate::OutOfProcessProxy {
|
| +class DispatcherWrapper
|
| + : public webkit::plugins::ppapi::PluginDelegate::OutOfProcessProxy {
|
| public:
|
| DispatcherWrapper() {}
|
| virtual ~DispatcherWrapper() {}
|
| @@ -477,7 +480,7 @@
|
| PepperPluginDelegateImpl::~PepperPluginDelegateImpl() {
|
| }
|
|
|
| -scoped_refptr<pepper::PluginModule>
|
| +scoped_refptr<webkit::plugins::ppapi::PluginModule>
|
| PepperPluginDelegateImpl::CreatePepperPlugin(const FilePath& path) {
|
| // Easy case is in-process plugins.
|
| if (!PepperPluginRegistry::GetInstance()->RunOutOfProcessForPlugin(path))
|
| @@ -489,16 +492,18 @@
|
| render_view_->Send(new ViewHostMsg_OpenChannelToPepperPlugin(
|
| path, &plugin_process_handle, &channel_handle));
|
| if (channel_handle.name.empty())
|
| - return scoped_refptr<pepper::PluginModule>(); // Couldn't be initialized.
|
| + return scoped_refptr<webkit::plugins::ppapi::PluginModule>(); // Couldn't be initialized.
|
|
|
| // Create a new HostDispatcher for the proxying, and hook it to a new
|
| // PluginModule.
|
| - scoped_refptr<pepper::PluginModule> module(new pepper::PluginModule);
|
| + scoped_refptr<webkit::plugins::ppapi::PluginModule> module(
|
| + new webkit::plugins::ppapi::PluginModule);
|
| scoped_ptr<DispatcherWrapper> dispatcher(new DispatcherWrapper);
|
| - if (!dispatcher->Init(plugin_process_handle, channel_handle,
|
| - module->pp_module(),
|
| - pepper::PluginModule::GetLocalGetInterfaceFunc()))
|
| - return scoped_refptr<pepper::PluginModule>();
|
| + if (!dispatcher->Init(
|
| + plugin_process_handle, channel_handle,
|
| + module->pp_module(),
|
| + webkit::plugins::ppapi::PluginModule::GetLocalGetInterfaceFunc()))
|
| + return scoped_refptr<webkit::plugins::ppapi::PluginModule>();
|
| module->InitAsProxied(dispatcher.release());
|
| return module;
|
| }
|
| @@ -507,7 +512,7 @@
|
| // 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<pepper::PluginInstance*>::iterator i =
|
| + for (std::set<webkit::plugins::ppapi::PluginInstance*>::iterator i =
|
| active_instances_.begin();
|
| i != active_instances_.end(); ++i)
|
| (*i)->ViewInitiatedPaint();
|
| @@ -518,8 +523,8 @@
|
| // 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<pepper::PluginInstance*> plugins = active_instances_;
|
| - for (std::set<pepper::PluginInstance*>::iterator i = plugins.begin();
|
| + std::set<webkit::plugins::ppapi::PluginInstance*> plugins = active_instances_;
|
| + for (std::set<webkit::plugins::ppapi::PluginInstance*>::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
|
| @@ -547,10 +552,10 @@
|
| TransportDIB** dib,
|
| gfx::Rect* location,
|
| gfx::Rect* clip) {
|
| - for (std::set<pepper::PluginInstance*>::iterator i =
|
| + for (std::set<webkit::plugins::ppapi::PluginInstance*>::iterator i =
|
| active_instances_.begin();
|
| i != active_instances_.end(); ++i) {
|
| - pepper::PluginInstance* instance = *i;
|
| + webkit::plugins::ppapi::PluginInstance* instance = *i;
|
| if (instance->GetBitmapForOptimizedPluginPaint(
|
| paint_bounds, dib, location, clip))
|
| return true;
|
| @@ -559,7 +564,7 @@
|
| }
|
|
|
| void PepperPluginDelegateImpl::InstanceCreated(
|
| - pepper::PluginInstance* instance) {
|
| + webkit::plugins::ppapi::PluginInstance* instance) {
|
| active_instances_.insert(instance);
|
|
|
| // Set the initial focus.
|
| @@ -567,11 +572,11 @@
|
| }
|
|
|
| void PepperPluginDelegateImpl::InstanceDeleted(
|
| - pepper::PluginInstance* instance) {
|
| + webkit::plugins::ppapi::PluginInstance* instance) {
|
| active_instances_.erase(instance);
|
| }
|
|
|
| -pepper::PluginDelegate::PlatformImage2D*
|
| +webkit::plugins::ppapi::PluginDelegate::PlatformImage2D*
|
| PepperPluginDelegateImpl::CreateImage2D(int width, int height) {
|
| uint32 buffer_size = width * height * 4;
|
|
|
| @@ -607,7 +612,7 @@
|
| return new PlatformImage2DImpl(width, height, dib);
|
| }
|
|
|
| -pepper::PluginDelegate::PlatformContext3D*
|
| +webkit::plugins::ppapi::PluginDelegate::PlatformContext3D*
|
| PepperPluginDelegateImpl::CreateContext3D() {
|
| #ifdef ENABLE_GPU
|
| return new PlatformContext3DImpl(render_view_->webview());
|
| @@ -616,7 +621,7 @@
|
| #endif
|
| }
|
|
|
| -pepper::PluginDelegate::PlatformVideoDecoder*
|
| +webkit::plugins::ppapi::PluginDelegate::PlatformVideoDecoder*
|
| PepperPluginDelegateImpl::CreateVideoDecoder(
|
| const PP_VideoDecoderConfig_Dev& decoder_config) {
|
| scoped_ptr<PlatformVideoDecoderImpl> decoder(new PlatformVideoDecoderImpl());
|
| @@ -639,9 +644,10 @@
|
| identifier, index + 1, WebKit::WebRect());
|
| }
|
|
|
| -pepper::PluginDelegate::PlatformAudio* PepperPluginDelegateImpl::CreateAudio(
|
| +webkit::plugins::ppapi::PluginDelegate::PlatformAudio*
|
| +PepperPluginDelegateImpl::CreateAudio(
|
| uint32_t sample_rate, uint32_t sample_count,
|
| - pepper::PluginDelegate::PlatformAudio::Client* client) {
|
| + webkit::plugins::ppapi::PluginDelegate::PlatformAudio::Client* client) {
|
| scoped_refptr<PlatformAudioImpl> audio(
|
| new PlatformAudioImpl(render_view_->audio_message_filter()));
|
| if (audio->Initialize(sample_rate, sample_count, client)) {
|
| @@ -683,7 +689,7 @@
|
| }
|
|
|
| void PepperPluginDelegateImpl::OnSetFocus(bool has_focus) {
|
| - for (std::set<pepper::PluginInstance*>::iterator i =
|
| + for (std::set<webkit::plugins::ppapi::PluginInstance*>::iterator i =
|
| active_instances_.begin();
|
| i != active_instances_.end(); ++i)
|
| (*i)->SetContentAreaFocus(has_focus);
|
| @@ -856,7 +862,7 @@
|
| base::PlatformFileError PepperPluginDelegateImpl::GetModuleLocalDirContents(
|
| const std::string& module_name,
|
| const FilePath& path,
|
| - PepperDirContents* contents) {
|
| + webkit::plugins::ppapi::DirContents* contents) {
|
| FilePath full_path = GetModuleLocalFilePath(module_name, path);
|
| if (full_path.empty()) {
|
| return base::PLATFORM_FILE_ERROR_ACCESS_DENIED;
|
| @@ -875,9 +881,9 @@
|
| return RenderThread::current()->GetFileThreadMessageLoopProxy();
|
| }
|
|
|
| -pepper::FullscreenContainer*
|
| +webkit::plugins::ppapi::FullscreenContainer*
|
| PepperPluginDelegateImpl::CreateFullscreenContainer(
|
| - pepper::PluginInstance* instance) {
|
| + webkit::plugins::ppapi::PluginInstance* instance) {
|
| return render_view_->CreatePepperFullscreenContainer(instance);
|
| }
|
|
|
|
|