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

Unified Diff: content/browser/renderer_host/render_message_filter.cc

Issue 11368019: Add support for external out-of-process PPAPI plugins in the browser. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 1 month 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/browser/renderer_host/render_message_filter.h ('k') | content/common/view_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_message_filter.cc
===================================================================
--- content/browser/renderer_host/render_message_filter.cc (revision 166155)
+++ content/browser/renderer_host/render_message_filter.cc (working copy)
@@ -688,22 +688,42 @@
void RenderMessageFilter::OnDidCreateOutOfProcessPepperInstance(
int plugin_child_id,
int32 pp_instance,
- int render_view_id) {
+ int render_view_id,
+ bool is_external) {
// It's important that we supply the render process ID ourselves based on the
// channel the message arrived on. We use the
// PP_Instance -> (process id, view id)
// mapping to decide how to handle messages received from the (untrusted)
// plugin, so an exploited renderer must not be able to insert fake mappings
// that may allow it access to other render processes.
- PpapiPluginProcessHost::DidCreateOutOfProcessInstance(
- plugin_child_id, pp_instance, render_process_id_, render_view_id);
+ if (is_external) {
+ // We provide the BrowserPpapiHost to the embedder, so it's safe to cast.
+ BrowserPpapiHostImpl* host = static_cast<BrowserPpapiHostImpl*>(
+ GetContentClient()->browser()->GetExternalBrowserPpapiHost(
+ plugin_child_id));
+ if (host)
+ host->AddInstanceForView(pp_instance, render_process_id_, render_view_id);
+ } else {
+ PpapiPluginProcessHost::DidCreateOutOfProcessInstance(
+ plugin_child_id, pp_instance, render_process_id_, render_view_id);
+ }
}
void RenderMessageFilter::OnDidDeleteOutOfProcessPepperInstance(
int plugin_child_id,
- int32 pp_instance) {
- PpapiPluginProcessHost::DidDeleteOutOfProcessInstance(
- plugin_child_id, pp_instance);
+ int32 pp_instance,
+ bool is_external) {
+ if (is_external) {
+ // We provide the BrowserPpapiHost to the embedder, so it's safe to cast.
+ BrowserPpapiHostImpl* host = static_cast<BrowserPpapiHostImpl*>(
+ GetContentClient()->browser()->GetExternalBrowserPpapiHost(
+ plugin_child_id));
+ if (host)
+ host->DeleteInstanceForView(pp_instance);
+ } else {
+ PpapiPluginProcessHost::DidDeleteOutOfProcessInstance(
+ plugin_child_id, pp_instance);
+ }
}
void RenderMessageFilter::OnOpenChannelToPpapiBroker(int routing_id,
« no previous file with comments | « content/browser/renderer_host/render_message_filter.h ('k') | content/common/view_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698