diff options
author | gregoryd@google.com <gregoryd@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-30 00:29:54 +0000 |
---|---|---|
committer | gregoryd@google.com <gregoryd@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-30 00:29:54 +0000 |
commit | 0b6e0a2ba1c90550d2dc4e33e2d0d282e09ebfdb (patch) | |
tree | 7e0c2f17e82dd477294d26a51051bee13c4dc5bb /chrome/nacl/broker_thread.cc | |
parent | 732a0f086db4bfdfd29749c3a500af0405934b6f (diff) | |
download | chromium_src-0b6e0a2ba1c90550d2dc4e33e2d0d282e09ebfdb.zip chromium_src-0b6e0a2ba1c90550d2dc4e33e2d0d282e09ebfdb.tar.gz chromium_src-0b6e0a2ba1c90550d2dc4e33e2d0d282e09ebfdb.tar.bz2 |
Revert 37578 - Implement the broker process that launches NaCl loader processes on 64bit Windows systems.
BUG=28176
TEST=none
Review URL: http://codereview.chromium.org/542030
TBR=gregoryd@google.com
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37580 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/nacl/broker_thread.cc')
-rw-r--r-- | chrome/nacl/broker_thread.cc | 72 |
1 files changed, 0 insertions, 72 deletions
diff --git a/chrome/nacl/broker_thread.cc b/chrome/nacl/broker_thread.cc deleted file mode 100644 index 0b4bbd2..0000000 --- a/chrome/nacl/broker_thread.cc +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/nacl/broker_thread.h" - -#include "base/base_switches.h" -#include "base/command_line.h" -#include "base/path_service.h" -#include "base/process_util.h" -#include "chrome/common/sandbox_policy.h" -#include "chrome/common/chrome_switches.h" -#include "chrome/common/nacl_cmd_line.h" -#include "chrome/common/nacl_messages.h" -#include "ipc/ipc_switches.h" - -NaClBrokerThread::NaClBrokerThread() - : browser_handle_(0), - broker_services_(NULL) { -} - -NaClBrokerThread::~NaClBrokerThread() { - base::CloseProcessHandle(browser_handle_); -} - -NaClBrokerThread* NaClBrokerThread::current() { - return static_cast<NaClBrokerThread*>(ChildThread::current()); -} - -void NaClBrokerThread::OnControlMessageReceived(const IPC::Message& msg) { - IPC_BEGIN_MESSAGE_MAP(NaClBrokerThread, msg) - IPC_MESSAGE_HANDLER(NaClProcessMsg_LaunchLoaderThroughBroker, - OnLaunchLoaderThroughBroker) - IPC_END_MESSAGE_MAP() -} - -void NaClBrokerThread::OnLaunchLoaderThroughBroker( - const std::wstring& loader_channel_id) { - base::ProcessHandle loader_process = 0; - base::ProcessHandle loader_handle_in_browser = 0; - - // Create the path to the nacl broker/loader executable - it's the executable - // this code is running in. - FilePath exe_path; - PathService::Get(base::FILE_EXE, &exe_path); - if (!exe_path.empty()) { - CommandLine* cmd_line = new CommandLine(exe_path); - nacl::CopyNaClCommandLineArguments(cmd_line); - - cmd_line->AppendSwitchWithValue(switches::kProcessType, - switches::kNaClLoaderProcess); - - cmd_line->AppendSwitchWithValue(switches::kProcessChannelID, - loader_channel_id); - - loader_process = sandbox::StartProcessWithAccess(cmd_line, FilePath()); - if (loader_process) { - DuplicateHandle(::GetCurrentProcess(), loader_process, - browser_handle_, &loader_handle_in_browser, - PROCESS_DUP_HANDLE, FALSE, 0); - } - } - Send(new NaClProcessMsg_LoaderLaunched(loader_channel_id, - loader_handle_in_browser)); -} - -void NaClBrokerThread::OnChannelConnected(int32 peer_pid) { - bool res = base::OpenProcessHandle(peer_pid, &browser_handle_); - DCHECK(res); - Send(new NaClProcessMsg_BrokerReady()); -} - |