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

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

Issue 9609008: Implemented Browser Plugin (NOT FOR REVIEW) (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Updated according to creis@'s comments Created 8 years, 7 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') | content/renderer/render_thread_impl.h » ('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 454fb17265519b73487797136280b28139eda84a..2c20c537923c9f30a95ce2c6c22f6d0fec7d93f8 100644
--- a/content/renderer/pepper/pepper_plugin_delegate_impl.cc
+++ b/content/renderer/pepper/pepper_plugin_delegate_impl.cc
@@ -34,6 +34,8 @@
#include "content/public/common/media_stream_request.h"
#include "content/public/common/referrer.h"
#include "content/public/renderer/content_renderer_client.h"
+#include "content/renderer/browser_plugin/browser_plugin_constants.h"
+#include "content/renderer/browser_plugin/browser_plugin_registry.h"
#include "content/renderer/gamepad_shared_memory_reader.h"
#include "content/renderer/media/audio_hardware.h"
#include "content/renderer/media/media_stream_dispatcher.h"
@@ -265,6 +267,40 @@ PepperPluginDelegateImpl::CreatePepperPluginModule(
return module;
}
+scoped_refptr<webkit::ppapi::PluginModule>
+ PepperPluginDelegateImpl::CreateBrowserPluginModule(
+ const IPC::ChannelHandle& channel_handle,
+ int guest_process_id) {
+ BrowserPluginRegistry* registry =
+ RenderThreadImpl::current()->browser_plugin_registry();
+ scoped_refptr<webkit::ppapi::PluginModule> module =
+ registry->GetModule(guest_process_id);
+ if (module)
+ return module;
+
+ scoped_refptr<PepperHungPluginFilter> hung_filter(
+ new PepperHungPluginFilter(FilePath(kBrowserPluginPath),
+ render_view_->routing_id(),
+ guest_process_id));
+ // Create a new HostDispatcher for the proxying, and hook it to a new
+ // PluginModule.
+ module = new webkit::ppapi::PluginModule(kBrowserPluginName,
+ FilePath(kBrowserPluginPath),
+ registry);
+ RenderThreadImpl::current()->browser_plugin_registry()->AddModule(
+ guest_process_id, module);
+ scoped_ptr<HostDispatcherWrapper> dispatcher(new HostDispatcherWrapper);
+ if (!dispatcher->Init(
+ channel_handle,
+ module->pp_module(),
+ webkit::ppapi::PluginModule::GetLocalGetInterfaceFunc(),
+ GetPreferences(),
+ hung_filter.get()))
+ return scoped_refptr<webkit::ppapi::PluginModule>();
+ module->InitAsProxied(dispatcher.release());
+ return module;
+}
+
scoped_refptr<PepperBrokerImpl> PepperPluginDelegateImpl::CreateBroker(
webkit::ppapi::PluginModule* plugin_module) {
DCHECK(plugin_module);
« no previous file with comments | « content/renderer/pepper/pepper_plugin_delegate_impl.h ('k') | content/renderer/render_thread_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698