summaryrefslogtreecommitdiffstats
path: root/chrome/browser/nacl_host
diff options
context:
space:
mode:
authormseaborn@chromium.org <mseaborn@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-23 21:34:01 +0000
committermseaborn@chromium.org <mseaborn@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-23 21:34:01 +0000
commit171fa98d0e102b13833e82cab9bb86eb97c5779c (patch)
tree7917b5017eb0b19588755641e8f548a8cde784b9 /chrome/browser/nacl_host
parent3b2437b6a1f48ec99f74fd61b837ac1116336c0d (diff)
downloadchromium_src-171fa98d0e102b13833e82cab9bb86eb97c5779c.zip
chromium_src-171fa98d0e102b13833e82cab9bb86eb97c5779c.tar.gz
chromium_src-171fa98d0e102b13833e82cab9bb86eb97c5779c.tar.bz2
NaCl: Don't pass the NaCl process's Windows handle to the renderer process
The process handle is not used since we switched NaCl to using Chromium's BrokerDuplicateHandle() function. I have changed NaCl's SelLdrLauncher to not use the process ID or process handle in this context, so returning dummy values of 0 and -1 will be OK: they will not get passed to kill(), waitpid() or TerminateProcess(). BUG=http://code.google.com/p/nativeclient/issues/detail?id=2719 TEST=nacl_integration etc. Review URL: http://codereview.chromium.org/10134029 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@133523 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/nacl_host')
-rw-r--r--chrome/browser/nacl_host/nacl_process_host.cc26
1 files changed, 2 insertions, 24 deletions
diff --git a/chrome/browser/nacl_host/nacl_process_host.cc b/chrome/browser/nacl_host/nacl_process_host.cc
index eb8b25c..4bfb97e 100644
--- a/chrome/browser/nacl_host/nacl_process_host.cc
+++ b/chrome/browser/nacl_host/nacl_process_host.cc
@@ -910,44 +910,22 @@ bool NaClProcessHost::ReplyToRenderer() {
#endif
}
- const ChildProcessData& data = process_->GetData();
- base::ProcessHandle nacl_process_handle;
#if defined(OS_WIN)
- // Copy the process handle into the renderer process.
- // TODO(mseaborn): Remove this. The renderer process uses this
- // handle with NaCl's handle_pass module, but we are replacing
- // handle_pass with Chrome's BrokerDuplicateHandle() function.
- if (!DuplicateHandle(base::GetCurrentProcessHandle(),
- data.handle,
- chrome_render_message_filter_->peer_handle(),
- &nacl_process_handle,
- PROCESS_DUP_HANDLE,
- FALSE,
- 0)) {
- DLOG(ERROR) << "DuplicateHandle() failed";
- return false;
- }
// If we are on 64-bit Windows, the NaCl process's sandbox is
// managed by a different process from the renderer's sandbox. We
// need to inform the renderer's sandbox about the NaCl process so
// that the renderer can send handles to the NaCl process using
// BrokerDuplicateHandle().
if (RunningOnWOW64()) {
- if (!content::BrokerAddTargetPeer(data.handle)) {
+ if (!content::BrokerAddTargetPeer(process_->GetData().handle)) {
DLOG(ERROR) << "Failed to add NaCl process PID";
return false;
}
}
-#else
- // We use pid as process handle on Posix
- nacl_process_handle = data.handle;
#endif
- // Get the pid of the NaCl process
- base::ProcessId nacl_process_id = base::GetProcId(data.handle);
-
ChromeViewHostMsg_LaunchNaCl::WriteReplyParams(
- reply_msg_, handles_for_renderer, nacl_process_handle, nacl_process_id);
+ reply_msg_, handles_for_renderer);
chrome_render_message_filter_->Send(reply_msg_);
chrome_render_message_filter_ = NULL;
reply_msg_ = NULL;