diff options
35 files changed, 107 insertions, 99 deletions
diff --git a/base/process_util.h b/base/process_util.h index 8045c12..1968f8b 100644 --- a/base/process_util.h +++ b/base/process_util.h @@ -206,9 +206,8 @@ BASE_EXPORT ProcessId GetParentProcessId(ProcessHandle process); BASE_EXPORT void CloseSuperfluousFds(const InjectiveMultimap& saved_map); #endif // defined(OS_POSIX) -// TODO(evan): rename these to use StudlyCaps. -typedef std::vector<std::pair<std::string, std::string> > environment_vector; -typedef std::vector<std::pair<int, int> > file_handle_mapping_vector; +typedef std::vector<std::pair<std::string, std::string> > EnvironmentVector; +typedef std::vector<std::pair<int, int> > FileHandleMappingVector; #if defined(OS_MACOSX) // Used with LaunchOptions::synchronize and LaunchSynchronize, a @@ -267,13 +266,13 @@ struct LaunchOptions { // See documentation of AlterEnvironment(). // This pointer is owned by the caller and must live through the // call to LaunchProcess(). - const environment_vector* environ; + const EnvironmentVector* environ; // If non-NULL, remap file descriptors according to the mapping of // src fd->dest fd to propagate FDs into the child process. // This pointer is owned by the caller and must live through the // call to LaunchProcess(). - const file_handle_mapping_vector* fds_to_remap; + const FileHandleMappingVector* fds_to_remap; // Each element is an RLIMIT_* constant that should be raised to its // rlim_max. This pointer is owned by the caller and must live through @@ -352,7 +351,7 @@ enum IntegrityLevel { // if the system does not support integrity levels (pre-Vista) or in the case // of an underlying system failure. BASE_EXPORT bool GetProcessIntegrityLevel(ProcessHandle process, - IntegrityLevel *level); + IntegrityLevel* level); // Windows-specific LaunchProcess that takes the command line as a // string. Useful for situations where you need to control the @@ -384,7 +383,7 @@ BASE_EXPORT bool LaunchProcess(const std::vector<std::string>& argv, // the second is empty, in which case the key-value is removed. // // The returned array is allocated using new[] and must be freed by the caller. -BASE_EXPORT char** AlterEnvironment(const environment_vector& changes, +BASE_EXPORT char** AlterEnvironment(const EnvironmentVector& changes, const char* const* const env); #if defined(OS_MACOSX) @@ -586,7 +585,7 @@ class BASE_EXPORT ProcessIterator { std::vector<kinfo_proc> kinfo_procs_; size_t index_of_kinfo_proc_; #elif defined(OS_POSIX) - DIR *procfs_dir_; + DIR* procfs_dir_; #endif ProcessEntry entry_; const ProcessFilter* filter_; diff --git a/base/process_util_posix.cc b/base/process_util_posix.cc index 47a53c2..493c7a2 100644 --- a/base/process_util_posix.cc +++ b/base/process_util_posix.cc @@ -415,7 +415,7 @@ void CloseSuperfluousFds(const base::InjectiveMultimap& saved_mapping) { } } -char** AlterEnvironment(const environment_vector& changes, +char** AlterEnvironment(const EnvironmentVector& changes, const char* const* const env) { unsigned count = 0; unsigned size = 0; @@ -427,8 +427,9 @@ char** AlterEnvironment(const environment_vector& changes, size += strlen(pair) + 1 /* terminating NUL */; } - for (environment_vector::const_iterator - j = changes.begin(); j != changes.end(); j++) { + for (EnvironmentVector::const_iterator j = changes.begin(); + j != changes.end(); + ++j) { bool found = false; const char *pair; @@ -478,7 +479,7 @@ char** AlterEnvironment(const environment_vector& changes, } const unsigned keylen = equals - pair; bool handled = false; - for (environment_vector::const_iterator + for (EnvironmentVector::const_iterator j = changes.begin(); j != changes.end(); j++) { if (j->first.size() == keylen && memcmp(j->first.data(), pair, keylen) == 0) { @@ -503,7 +504,7 @@ char** AlterEnvironment(const environment_vector& changes, } // Now handle new elements - for (environment_vector::const_iterator + for (EnvironmentVector::const_iterator j = changes.begin(); j != changes.end(); j++) { if (j->second.empty()) continue; @@ -696,7 +697,7 @@ bool LaunchProcess(const std::vector<std::string>& argv, #endif // defined(OS_CHROMEOS) if (options.fds_to_remap) { - for (file_handle_mapping_vector::const_iterator + for (FileHandleMappingVector::const_iterator it = options.fds_to_remap->begin(); it != options.fds_to_remap->end(); ++it) { fd_shuffle1.push_back(InjectionArc(it->first, it->second, false)); diff --git a/base/process_util_unittest.cc b/base/process_util_unittest.cc index 399f824..5a72f19 100644 --- a/base/process_util_unittest.cc +++ b/base/process_util_unittest.cc @@ -72,7 +72,7 @@ const int kExpectedStillRunningExitCode = 0; // Sleeps until file filename is created. void WaitToDie(const char* filename) { - FILE *fp; + FILE* fp; do { base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(10)); fp = fopen(filename, "r"); @@ -82,7 +82,7 @@ void WaitToDie(const char* filename) { // Signals children they should die now. void SignalChildren(const char* filename) { - FILE *fp = fopen(filename, "w"); + FILE* fp = fopen(filename, "w"); fclose(fp); } @@ -260,7 +260,7 @@ TEST_F(ProcessUtilTest, MAYBE_GetTerminationStatusCrash) { base::EnableInProcessStackDumping(); remove(kSignalFileCrash); } -#endif // !defined(OS_MACOSX) +#endif // !defined(OS_MACOSX) MULTIPROCESS_TEST_MAIN(KilledChildProcess) { WaitToDie(kSignalFileKill); @@ -518,7 +518,7 @@ int ProcessUtilTest::CountOpenFDsInChild() { if (pipe(fds) < 0) NOTREACHED(); - base::file_handle_mapping_vector fd_mapping_vec; + base::FileHandleMappingVector fd_mapping_vec; fd_mapping_vec.push_back(std::pair<int, int>(fds[1], kChildPipe)); base::ProcessHandle handle = this->SpawnChild( "ProcessUtilsLeakFDChildProcess", fd_mapping_vec, false); @@ -564,10 +564,10 @@ TEST_F(ProcessUtilTest, FDRemapping) { namespace { -std::string TestLaunchProcess(const base::environment_vector& env_changes, +std::string TestLaunchProcess(const base::EnvironmentVector& env_changes, const int clone_flags) { std::vector<std::string> args; - base::file_handle_mapping_vector fds_to_remap; + base::FileHandleMappingVector fds_to_remap; args.push_back(kPosixShell); args.push_back("-c"); @@ -610,7 +610,7 @@ const char kLargeString[] = } // namespace TEST_F(ProcessUtilTest, LaunchProcess) { - base::environment_vector env_changes; + base::EnvironmentVector env_changes; const int no_clone_flags = 0; env_changes.push_back(std::make_pair(std::string("BASE_TEST"), @@ -649,7 +649,7 @@ TEST_F(ProcessUtilTest, LaunchProcess) { TEST_F(ProcessUtilTest, AlterEnvironment) { const char* const empty[] = { NULL }; const char* const a2[] = { "A=2", NULL }; - base::environment_vector changes; + base::EnvironmentVector changes; char** e; e = base::AlterEnvironment(changes, empty); diff --git a/base/test/multiprocess_test.cc b/base/test/multiprocess_test.cc index 97f335c..b0773ae 100644 --- a/base/test/multiprocess_test.cc +++ b/base/test/multiprocess_test.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 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. @@ -7,11 +7,6 @@ #include "base/base_switches.h" #include "base/command_line.h" -#if defined(OS_POSIX) -#include <sys/types.h> -#include <unistd.h> -#endif - namespace base { MultiProcessTest::MultiProcessTest() { @@ -19,14 +14,14 @@ MultiProcessTest::MultiProcessTest() { ProcessHandle MultiProcessTest::SpawnChild(const std::string& procname, bool debug_on_start) { - file_handle_mapping_vector empty_file_list; + FileHandleMappingVector empty_file_list; return SpawnChildImpl(procname, empty_file_list, debug_on_start); } #if defined(OS_POSIX) ProcessHandle MultiProcessTest::SpawnChild( const std::string& procname, - const file_handle_mapping_vector& fds_to_map, + const FileHandleMappingVector& fds_to_map, bool debug_on_start) { return SpawnChildImpl(procname, fds_to_map, debug_on_start); } @@ -43,7 +38,7 @@ CommandLine MultiProcessTest::MakeCmdLine(const std::string& procname, ProcessHandle MultiProcessTest::SpawnChildImpl( const std::string& procname, - const file_handle_mapping_vector& fds_to_map, + const FileHandleMappingVector& fds_to_map, bool debug_on_start) { ProcessHandle handle = kNullProcessHandle; base::LaunchOptions options; diff --git a/base/test/multiprocess_test.h b/base/test/multiprocess_test.h index bfb9e2a..88f6b2a 100644 --- a/base/test/multiprocess_test.h +++ b/base/test/multiprocess_test.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 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. @@ -62,7 +62,7 @@ class MultiProcessTest : public PlatformTest { // SpawnChild() should just take a base::LaunchOptions so that we don't // need multiple versions of it. ProcessHandle SpawnChild(const std::string& procname, - const file_handle_mapping_vector& fds_to_map, + const FileHandleMappingVector& fds_to_map, bool debug_on_start); #endif @@ -75,7 +75,7 @@ class MultiProcessTest : public PlatformTest { // TODO: |fds_to_map| is unused on Windows; see above TODO about // further refactoring. ProcessHandle SpawnChildImpl(const std::string& procname, - const file_handle_mapping_vector& fds_to_map, + const FileHandleMappingVector& fds_to_map, bool debug_on_start); DISALLOW_COPY_AND_ASSIGN(MultiProcessTest); diff --git a/chrome/app/nacl_fork_delegate_linux.cc b/chrome/app/nacl_fork_delegate_linux.cc index 937f690..5ea4dd8 100644 --- a/chrome/app/nacl_fork_delegate_linux.cc +++ b/chrome/app/nacl_fork_delegate_linux.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 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. @@ -9,6 +9,8 @@ #include <sys/resource.h> #include <sys/socket.h> +#include <set> + #include "base/basictypes.h" #include "base/command_line.h" #include "base/eintr_wrapper.h" @@ -47,7 +49,7 @@ void NaClForkDelegate::Init(const bool sandboxed, DCHECK(kNaClSandboxDescriptor == sandboxdesc); CHECK(socketpair(PF_UNIX, SOCK_SEQPACKET, 0, fds) == 0); - base::file_handle_mapping_vector fds_to_map; + base::FileHandleMappingVector fds_to_map; fds_to_map.push_back(std::make_pair(fds[1], kNaClZygoteDescriptor)); fds_to_map.push_back(std::make_pair(sandboxdesc, kNaClSandboxDescriptor)); diff --git a/chrome/app/nacl_fork_delegate_linux.h b/chrome/app/nacl_fork_delegate_linux.h index 853df09..24fe658 100644 --- a/chrome/app/nacl_fork_delegate_linux.h +++ b/chrome/app/nacl_fork_delegate_linux.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 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. @@ -6,6 +6,9 @@ #define CHROME_APP_NACL_FORK_DELEGATE_LINUX_H_ #pragma once +#include <string> +#include <vector> + #include "base/basictypes.h" #include "base/compiler_specific.h" #include "content/public/common/zygote_fork_delegate_linux.h" diff --git a/chrome/browser/chromeos/process_proxy/process_proxy.cc b/chrome/browser/chromeos/process_proxy/process_proxy.cc index a5b3ac9..436eb5b 100644 --- a/chrome/browser/chromeos/process_proxy/process_proxy.cc +++ b/chrome/browser/chromeos/process_proxy/process_proxy.cc @@ -4,7 +4,6 @@ #include "chrome/browser/chromeos/process_proxy/process_proxy.h" -#include <cstdio> #include <fcntl.h> #include <stdlib.h> #include <sys/ioctl.h> @@ -120,8 +119,8 @@ void ProcessProxy::OnProcessOutput(ProcessOutputType type, } bool ProcessProxy::StopWatching() { - if (!watcher_started_) - return true; + if (!watcher_started_) + return true; // Signal Watcher that we are done. We use self-pipe trick to unblock watcher. // Anything may be written to the pipe. const char message[] = "q"; @@ -207,9 +206,9 @@ bool ProcessProxy::CreatePseudoTerminalPair(int *pt_pair) { } bool ProcessProxy::LaunchProcess(const std::string& command, int slave_fd, - pid_t *pid) { + pid_t* pid) { // Redirect crosh process' output and input so we can read it. - base::file_handle_mapping_vector fds_mapping; + base::FileHandleMappingVector fds_mapping; fds_mapping.push_back(std::make_pair(slave_fd, STDIN_FILENO)); fds_mapping.push_back(std::make_pair(slave_fd, STDOUT_FILENO)); fds_mapping.push_back(std::make_pair(slave_fd, STDERR_FILENO)); diff --git a/chrome/browser/chromeos/process_proxy/process_proxy.h b/chrome/browser/chromeos/process_proxy/process_proxy.h index fb50655..d47fa2f 100644 --- a/chrome/browser/chromeos/process_proxy/process_proxy.h +++ b/chrome/browser/chromeos/process_proxy/process_proxy.h @@ -6,10 +6,12 @@ #define CHROME_BROWSER_CHROMEOS_PROCESS_PROXY_PROCESS_PROXY_H_ #pragma once -#include <cstdio> #include <fcntl.h> #include <signal.h> +#include <cstdio> +#include <string> + #include "base/memory/ref_counted.h" #include "chrome/browser/chromeos/process_proxy/process_output_watcher.h" diff --git a/chrome/browser/importer/external_process_importer_client.cc b/chrome/browser/importer/external_process_importer_client.cc index 9fb5485..c20229b 100644 --- a/chrome/browser/importer/external_process_importer_client.cc +++ b/chrome/browser/importer/external_process_importer_client.cc @@ -81,7 +81,7 @@ void ExternalProcessImporterClient::StartProcessOnIOThread( utility_process_host_->DisableSandbox(); #if defined(OS_MACOSX) - base::environment_vector env; + base::EnvironmentVector env; std::string dylib_path = GetFirefoxDylibPath().value(); if (!dylib_path.empty()) env.push_back(std::make_pair("DYLD_FALLBACK_LIBRARY_PATH", dylib_path)); diff --git a/chrome/browser/importer/firefox_importer_unittest_utils_mac.cc b/chrome/browser/importer/firefox_importer_unittest_utils_mac.cc index 9f74a23..8facec5 100644 --- a/chrome/browser/importer/firefox_importer_unittest_utils_mac.cc +++ b/chrome/browser/importer/firefox_importer_unittest_utils_mac.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 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. @@ -39,7 +39,7 @@ bool LaunchNSSDecrypterChildProcess(const FilePath& nss_path, // Set env variable needed for FF encryption libs to load. // See "chrome/browser/importer/nss_decryptor_mac.mm" for an explanation of // why we need this. - base::environment_vector env; + base::EnvironmentVector env; std::pair<std::string, std::string> dyld_override; dyld_override.first = "DYLD_FALLBACK_LIBRARY_PATH"; dyld_override.second = nss_path.value(); @@ -50,7 +50,7 @@ bool LaunchNSSDecrypterChildProcess(const FilePath& nss_path, return false; file_util::ScopedFD client_file_descriptor_closer(&ipcfd); - base::file_handle_mapping_vector fds_to_map; + base::FileHandleMappingVector fds_to_map; fds_to_map.push_back(std::pair<int,int>(ipcfd, kPrimaryIPCChannel + 3)); bool debug_on_start = CommandLine::ForCurrentProcess()->HasSwitch( diff --git a/chrome/browser/mac/relauncher.cc b/chrome/browser/mac/relauncher.cc index 138ab17..aaaacb9 100644 --- a/chrome/browser/mac/relauncher.cc +++ b/chrome/browser/mac/relauncher.cc @@ -151,7 +151,7 @@ bool RelaunchAppWithHelper(const std::string& helper, kRelauncherSyncFD != STDERR_FILENO, kRelauncherSyncFD_must_not_conflict_with_stdio_fds); - base::file_handle_mapping_vector fd_map; + base::FileHandleMappingVector fd_map; fd_map.push_back(std::make_pair(*pipe_write_fd, kRelauncherSyncFD)); base::LaunchOptions options; diff --git a/chrome/browser/nacl_host/nacl_process_host.cc b/chrome/browser/nacl_host/nacl_process_host.cc index 88bd946..baa6904 100644 --- a/chrome/browser/nacl_host/nacl_process_host.cc +++ b/chrome/browser/nacl_host/nacl_process_host.cc @@ -2,13 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "build/build_config.h" - #include "chrome/browser/nacl_host/nacl_process_host.h" -#if defined(OS_POSIX) -#include <fcntl.h> -#endif +#include <string> +#include <vector> #include "base/bind.h" #include "base/command_line.h" @@ -17,6 +14,7 @@ #include "base/stringprintf.h" #include "base/utf_string_conversions.h" #include "base/win/windows_version.h" +#include "build/build_config.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/logging_chrome.h" @@ -31,13 +29,16 @@ #include "native_client/src/shared/imc/nacl_imc.h" #if defined(OS_POSIX) +#include <fcntl.h> + #include "ipc/ipc_channel_posix.h" #elif defined(OS_WIN) +#include <windows.h> + #include "base/threading/thread.h" #include "base/process_util.h" #include "chrome/browser/nacl_host/nacl_broker_service_win.h" #include "native_client/src/trusted/service_runtime/win/debug_exception_handler.h" -#include <windows.h> #endif using content::BrowserThread; @@ -413,7 +414,7 @@ bool NaClProcessHost::LaunchSelLdr() { } #elif defined(OS_POSIX) process_->Launch(nacl_loader_prefix.empty(), // use_zygote - base::environment_vector(), + base::EnvironmentVector(), cmd_line); #endif diff --git a/chrome/browser/platform_util_linux.cc b/chrome/browser/platform_util_linux.cc index f003769..2bc84cb 100644 --- a/chrome/browser/platform_util_linux.cc +++ b/chrome/browser/platform_util_linux.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 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. @@ -20,7 +20,7 @@ void XDGUtil(const std::string& util, const std::string& arg) { argv.push_back(util); argv.push_back(arg); - base::environment_vector env; + base::EnvironmentVector env; // xdg-open can fall back on mailcap which eventually might plumb through // to a command that needs a terminal. Set the environment variable telling // it that we definitely don't have a terminal available and that it should diff --git a/chrome/browser/printing/cloud_print/test/cloud_print_proxy_process_browsertest.cc b/chrome/browser/printing/cloud_print/test/cloud_print_proxy_process_browsertest.cc index b567d76..83dc857 100644 --- a/chrome/browser/printing/cloud_print/test/cloud_print_proxy_process_browsertest.cc +++ b/chrome/browser/printing/cloud_print/test/cloud_print_proxy_process_browsertest.cc @@ -390,7 +390,7 @@ base::ProcessHandle CloudPrintProxyPolicyStartupTest::Launch( this, IOMessageLoopProxy())); #if defined(OS_POSIX) - base::file_handle_mapping_vector ipc_file_list; + base::FileHandleMappingVector ipc_file_list; ipc_file_list.push_back(std::make_pair( startup_channel_->TakeClientFileDescriptor(), kPrimaryIPCChannel + base::GlobalDescriptors::kBaseDescriptor)); diff --git a/chrome/browser/process_info_snapshot_mac_unittest.cc b/chrome/browser/process_info_snapshot_mac_unittest.cc index 0ddbda4..ec44a83 100644 --- a/chrome/browser/process_info_snapshot_mac_unittest.cc +++ b/chrome/browser/process_info_snapshot_mac_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 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. @@ -99,7 +99,7 @@ TEST_F(ProcessInfoSnapshotMacTest, EffectiveVsRealUserIDTest) { // Create a pipe to be able to read top's output. int fds[2]; PCHECK(pipe(fds) == 0); - base::file_handle_mapping_vector fds_to_remap; + base::FileHandleMappingVector fds_to_remap; fds_to_remap.push_back(std::make_pair(fds[1], 1)); // Hook up top's stderr to the test process' stderr. diff --git a/chrome/browser/shell_integration_linux.cc b/chrome/browser/shell_integration_linux.cc index d74cf87..574bd09 100644 --- a/chrome/browser/shell_integration_linux.cc +++ b/chrome/browser/shell_integration_linux.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 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. @@ -55,7 +55,7 @@ bool LaunchXdgUtility(const std::vector<std::string>& argv, int* exit_code) { int devnull = open("/dev/null", O_RDONLY); if (devnull < 0) return false; - base::file_handle_mapping_vector no_stdin; + base::FileHandleMappingVector no_stdin; no_stdin.push_back(std::make_pair(devnull, STDIN_FILENO)); base::ProcessHandle handle; diff --git a/chrome/test/automation/proxy_launcher.cc b/chrome/test/automation/proxy_launcher.cc index 434dec24..088636d 100644 --- a/chrome/test/automation/proxy_launcher.cc +++ b/chrome/test/automation/proxy_launcher.cc @@ -4,6 +4,8 @@ #include "chrome/test/automation/proxy_launcher.h" +#include <vector> + #include "base/environment.h" #include "base/file_util.h" #include "base/string_number_conversions.h" @@ -476,7 +478,7 @@ bool ProxyLauncher::LaunchBrowserHelper(const LaunchState& state, #elif defined(OS_POSIX) int ipcfd = -1; file_util::ScopedFD ipcfd_closer(&ipcfd); - base::file_handle_mapping_vector fds; + base::FileHandleMappingVector fds; if (main_launch && automation_proxy_.get()) { ipcfd = automation_proxy_->channel()->TakeClientFileDescriptor(); fds.push_back(std::make_pair(ipcfd, kPrimaryIPCChannel + 3)); diff --git a/content/browser/browser_child_process_host_impl.cc b/content/browser/browser_child_process_host_impl.cc index 9363593..489d2fb 100644 --- a/content/browser/browser_child_process_host_impl.cc +++ b/content/browser/browser_child_process_host_impl.cc @@ -30,8 +30,6 @@ #if defined(OS_WIN) #include "base/synchronization/waitable_event.h" -#else -#include "base/bind.h" #endif using content::BrowserChildProcessHostDelegate; @@ -107,7 +105,7 @@ void BrowserChildProcessHostImpl::Launch( const FilePath& exposed_dir, #elif defined(OS_POSIX) bool use_zygote, - const base::environment_vector& environ, + const base::EnvironmentVector& environ, #endif CommandLine* cmd_line) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); diff --git a/content/browser/browser_child_process_host_impl.h b/content/browser/browser_child_process_host_impl.h index f9c2acd..a405aca 100644 --- a/content/browser/browser_child_process_host_impl.h +++ b/content/browser/browser_child_process_host_impl.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 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. @@ -47,7 +47,7 @@ class CONTENT_EXPORT BrowserChildProcessHostImpl : const FilePath& exposed_dir, #elif defined(OS_POSIX) bool use_zygote, - const base::environment_vector& environ, + const base::EnvironmentVector& environ, #endif CommandLine* cmd_line) OVERRIDE; virtual const content::ChildProcessData& GetData() const OVERRIDE; diff --git a/content/browser/child_process_launcher.cc b/content/browser/child_process_launcher.cc index d207f53..ec17d61 100644 --- a/content/browser/child_process_launcher.cc +++ b/content/browser/child_process_launcher.cc @@ -61,7 +61,7 @@ class ChildProcessLauncher::Context const FilePath& exposed_dir, #elif defined(OS_POSIX) bool use_zygote, - const base::environment_vector& environ, + const base::EnvironmentVector& environ, int ipcfd, #endif CommandLine* cmd_line, @@ -113,7 +113,7 @@ class ChildProcessLauncher::Context const FilePath& exposed_dir, #elif defined(OS_POSIX) bool use_zygote, - const base::environment_vector& env, + const base::EnvironmentVector& env, int ipcfd, #endif CommandLine* cmd_line) { @@ -147,7 +147,7 @@ class ChildProcessLauncher::Context // Fall through to the normal posix case below when we're not zygoting. #endif { - base::file_handle_mapping_vector fds_to_map; + base::FileHandleMappingVector fds_to_map; fds_to_map.push_back(std::make_pair( ipcfd, kPrimaryIPCChannel + base::GlobalDescriptors::kBaseDescriptor)); @@ -307,7 +307,7 @@ ChildProcessLauncher::ChildProcessLauncher( const FilePath& exposed_dir, #elif defined(OS_POSIX) bool use_zygote, - const base::environment_vector& environ, + const base::EnvironmentVector& environ, int ipcfd, #endif CommandLine* cmd_line, diff --git a/content/browser/child_process_launcher.h b/content/browser/child_process_launcher.h index 9cd12e7..dd0a4dc 100644 --- a/content/browser/child_process_launcher.h +++ b/content/browser/child_process_launcher.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 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. @@ -38,7 +38,7 @@ class CONTENT_EXPORT ChildProcessLauncher { const FilePath& exposed_dir, #elif defined(OS_POSIX) bool use_zygote, - const base::environment_vector& environ, + const base::EnvironmentVector& environ, int ipcfd, #endif CommandLine* cmd_line, diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc index 942217d..4870a97 100644 --- a/content/browser/gpu/gpu_process_host.cc +++ b/content/browser/gpu/gpu_process_host.cc @@ -201,7 +201,7 @@ GpuProcessHost* GpuProcessHost::GetForClient( // this will be extended to allow the use of multiple GPU processes. for (IDMap<GpuProcessHost>::iterator it(g_hosts_by_id.Pointer()); !it.IsAtEnd(); it.Advance()) { - GpuProcessHost *host = it.GetCurrentValue(); + GpuProcessHost* host = it.GetCurrentValue(); if (host->sandboxed() != (client_id != 0)) continue; @@ -245,7 +245,7 @@ GpuProcessHost* GpuProcessHost::FromID(int host_id) { if (host_id == 0) return NULL; - GpuProcessHost *host = g_hosts_by_id.Pointer()->Lookup(host_id); + GpuProcessHost* host = g_hosts_by_id.Pointer()->Lookup(host_id); if (HostIsValid(host)) return host; @@ -366,8 +366,9 @@ bool GpuProcessHost::Init() { in_process_gpu_thread_->StartWithOptions(options); OnProcessLaunched(); // Fake a callback that the process is ready. - } else if (!LaunchGpuProcess(channel_id)) + } else if (!LaunchGpuProcess(channel_id)) { return false; + } return Send(new GpuMsg_Initialize()); } @@ -662,7 +663,7 @@ bool GpuProcessHost::LaunchGpuProcess(const std::string& channel_id) { FilePath(), #elif defined(OS_POSIX) false, // Never use the zygote (GPU plugin can't be sandboxed). - base::environment_vector(), + base::EnvironmentVector(), #endif cmd_line); process_launched_ = true; diff --git a/content/browser/gpu/gpu_process_host.h b/content/browser/gpu/gpu_process_host.h index 6fc6e94..e362cee 100644 --- a/content/browser/gpu/gpu_process_host.h +++ b/content/browser/gpu/gpu_process_host.h @@ -8,6 +8,7 @@ #include <map> #include <queue> +#include <string> #include "base/callback.h" #include "base/memory/linked_ptr.h" diff --git a/content/browser/plugin_process_host.cc b/content/browser/plugin_process_host.cc index 7ea6326..5bb447a 100644 --- a/content/browser/plugin_process_host.cc +++ b/content/browser/plugin_process_host.cc @@ -254,7 +254,7 @@ bool PluginProcessHost::Init(const webkit::WebPluginInfo& info) { cmd_line->AppendSwitchASCII(switches::kProcessChannelID, channel_id); #if defined(OS_POSIX) - base::environment_vector env; + base::EnvironmentVector env; #if defined(OS_MACOSX) && !defined(__LP64__) // Add our interposing library for Carbon. This is stripped back out in // plugin_main.cc, so changes here should be reflected there. diff --git a/content/browser/ppapi_plugin_process_host.cc b/content/browser/ppapi_plugin_process_host.cc index 92f87e7..012536f 100644 --- a/content/browser/ppapi_plugin_process_host.cc +++ b/content/browser/ppapi_plugin_process_host.cc @@ -4,6 +4,8 @@ #include "content/browser/ppapi_plugin_process_host.h" +#include <string> + #include "base/base_switches.h" #include "base/command_line.h" #include "base/file_path.h" @@ -70,7 +72,7 @@ PpapiPluginProcessHost* PpapiPluginProcessHost::CreatePluginHost( net::HostResolver* host_resolver) { PpapiPluginProcessHost* plugin_host = new PpapiPluginProcessHost(host_resolver); - if(plugin_host->Init(info)) + if (plugin_host->Init(info)) return plugin_host; NOTREACHED(); // Init is not expected to fail. @@ -81,7 +83,7 @@ PpapiPluginProcessHost* PpapiPluginProcessHost::CreateBrokerHost( const content::PepperPluginInfo& info) { PpapiPluginProcessHost* plugin_host = new PpapiPluginProcessHost(); - if(plugin_host->Init(info)) + if (plugin_host->Init(info)) return plugin_host; NOTREACHED(); // Init is not expected to fail. @@ -189,7 +191,7 @@ bool PpapiPluginProcessHost::Init(const content::PepperPluginInfo& info) { FilePath(), #elif defined(OS_POSIX) use_zygote, - base::environment_vector(), + base::EnvironmentVector(), #endif cmd_line); return true; diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc index 2cbe582..416f68d 100644 --- a/content/browser/renderer_host/render_process_host_impl.cc +++ b/content/browser/renderer_host/render_process_host_impl.cc @@ -431,7 +431,7 @@ bool RenderProcessHostImpl::Init(bool is_accessibility_enabled) { FilePath(), #elif defined(OS_POSIX) renderer_prefix.empty(), - base::environment_vector(), + base::EnvironmentVector(), channel_->TakeClientFileDescriptor(), #endif cmd_line, diff --git a/content/browser/utility_process_host_impl.cc b/content/browser/utility_process_host_impl.cc index 792dba1..347e6c5 100644 --- a/content/browser/utility_process_host_impl.cc +++ b/content/browser/utility_process_host_impl.cc @@ -31,7 +31,7 @@ UtilityProcessHost* UtilityProcessHost::Create( return new UtilityProcessHostImpl(client, client_thread_id); } -} +} // namespace content UtilityProcessHostImpl::UtilityProcessHostImpl( UtilityProcessHostClient* client, @@ -90,7 +90,7 @@ void UtilityProcessHostImpl::EnableZygote() { #if defined(OS_POSIX) -void UtilityProcessHostImpl::SetEnv(const base::environment_vector& env) { +void UtilityProcessHostImpl::SetEnv(const base::EnvironmentVector& env) { env_ = env; } diff --git a/content/browser/utility_process_host_impl.h b/content/browser/utility_process_host_impl.h index 46a4ecd..49664e0 100644 --- a/content/browser/utility_process_host_impl.h +++ b/content/browser/utility_process_host_impl.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CONTENT_BROWSER_UTILITY_PROCESS_HOST_H_ -#define CONTENT_BROWSER_UTILITY_PROCESS_HOST_H_ +#ifndef CONTENT_BROWSER_UTILITY_PROCESS_HOST_IMPL_H_ +#define CONTENT_BROWSER_UTILITY_PROCESS_HOST_IMPL_H_ #pragma once #include <string> @@ -34,7 +34,7 @@ class CONTENT_EXPORT UtilityProcessHostImpl virtual void DisableSandbox() OVERRIDE; virtual void EnableZygote() OVERRIDE; #if defined(OS_POSIX) - virtual void SetEnv(const base::environment_vector& env) OVERRIDE; + virtual void SetEnv(const base::EnvironmentVector& env) OVERRIDE; #endif void set_child_flags(int flags) { child_flags_ = flags; } @@ -66,7 +66,7 @@ class CONTENT_EXPORT UtilityProcessHostImpl // Launch the utility process from the zygote. Defaults to false. bool use_linux_zygote_; - base::environment_vector env_; + base::EnvironmentVector env_; bool started_; @@ -75,4 +75,4 @@ class CONTENT_EXPORT UtilityProcessHostImpl DISALLOW_COPY_AND_ASSIGN(UtilityProcessHostImpl); }; -#endif // CONTENT_BROWSER_UTILITY_PROCESS_HOST_H_ +#endif // CONTENT_BROWSER_UTILITY_PROCESS_HOST_IMPL_H_ diff --git a/content/browser/worker_host/worker_process_host.cc b/content/browser/worker_host/worker_process_host.cc index c9d3757..ec4cd08 100644 --- a/content/browser/worker_host/worker_process_host.cc +++ b/content/browser/worker_host/worker_process_host.cc @@ -5,6 +5,7 @@ #include "content/browser/worker_host/worker_process_host.h" #include <set> +#include <string> #include <vector> #include "base/base_switches.h" @@ -192,7 +193,7 @@ bool WorkerProcessHost::Init(int render_process_id) { FilePath(), #elif defined(OS_POSIX) use_zygote, - base::environment_vector(), + base::EnvironmentVector(), #endif cmd_line); diff --git a/content/browser/zygote_host_linux.cc b/content/browser/zygote_host_linux.cc index a7671e3..657f256 100644 --- a/content/browser/zygote_host_linux.cc +++ b/content/browser/zygote_host_linux.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 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. @@ -95,7 +95,7 @@ void ZygoteHost::Init(const std::string& sandbox_cmd) { #else CHECK(socketpair(PF_UNIX, SOCK_SEQPACKET, 0, fds) == 0); #endif - base::file_handle_mapping_vector fds_to_map; + base::FileHandleMappingVector fds_to_map; fds_to_map.push_back(std::make_pair(fds[1], 3)); const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); @@ -273,7 +273,7 @@ pid_t ZygoteHost::ForkRequest( const ssize_t len = ReadReply(buf, sizeof(buf)); Pickle reply_pickle(buf, len); - void *iter = NULL; + void* iter = NULL; if (len <= 0 || !reply_pickle.ReadInt(&iter, &pid)) return base::kNullProcessHandle; diff --git a/content/public/browser/browser_child_process_host.h b/content/public/browser/browser_child_process_host.h index e4b6da3..02f1e96 100644 --- a/content/public/browser/browser_child_process_host.h +++ b/content/public/browser/browser_child_process_host.h @@ -39,7 +39,7 @@ class CONTENT_EXPORT BrowserChildProcessHost : public IPC::Message::Sender { const FilePath& exposed_dir, #elif defined(OS_POSIX) bool use_zygote, - const base::environment_vector& environ, + const base::EnvironmentVector& environ, #endif CommandLine* cmd_line) = 0; diff --git a/content/public/browser/utility_process_host.h b/content/public/browser/utility_process_host.h index 5320818..5b10b32 100644 --- a/content/public/browser/utility_process_host.h +++ b/content/public/browser/utility_process_host.h @@ -57,7 +57,7 @@ class UtilityProcessHost : public IPC::Message::Sender, virtual void EnableZygote() = 0; #if defined(OS_POSIX) - virtual void SetEnv(const base::environment_vector& env) = 0; + virtual void SetEnv(const base::EnvironmentVector& env) = 0; #endif }; diff --git a/ipc/ipc_tests.cc b/ipc/ipc_tests.cc index 2a78f44..8b22fc3 100644 --- a/ipc/ipc_tests.cc +++ b/ipc/ipc_tests.cc @@ -84,7 +84,7 @@ base::ProcessHandle IPCChannelTest::SpawnChild(ChildType child_type, bool debug_on_start = CommandLine::ForCurrentProcess()->HasSwitch(switches::kDebugChildren); - base::file_handle_mapping_vector fds_to_map; + base::FileHandleMappingVector fds_to_map; const int ipcfd = channel->GetClientFileDescriptor(); if (ipcfd > -1) { fds_to_map.push_back(std::pair<int, int>(ipcfd, kPrimaryIPCChannel + 3)); @@ -301,7 +301,7 @@ TEST_F(IPCChannelTest, ChannelProxyTest) { #elif defined(OS_POSIX) bool debug_on_start = CommandLine::ForCurrentProcess()->HasSwitch( switches::kDebugChildren); - base::file_handle_mapping_vector fds_to_map; + base::FileHandleMappingVector fds_to_map; const int ipcfd = chan.GetClientFileDescriptor(); if (ipcfd > -1) { fds_to_map.push_back(std::pair<int, int>(ipcfd, kPrimaryIPCChannel + 3)); @@ -466,6 +466,7 @@ class ChannelReflectorListener : public IPC::Channel::Listener { channel_->Send(msg); return true; } + private: IPC::Channel *channel_; int count_messages_; diff --git a/net/test/test_server_posix.cc b/net/test/test_server_posix.cc index aef7b0c..f15acc3 100644 --- a/net/test/test_server_posix.cc +++ b/net/test/test_server_posix.cc @@ -109,7 +109,7 @@ bool TestServer::LaunchPython(const FilePath& testserver_path) { child_fd_ = pipefd[0]; child_fd_closer_.reset(&child_fd_); file_util::ScopedFD write_closer(&pipefd[1]); - base::file_handle_mapping_vector map_write_fd; + base::FileHandleMappingVector map_write_fd; map_write_fd.push_back(std::make_pair(pipefd[1], pipefd[1])); python_command.AppendArg("--startup-pipe=" + base::IntToString(pipefd[1])); |