Commit adf7cd5d authored by dmichael@chromium.org's avatar dmichael@chromium.org

PPAPI: Hook up Browser resource host stuff for NaCl

This does not fix handle passing, but messages that don't carry handles will probably work.

BUG=163021,163861


Review URL: https://chromiumcodereview.appspot.com/11434042

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171025 0039d316-1c4b-4281-b951-d872f2087c98
parent ef80e430
...@@ -767,14 +767,15 @@ void NaClProcessHost::OnPpapiChannelCreated( ...@@ -767,14 +767,15 @@ void NaClProcessHost::OnPpapiChannelCreated(
base::MessageLoopProxy::current())); base::MessageLoopProxy::current()));
// Create the browser ppapi host and enable PPAPI message dispatching to the // Create the browser ppapi host and enable PPAPI message dispatching to the
// browser process. // browser process.
content::BrowserPpapiHost::CreateExternalPluginProcess( ppapi_host_.reset(content::BrowserPpapiHost::CreateExternalPluginProcess(
process_.get(), // sender ipc_proxy_channel_.get(), //process_.get(), // sender
permissions_, permissions_,
process_->GetData().handle, process_->GetData().handle,
ipc_proxy_channel_.get(), ipc_proxy_channel_.get(),
chrome_render_message_filter_->GetHostResolver(), chrome_render_message_filter_->GetHostResolver(),
chrome_render_message_filter_->render_process_id(), chrome_render_message_filter_->render_process_id(),
render_view_id_); render_view_id_));
// Send a message to create the NaCl-Renderer channel. The handle is just // Send a message to create the NaCl-Renderer channel. The handle is just
// a place holder. // a place holder.
ipc_proxy_channel_->Send( ipc_proxy_channel_->Send(
......
...@@ -30,6 +30,7 @@ BrowserPpapiHost* BrowserPpapiHost::CreateExternalPluginProcess( ...@@ -30,6 +30,7 @@ BrowserPpapiHost* BrowserPpapiHost::CreateExternalPluginProcess(
host_resolver, host_resolver,
render_process_id, render_process_id,
render_view_id)); render_view_id));
channel->AddFilter(browser_ppapi_host->message_filter());
return browser_ppapi_host; return browser_ppapi_host;
} }
......
...@@ -85,6 +85,9 @@ class PpapiDispatcher : public ProxyChannel, ...@@ -85,6 +85,9 @@ class PpapiDispatcher : public ProxyChannel,
const ppapi::PpapiPermissions& permissions, const ppapi::PpapiPermissions& permissions,
bool incognito, bool incognito,
SerializedHandle handle); SerializedHandle handle);
void OnMsgResourceReply(
const ppapi::proxy::ResourceMessageReplyParams& reply_params,
const IPC::Message& nested_msg);
void OnPluginDispatcherMessageReceived(const IPC::Message& msg); void OnPluginDispatcherMessageReceived(const IPC::Message& msg);
std::set<PP_Instance> instances_; std::set<PP_Instance> instances_;
...@@ -163,6 +166,7 @@ void PpapiDispatcher::SetActiveURL(const std::string& url) { ...@@ -163,6 +166,7 @@ void PpapiDispatcher::SetActiveURL(const std::string& url) {
bool PpapiDispatcher::OnMessageReceived(const IPC::Message& msg) { bool PpapiDispatcher::OnMessageReceived(const IPC::Message& msg) {
IPC_BEGIN_MESSAGE_MAP(PpapiDispatcher, msg) IPC_BEGIN_MESSAGE_MAP(PpapiDispatcher, msg)
IPC_MESSAGE_HANDLER(PpapiMsg_CreateNaClChannel, OnMsgCreateNaClChannel) IPC_MESSAGE_HANDLER(PpapiMsg_CreateNaClChannel, OnMsgCreateNaClChannel)
IPC_MESSAGE_HANDLER(PpapiPluginMsg_ResourceReply, OnMsgResourceReply)
// All other messages are simply forwarded to a PluginDispatcher. // All other messages are simply forwarded to a PluginDispatcher.
IPC_MESSAGE_UNHANDLED(OnPluginDispatcherMessageReceived(msg)) IPC_MESSAGE_UNHANDLED(OnPluginDispatcherMessageReceived(msg))
IPC_END_MESSAGE_MAP() IPC_END_MESSAGE_MAP()
...@@ -191,6 +195,13 @@ void PpapiDispatcher::OnMsgCreateNaClChannel( ...@@ -191,6 +195,13 @@ void PpapiDispatcher::OnMsgCreateNaClChannel(
// lifetime of the attached channel. // lifetime of the attached channel.
} }
void PpapiDispatcher::OnMsgResourceReply(
const ppapi::proxy::ResourceMessageReplyParams& reply_params,
const IPC::Message& nested_msg) {
ppapi::proxy::PluginDispatcher::DispatchResourceReply(reply_params,
nested_msg);
}
void PpapiDispatcher::OnPluginDispatcherMessageReceived( void PpapiDispatcher::OnPluginDispatcherMessageReceived(
const IPC::Message& msg) { const IPC::Message& msg) {
// The first parameter should be a plugin dispatcher ID. // The first parameter should be a plugin dispatcher ID.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment