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

Unified Diff: base/process/process_metrics_win.cc

Issue 1543293004: Switch to standard integer types in base/process/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ssize_t Created 5 years 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/process_metrics_unittest.cc ('k') | base/process/process_posix.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/process/process_metrics_win.cc
diff --git a/base/process/process_metrics_win.cc b/base/process/process_metrics_win.cc
index 63b7d961240a93d13dd3587f985fa6153f6903c8..290d918f9a6aa42d4cc15cfa0c79c477779ed3e6 100644
--- a/base/process/process_metrics_win.cc
+++ b/base/process/process_metrics_win.cc
@@ -6,6 +6,8 @@
#include <windows.h>
#include <psapi.h>
+#include <stddef.h>
+#include <stdint.h>
#include <winternl.h>
#include <algorithm>
@@ -206,7 +208,7 @@ bool ProcessMetrics::GetWorkingSetKBytes(WorkingSetKBytes* ws_usage) const {
return true;
}
-static uint64 FileTimeToUTC(const FILETIME& ftime) {
+static uint64_t FileTimeToUTC(const FILETIME& ftime) {
LARGE_INTEGER li;
li.LowPart = ftime.dwLowDateTime;
li.HighPart = ftime.dwHighDateTime;
@@ -226,8 +228,9 @@ double ProcessMetrics::GetCPUUsage() {
// not yet received the notification.
return 0;
}
- int64 system_time = (FileTimeToUTC(kernel_time) + FileTimeToUTC(user_time)) /
- processor_count_;
+ int64_t system_time =
+ (FileTimeToUTC(kernel_time) + FileTimeToUTC(user_time)) /
+ processor_count_;
TimeTicks time = TimeTicks::Now();
if (last_system_time_ == 0) {
@@ -237,9 +240,9 @@ double ProcessMetrics::GetCPUUsage() {
return 0;
}
- int64 system_time_delta = system_time - last_system_time_;
+ int64_t system_time_delta = system_time - last_system_time_;
// FILETIME is in 100-nanosecond units, so this needs microseconds times 10.
- int64 time_delta = (time - last_cpu_time_).InMicroseconds() * 10;
+ int64_t time_delta = (time - last_cpu_time_).InMicroseconds() * 10;
DCHECK_NE(0U, time_delta);
if (time_delta == 0)
return 0;
« no previous file with comments | « base/process/process_metrics_unittest.cc ('k') | base/process/process_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698