summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--base/process_util.h4
-rw-r--r--base/process_util_posix.cc4
-rw-r--r--chrome/app/chrome_dll_main.cc9
-rw-r--r--chrome/browser/memory_details.h2
-rw-r--r--chrome/browser/memory_details_win.cc2
-rw-r--r--chrome/common/process_watcher_posix.cc2
-rw-r--r--chrome/renderer/render_thread.cc2
7 files changed, 13 insertions, 12 deletions
diff --git a/base/process_util.h b/base/process_util.h
index 89e6346..caf39e8 100644
--- a/base/process_util.h
+++ b/base/process_util.h
@@ -37,8 +37,8 @@ typedef IO_COUNTERS IoCounters;
#elif defined(OS_POSIX)
// TODO(port): we should not rely on a Win32 structure.
struct ProcessEntry {
- int pid;
- int ppid;
+ base::ProcessId pid;
+ base::ProcessId ppid;
char szExeFile[NAME_MAX + 1];
};
diff --git a/base/process_util_posix.cc b/base/process_util_posix.cc
index 61ecb7e..d365d01 100644
--- a/base/process_util_posix.cc
+++ b/base/process_util_posix.cc
@@ -77,7 +77,7 @@ bool KillProcess(ProcessHandle process_id, int exit_code, bool wait) {
// The process may not end immediately due to pending I/O
bool exited = false;
while (tries-- > 0) {
- int pid = HANDLE_EINTR(waitpid(process_id, NULL, WNOHANG));
+ pid_t pid = HANDLE_EINTR(waitpid(process_id, NULL, WNOHANG));
if (pid == process_id) {
exited = true;
break;
@@ -330,7 +330,7 @@ void RaiseProcessToHighPriority() {
bool DidProcessCrash(bool* child_exited, ProcessHandle handle) {
int status;
- const int result = HANDLE_EINTR(waitpid(handle, &status, WNOHANG));
+ const pid_t result = HANDLE_EINTR(waitpid(handle, &status, WNOHANG));
if (result == -1) {
PLOG(ERROR) << "waitpid(" << handle << ")";
if (child_exited)
diff --git a/chrome/app/chrome_dll_main.cc b/chrome/app/chrome_dll_main.cc
index aa478b8..f46ec70 100644
--- a/chrome/app/chrome_dll_main.cc
+++ b/chrome/app/chrome_dll_main.cc
@@ -375,7 +375,7 @@ int ChromeMain(int argc, char** argv) {
CHECK(signal(SIGPIPE, SIG_IGN) != SIG_ERR);
#endif // OS_POSIX
- int browser_pid;
+ base::ProcessId browser_pid;
if (process_type.empty()) {
browser_pid = base::GetCurrentProcId();
} else {
@@ -383,7 +383,8 @@ int ChromeMain(int argc, char** argv) {
std::wstring channel_name =
parsed_command_line.GetSwitchValue(switches::kProcessChannelID);
- browser_pid = StringToInt(WideToASCII(channel_name));
+ browser_pid =
+ static_cast<base::ProcessId>(StringToInt(WideToASCII(channel_name)));
DCHECK(browser_pid != 0);
#else
browser_pid = base::GetCurrentProcId();
@@ -455,8 +456,8 @@ int ChromeMain(int argc, char** argv) {
// TODO(port): we probably need to shut this down correctly to avoid
// leaking shared memory regions on posix platforms.
if (parsed_command_line.HasSwitch(switches::kEnableStatsTable)) {
- std::string statsfile =
- StringPrintf("%s-%d", chrome::kStatsFilename, browser_pid);
+ std::string statsfile = StringPrintf("%s-%lld", chrome::kStatsFilename,
+ static_cast<int64>(browser_pid));
StatsTable *stats_table = new StatsTable(statsfile,
chrome::kStatsMaxThreads, chrome::kStatsMaxCounters);
StatsTable::set_current(stats_table);
diff --git a/chrome/browser/memory_details.h b/chrome/browser/memory_details.h
index 2e7e852..5e155a1 100644
--- a/chrome/browser/memory_details.h
+++ b/chrome/browser/memory_details.h
@@ -25,7 +25,7 @@ struct ProcessMemoryInformation {
}
// The process id.
- int pid;
+ base::ProcessId pid;
// The working set information.
base::WorkingSetKBytes working_set;
// The committed bytes.
diff --git a/chrome/browser/memory_details_win.cc b/chrome/browser/memory_details_win.cc
index 4c3d8be..56aa9fb 100644
--- a/chrome/browser/memory_details_win.cc
+++ b/chrome/browser/memory_details_win.cc
@@ -85,7 +85,7 @@ void MemoryDetails::CollectProcessData(
return;
}
do {
- int pid = process_entry.th32ProcessID;
+ base::ProcessId pid = process_entry.th32ProcessID;
ScopedHandle handle(::OpenProcess(
PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, pid));
if (!handle.Get())
diff --git a/chrome/common/process_watcher_posix.cc b/chrome/common/process_watcher_posix.cc
index 0991f0cb..8f09101 100644
--- a/chrome/common/process_watcher_posix.cc
+++ b/chrome/common/process_watcher_posix.cc
@@ -15,7 +15,7 @@
// Return true if the given child is dead. This will also reap the process.
// Doesn't block.
static bool IsChildDead(pid_t child) {
- const int result = HANDLE_EINTR(waitpid(child, NULL, WNOHANG));
+ const pid_t result = HANDLE_EINTR(waitpid(child, NULL, WNOHANG));
if (result == -1) {
NOTREACHED();
} else if (result > 0) {
diff --git a/chrome/renderer/render_thread.cc b/chrome/renderer/render_thread.cc
index 0ab02c8..3ccdd85 100644
--- a/chrome/renderer/render_thread.cc
+++ b/chrome/renderer/render_thread.cc
@@ -380,7 +380,7 @@ void RenderThread::OnGetRendererHistograms(int sequence_number) {
void RenderThread::OnGetRendererTcmalloc() {
std::string result;
char buffer[1024 * 32];
- int pid = base::GetCurrentProcId();
+ base::ProcessId pid = base::GetCurrentProcId();
MallocExtension::instance()->GetStats(buffer, sizeof(buffer));
result.append(buffer);
Send(new ViewHostMsg_RendererTcmalloc(pid, result));