diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-02 17:17:21 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-02 17:17:21 +0000 |
commit | 5d84d01d904a2e5fa3e17b8d9165e63a20351160 (patch) | |
tree | dd87a4d94ed6276dc1551cbc5d3c744eb268cebd /chrome/ppapi_plugin | |
parent | 9a80065bad1506ac11163d597ace3295ddbfa8cb (diff) | |
download | chromium_src-5d84d01d904a2e5fa3e17b8d9165e63a20351160.zip chromium_src-5d84d01d904a2e5fa3e17b8d9165e63a20351160.tar.gz chromium_src-5d84d01d904a2e5fa3e17b8d9165e63a20351160.tar.bz2 |
Implement audio proxy for Pepper.
In addition to the basic proxying, this required some changes to the dispatcher
and process infrastructure to get the handles of the processes available when
I need them so I can duplicate the shared memory handles properly into the
different processes.
TEST=none
BUG=none
Review URL: http://codereview.chromium.org/4985001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@68026 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/ppapi_plugin')
-rw-r--r-- | chrome/ppapi_plugin/ppapi_thread.cc | 13 | ||||
-rw-r--r-- | chrome/ppapi_plugin/ppapi_thread.h | 8 |
2 files changed, 14 insertions, 7 deletions
diff --git a/chrome/ppapi_plugin/ppapi_thread.cc b/chrome/ppapi_plugin/ppapi_thread.cc index 36ea9f6..8c4da88 100644 --- a/chrome/ppapi_plugin/ppapi_thread.cc +++ b/chrome/ppapi_plugin/ppapi_thread.cc @@ -47,9 +47,11 @@ void PpapiThread::OnMessageReceived(const IPC::Message& msg) { IPC_END_MESSAGE_MAP() } -void PpapiThread::OnLoadPlugin(const FilePath& path, int renderer_id) { +void PpapiThread::OnLoadPlugin(base::ProcessHandle host_process_handle, + const FilePath& path, + int renderer_id) { IPC::ChannelHandle channel_handle; - if (!LoadPluginLib(path) || + if (!LoadPluginLib(host_process_handle, path) || !SetupRendererChannel(renderer_id, &channel_handle)) { // An empty channel handle indicates error. Send(new PpapiHostMsg_PluginLoaded(IPC::ChannelHandle())); @@ -59,7 +61,8 @@ void PpapiThread::OnLoadPlugin(const FilePath& path, int renderer_id) { Send(new PpapiHostMsg_PluginLoaded(channel_handle)); } -bool PpapiThread::LoadPluginLib(const FilePath& path) { +bool PpapiThread::LoadPluginLib(base::ProcessHandle host_process_handle, + const FilePath& path) { base::ScopedNativeLibrary library(base::LoadNativeLibrary(path)); if (!library.is_valid()) return false; @@ -88,8 +91,8 @@ bool PpapiThread::LoadPluginLib(const FilePath& path) { library.GetFunctionPointer("PPP_ShutdownModule")); library_.Reset(library.Release()); - dispatcher_.reset(new pp::proxy::PluginDispatcher(get_interface, init_module, - shutdown_module)); + dispatcher_.reset(new pp::proxy::PluginDispatcher( + host_process_handle, get_interface, init_module, shutdown_module)); pp::proxy::PluginDispatcher::SetGlobal(dispatcher_.get()); return true; } diff --git a/chrome/ppapi_plugin/ppapi_thread.h b/chrome/ppapi_plugin/ppapi_thread.h index ed7b024..cf49c8b 100644 --- a/chrome/ppapi_plugin/ppapi_thread.h +++ b/chrome/ppapi_plugin/ppapi_thread.h @@ -7,6 +7,7 @@ #pragma once #include "base/basictypes.h" +#include "base/process.h" #include "base/scoped_native_library.h" #include "base/scoped_ptr.h" #include "build/build_config.h" @@ -34,9 +35,12 @@ class PpapiThread : public ChildThread { virtual void OnMessageReceived(const IPC::Message& msg); // Message handlers. - void OnLoadPlugin(const FilePath& path, int renderer_id); + void OnLoadPlugin(base::ProcessHandle renderer_handle, + const FilePath& path, + int renderer_id); - bool LoadPluginLib(const FilePath& path); + bool LoadPluginLib(base::ProcessHandle host_process_handle, + const FilePath& path); // Sets up the channel to the given renderer. On success, returns true and // fills the given ChannelHandle with the information from the new channel. |