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

Unified Diff: base/process_util_posix.cc

Issue 1689012: Move common code into process_util.cc (Closed)
Patch Set: More fixes Created 10 years, 8 months 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 | « base/process_util_mac.mm ('k') | base/process_util_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/process_util_posix.cc
diff --git a/base/process_util_posix.cc b/base/process_util_posix.cc
index 0deb2f296339e5e4d78f069244598e40ba4bace6..17a461d90db88481e5a5b6c6970a808f40d9dd0d 100644
--- a/base/process_util_posix.cc
+++ b/base/process_util_posix.cc
@@ -25,7 +25,6 @@
#include "base/process_util.h"
#include "base/rand_util.h"
#include "base/scoped_ptr.h"
-#include "base/sys_info.h"
#include "base/time.h"
#include "base/waitable_event.h"
@@ -577,37 +576,6 @@ bool LaunchApp(const CommandLine& cl,
return LaunchApp(cl.argv(), no_files, wait, process_handle);
}
-#if !defined(OS_MACOSX)
-ProcessMetrics::ProcessMetrics(ProcessHandle process)
-#else
-ProcessMetrics::ProcessMetrics(ProcessHandle process,
- ProcessMetrics::PortProvider* port_provider)
-#endif
- : process_(process),
- last_time_(0),
- last_system_time_(0)
-#if defined(OS_MACOSX)
- , port_provider_(port_provider)
-#elif defined(OS_POSIX)
- , last_cpu_(0)
-#endif
-{
- processor_count_ = base::SysInfo::NumberOfProcessors();
-}
-
-// static
-#if !defined(OS_MACOSX)
-ProcessMetrics* ProcessMetrics::CreateProcessMetrics(ProcessHandle process) {
- return new ProcessMetrics(process);
-}
-#else
-ProcessMetrics* ProcessMetrics::CreateProcessMetrics(
- ProcessHandle process,
- ProcessMetrics::PortProvider* port_provider) {
- return new ProcessMetrics(process, port_provider);
-}
-#endif
-
ProcessMetrics::~ProcessMetrics() { }
void EnableTerminationOnHeapCorruption() {
@@ -877,28 +845,6 @@ bool GetAppOutputRestricted(const CommandLine& cl,
return GetAppOutputInternal(cl, &empty_environ, output, max_output, false);
}
-int GetProcessCount(const std::wstring& executable_name,
- const ProcessFilter* filter) {
- int count = 0;
-
- NamedProcessIterator iter(executable_name, filter);
- while (iter.NextProcessEntry())
- ++count;
- return count;
-}
-
-bool KillProcesses(const std::wstring& executable_name, int exit_code,
- const ProcessFilter* filter) {
- bool result = true;
- const ProcessEntry* entry;
-
- NamedProcessIterator iter(executable_name, filter);
- while ((entry = iter.NextProcessEntry()) != NULL)
- result = KillProcess((*entry).pid, exit_code, true) && result;
-
- return result;
-}
-
bool WaitForProcessesToExit(const std::wstring& executable_name,
int64 wait_milliseconds,
const ProcessFilter* filter) {
« no previous file with comments | « base/process_util_mac.mm ('k') | base/process_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698