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

Unified Diff: chrome/browser/ppapi_plugin_process_host.cc

Issue 4985001: Initial audio implementation. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 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 | « chrome/browser/ppapi_plugin_process_host.h ('k') | chrome/common/render_messages_internal.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ppapi_plugin_process_host.cc
===================================================================
--- chrome/browser/ppapi_plugin_process_host.cc (revision 67903)
+++ chrome/browser/ppapi_plugin_process_host.cc (working copy)
@@ -29,7 +29,7 @@
reply_msg_.reset(reply_msg);
if (!CreateChannel()) {
- ReplyToRenderer(IPC::ChannelHandle());
+ ReplyToRenderer(NULL, IPC::ChannelHandle());
return;
}
@@ -39,7 +39,7 @@
FilePath exe_path = ChildProcessHost::GetChildPath(plugin_launcher.empty());
if (exe_path.empty()) {
- ReplyToRenderer(IPC::ChannelHandle());
+ ReplyToRenderer(NULL, IPC::ChannelHandle());
return;
}
@@ -80,25 +80,49 @@
}
void PpapiPluginProcessHost::OnChannelConnected(int32 peer_pid) {
- PpapiMsg_LoadPlugin* msg = new PpapiMsg_LoadPlugin(plugin_path_,
+#if defined(OS_WIN)
+ base::ProcessHandle plugins_renderer_handle = NULL;
+ ::DuplicateHandle(::GetCurrentProcess(), filter_->handle(),
+ GetChildProcessHandle(), &plugins_renderer_handle,
+ 0, FALSE, DUPLICATE_SAME_ACCESS);
+#elif defined(OS_POSIX)
+ base::ProcessHandle plugins_renderer_handle = filter_->handle();
+#endif
+
+ PpapiMsg_LoadPlugin* msg = new PpapiMsg_LoadPlugin(plugins_renderer_handle,
+ plugin_path_,
filter_->id());
if (!Send(msg)) // Just send an empty handle on failure.
- ReplyToRenderer(IPC::ChannelHandle());
+ ReplyToRenderer(NULL, IPC::ChannelHandle());
// This function will result in OnChannelCreated getting called to finish.
}
void PpapiPluginProcessHost::OnChannelError() {
if (reply_msg_.get())
- ReplyToRenderer(IPC::ChannelHandle());
+ ReplyToRenderer(NULL, IPC::ChannelHandle());
}
-void PpapiPluginProcessHost::OnPluginLoaded(const IPC::ChannelHandle& handle) {
- ReplyToRenderer(handle);
+void PpapiPluginProcessHost::OnPluginLoaded(
+ const IPC::ChannelHandle& channel_handle) {
+ base::ProcessHandle plugin_process = GetChildProcessHandle();
+#if defined(OS_WIN)
+ base::ProcessHandle renderers_plugin_handle = NULL;
+ ::DuplicateHandle(::GetCurrentProcess(), plugin_process,
+ filter_->handle(), &renderers_plugin_handle,
+ 0, FALSE, DUPLICATE_SAME_ACCESS);
+#elif defined(OS_POSIX)
+ // Don't need to duplicate anything on POSIX since it's just a PID.
+ base::ProcessHandle renderers_plugin_handle = plugin_process;
+#endif
+ ReplyToRenderer(renderers_plugin_handle, channel_handle);
}
-void PpapiPluginProcessHost::ReplyToRenderer(const IPC::ChannelHandle& handle) {
+void PpapiPluginProcessHost::ReplyToRenderer(
+ base::ProcessHandle plugin_handle,
+ const IPC::ChannelHandle& channel_handle) {
DCHECK(reply_msg_.get());
ViewHostMsg_OpenChannelToPepperPlugin::WriteReplyParams(reply_msg_.get(),
- handle);
+ plugin_handle,
+ channel_handle);
filter_->Send(reply_msg_.release());
}
« no previous file with comments | « chrome/browser/ppapi_plugin_process_host.h ('k') | chrome/common/render_messages_internal.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698