Chromium Code Reviews| 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, |