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

Unified Diff: content/browser/renderer_host/pepper/pepper_message_filter.cc

Issue 10696132: Wire up a PPAPI host in content/browser. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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/browser/renderer_host/pepper/pepper_message_filter.h ('k') | content/content_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/pepper/pepper_message_filter.cc
diff --git a/content/browser/renderer_host/pepper/pepper_message_filter.cc b/content/browser/renderer_host/pepper/pepper_message_filter.cc
index 12a78dae4f2b4a4a24b5497f039f00ad8e6a799f..924176379ca38cfb751c9042ecd9c094fd42309c 100644
--- a/content/browser/renderer_host/pepper/pepper_message_filter.cc
+++ b/content/browser/renderer_host/pepper/pepper_message_filter.cc
@@ -76,6 +76,10 @@ PepperMessageFilter::PepperMessageFilter(
: process_type_(type),
process_id_(process_id),
resource_context_(browser_context->GetResourceContext()),
+ permissions_(), // Renderer has no PPAPI permissions,
+ host_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)),
+ ppapi_host_(ALLOW_THIS_IN_INITIALIZER_LIST(this), &host_factory_,
+ permissions_),
host_resolver_(NULL),
next_socket_id_(1) {
DCHECK(type == RENDERER);
@@ -87,10 +91,15 @@ PepperMessageFilter::PepperMessageFilter(
}
PepperMessageFilter::PepperMessageFilter(ProcessType type,
- net::HostResolver* host_resolver)
+ net::HostResolver* host_resolver,
+ const ppapi::PpapiPermissions& perms)
: process_type_(type),
process_id_(0),
resource_context_(NULL),
+ permissions_(perms),
+ host_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)),
+ ppapi_host_(ALLOW_THIS_IN_INITIALIZER_LIST(this), &host_factory_,
+ permissions_),
host_resolver_(host_resolver),
next_socket_id_(1),
incognito_(false) {
@@ -115,6 +124,14 @@ void PepperMessageFilter::OverrideThreadForMessage(
bool PepperMessageFilter::OnMessageReceived(const IPC::Message& msg,
bool* message_was_ok) {
+if (process_type_ == PLUGIN) {
+ // Handle new-style host messages directly from the plugin. Don't allow
+ // renderers to send these messages since they have fewer capabilities for
dmichael (off chromium) 2012/07/12 16:12:04 nit: I think it would be clearer to say something
+ // some classes of things than plugins.
+ if (ppapi_host_.OnMessageReceived(msg))
+ return true;
+ }
+
bool handled = true;
IPC_BEGIN_MESSAGE_MAP_EX(PepperMessageFilter, msg, *message_was_ok)
IPC_MESSAGE_HANDLER(PepperMsg_GetLocalTimeZoneOffset,
« no previous file with comments | « content/browser/renderer_host/pepper/pepper_message_filter.h ('k') | content/content_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698