Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(139)

Unified Diff: content/renderer/pepper/pepper_plugin_delegate_impl.cc

Issue 10544089: Implement the file chooser as a new resource "host" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/pepper/pepper_plugin_delegate_impl.h ('k') | ppapi/example/example.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/pepper/pepper_plugin_delegate_impl.cc
diff --git a/content/renderer/pepper/pepper_plugin_delegate_impl.cc b/content/renderer/pepper/pepper_plugin_delegate_impl.cc
index 18c40a97c81f85a89243f3ffb7f4636b1719e784..a42c467f33660bce28fa27f796e9e3a40ea56fd1 100644
--- a/content/renderer/pepper/pepper_plugin_delegate_impl.cc
+++ b/content/renderer/pepper/pepper_plugin_delegate_impl.cc
@@ -41,9 +41,11 @@
#include "content/renderer/media/pepper_platform_video_decoder_impl.h"
#include "content/renderer/p2p/p2p_transport_impl.h"
#include "content/renderer/p2p/socket_dispatcher.h"
+#include "content/renderer/pepper/content_renderer_pepper_host_factory.h"
#include "content/renderer/pepper/pepper_broker_impl.h"
#include "content/renderer/pepper/pepper_device_enumeration_event_handler.h"
#include "content/renderer/pepper/pepper_hung_plugin_filter.h"
+#include "content/renderer/pepper/pepper_in_process_resource_creation.h"
#include "content/renderer/pepper/pepper_platform_audio_input_impl.h"
#include "content/renderer/pepper/pepper_platform_audio_output_impl.h"
#include "content/renderer/pepper/pepper_platform_context_3d_impl.h"
@@ -62,6 +64,7 @@
#include "ppapi/c/dev/pp_video_dev.h"
#include "ppapi/c/pp_errors.h"
#include "ppapi/c/private/ppb_flash.h"
+#include "ppapi/host/ppapi_host.h"
#include "ppapi/proxy/host_dispatcher.h"
#include "ppapi/proxy/pepper_file_messages.h"
#include "ppapi/proxy/ppapi_messages.h"
@@ -103,7 +106,10 @@ namespace {
class HostDispatcherWrapper
: public webkit::ppapi::PluginDelegate::OutOfProcessProxy {
public:
- HostDispatcherWrapper() {}
+ HostDispatcherWrapper(RenderViewImpl* rv)
+ : render_view_(rv),
+ host_factory_(rv) {
+ }
virtual ~HostDispatcherWrapper() {}
bool Init(const IPC::ChannelHandle& channel_handle,
@@ -124,6 +130,9 @@ class HostDispatcherWrapper
dispatcher_.reset(new ppapi::proxy::HostDispatcher(
pp_module, local_get_interface, filter));
+ host_.reset(new ppapi::host::PpapiHost(dispatcher_.get(), &host_factory_));
+ dispatcher_->AddFilter(host_.get());
+
if (!dispatcher_->InitHostWithChannel(dispatcher_delegate_.get(),
channel_handle,
true, // Client.
@@ -149,6 +158,11 @@ class HostDispatcherWrapper
}
private:
+ RenderViewImpl* render_view_;
+ ContentRendererPepperHostFactory host_factory_;
+
+ scoped_ptr<ppapi::host::PpapiHost> host_;
+
scoped_ptr<ppapi::proxy::HostDispatcher> dispatcher_;
scoped_ptr<ppapi::proxy::ProxyChannel::Delegate> dispatcher_delegate_;
};
@@ -256,7 +270,8 @@ PepperPluginDelegateImpl::CreatePepperPluginModule(
module = new webkit::ppapi::PluginModule(info->name, path,
PepperPluginRegistry::GetInstance());
PepperPluginRegistry::GetInstance()->AddLiveModule(path, module);
- scoped_ptr<HostDispatcherWrapper> dispatcher(new HostDispatcherWrapper);
+ scoped_ptr<HostDispatcherWrapper> dispatcher(
+ new HostDispatcherWrapper(render_view_));
if (!dispatcher->Init(
channel_handle,
module->pp_module(),
@@ -291,7 +306,8 @@ scoped_refptr<webkit::ppapi::PluginModule>
registry);
RenderThreadImpl::current()->browser_plugin_registry()->AddModule(
guest_process_id, module);
- scoped_ptr<HostDispatcherWrapper> dispatcher(new HostDispatcherWrapper);
+ scoped_ptr<HostDispatcherWrapper> dispatcher(
+ new HostDispatcherWrapper(render_view_));
if (!dispatcher->Init(
channel_handle,
module->pp_module(),
@@ -597,6 +613,13 @@ void PepperPluginDelegateImpl::InstanceDeleted(
PluginFocusChanged(instance, false);
}
+scoped_ptr< ::ppapi::thunk::ResourceCreationAPI>
+PepperPluginDelegateImpl::CreateResourceCreationAPI(
+ webkit::ppapi::PluginInstance* instance) {
+ return scoped_ptr< ::ppapi::thunk::ResourceCreationAPI>(
+ new PepperInProcessResourceCreation(render_view_, instance));
+}
+
SkBitmap* PepperPluginDelegateImpl::GetSadPluginBitmap() {
return GetContentClient()->renderer()->GetSadPluginBitmap();
}
« no previous file with comments | « content/renderer/pepper/pepper_plugin_delegate_impl.h ('k') | ppapi/example/example.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698