Skip to content

Commit

Permalink
Use base::GlobalDescriptors::kBaseDescriptor instead of magic number 3.
Browse files Browse the repository at this point in the history
Review URL: https://chromiumcodereview.appspot.com/23814006

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@221809 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
dongseong.hwang@intel.com committed Sep 6, 2013
1 parent 3b5c3f1 commit 2862eeb
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
4 changes: 3 additions & 1 deletion chrome/test/automation/proxy_launcher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@

#if defined(OS_POSIX)
#include <signal.h>
#include "base/posix/global_descriptors.h"
#endif

namespace {
Expand Down Expand Up @@ -503,7 +504,8 @@ bool ProxyLauncher::LaunchBrowserHelper(const LaunchState& state,
base::FileHandleMappingVector fds;
if (main_launch && automation_proxy_.get()) {
ipcfd = automation_proxy_->channel()->TakeClientFileDescriptor();
fds.push_back(std::make_pair(ipcfd, kPrimaryIPCChannel + 3));
fds.push_back(std::make_pair(ipcfd,
kPrimaryIPCChannel + base::GlobalDescriptors::kBaseDescriptor));
options.fds_to_remap = &fds;
}
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "base/file_util.h"
#include "base/files/file_path.h"
#include "base/message_loop/message_loop.h"
#include "base/posix/global_descriptors.h"
#include "base/process/kill.h"
#include "base/process/launch.h"
#include "base/test/test_timeouts.h"
Expand Down Expand Up @@ -52,7 +53,8 @@ bool LaunchNSSDecrypterChildProcess(const base::FilePath& nss_path,

file_util::ScopedFD client_file_descriptor_closer(&ipcfd);
base::FileHandleMappingVector fds_to_map;
fds_to_map.push_back(std::pair<int,int>(ipcfd, kPrimaryIPCChannel + 3));
fds_to_map.push_back(std::pair<int,int>(ipcfd,
kPrimaryIPCChannel + base::GlobalDescriptors::kBaseDescriptor));

bool debug_on_start = CommandLine::ForCurrentProcess()->HasSwitch(
switches::kDebugChildren);
Expand Down
7 changes: 6 additions & 1 deletion ipc/ipc_test_base.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
#include "ipc/ipc_descriptors.h"
#include "ipc/ipc_switches.h"

#if defined(OS_POSIX)
#include "base/posix/global_descriptors.h"
#endif

// static
std::string IPCTestBase::GetChannelName(const std::string& test_client_name) {
DCHECK(!test_client_name.empty());
Expand Down Expand Up @@ -102,7 +106,8 @@ bool IPCTestBase::StartClient() {
const int ipcfd = channel_.get() ? channel_->GetClientFileDescriptor() :
channel_proxy_->GetClientFileDescriptor();
if (ipcfd > -1)
fds_to_map.push_back(std::pair<int, int>(ipcfd, kPrimaryIPCChannel + 3));
fds_to_map.push_back(std::pair<int, int>(ipcfd,
kPrimaryIPCChannel + base::GlobalDescriptors::kBaseDescriptor));

client_process_ = MultiProcessTest::SpawnChild(test_main,
fds_to_map,
Expand Down

0 comments on commit 2862eeb

Please sign in to comment.