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

Unified Diff: chrome/browser/chromeos/power/cpu_data_collector.cc

Issue 1493503002: base: get rid of deprecated TrimWhitespace() function (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: REBASE 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/strings/string_util_unittest.cc ('k') | chrome/browser/devtools/device/android_device_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/power/cpu_data_collector.cc
diff --git a/chrome/browser/chromeos/power/cpu_data_collector.cc b/chrome/browser/chromeos/power/cpu_data_collector.cc
index 3166c60844716dda0ddd0c81e00c6d8ed2d28255..21c65fa4c2b6ab035d72c1facb14657ae10617b6 100644
--- a/chrome/browser/chromeos/power/cpu_data_collector.cc
+++ b/chrome/browser/chromeos/power/cpu_data_collector.cc
@@ -94,7 +94,8 @@ bool CpuIsOnline(const int i) {
std::string cpu_online_string;
if (base::ReadFileToString(base::FilePath(cpu_online_file),
&cpu_online_string)) {
- base::TrimWhitespace(cpu_online_string, base::TRIM_ALL, &cpu_online_string);
+ base::TrimWhitespaceASCII(cpu_online_string, base::TRIM_ALL,
+ &cpu_online_string);
if (base::StringToInt(cpu_online_string, &online))
return online == kCpuOnlineStatus;
}
@@ -159,9 +160,9 @@ void SampleCpuIdleData(
return;
}
- base::TrimWhitespace(state_name, base::TRIM_ALL, &state_name);
- base::TrimWhitespace(
- occupancy_time_string, base::TRIM_ALL, &occupancy_time_string);
+ base::TrimWhitespaceASCII(state_name, base::TRIM_ALL, &state_name);
+ base::TrimWhitespaceASCII(occupancy_time_string, base::TRIM_ALL,
+ &occupancy_time_string);
if (base::StringToInt64(occupancy_time_string, &occupancy_time_usec)) {
// idle state occupancy time in sysfs is recorded in microseconds.
int64 time_in_state_ms = occupancy_time_usec / 1000;
@@ -324,7 +325,8 @@ void SampleCpuStateOnBlockingPool(
int max_cpu;
// The possible CPUs are listed in the format "0-N". Hence, N is present
// in the substring starting at offset 2.
- base::TrimWhitespace(possible_string, base::TRIM_ALL, &possible_string);
+ base::TrimWhitespaceASCII(possible_string, base::TRIM_ALL,
+ &possible_string);
if (possible_string.find("-") != std::string::npos &&
possible_string.length() > 2 &&
base::StringToInt(possible_string.substr(2), &max_cpu)) {
« no previous file with comments | « base/strings/string_util_unittest.cc ('k') | chrome/browser/devtools/device/android_device_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698