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

Unified Diff: components/metrics/drive_metrics_provider_linux.cc

Issue 2489853002: Added function to provide the short board name of the device (Closed)
Patch Set: Nit Created 4 years, 1 month 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/sys_info_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/metrics/drive_metrics_provider_linux.cc
diff --git a/components/metrics/drive_metrics_provider_linux.cc b/components/metrics/drive_metrics_provider_linux.cc
index 35c505a3492b945e814f7f4861f61478bf7c43a3..194e1ee4419bf7f6a6248a6a5c572f243fea0005 100644
--- a/components/metrics/drive_metrics_provider_linux.cc
+++ b/components/metrics/drive_metrics_provider_linux.cc
@@ -11,6 +11,7 @@
#include "base/files/file.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
+#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "build/build_config.h"
@@ -33,9 +34,11 @@ const char kRotationalFormat[] = "/sys/block/sd%c/queue/rotational";
bool DriveMetricsProvider::HasSeekPenalty(const base::FilePath& path,
bool* has_seek_penalty) {
#if defined(OS_CHROMEOS)
- std::string board = base::SysInfo::GetLsbReleaseBoard();
- if (board != "unknown" && board != "parrot") {
- // All ChromeOS devices have SSDs. Except some parrots.
+ std::string board = base::SysInfo::GetStrippedReleaseBoard();
+ // There are "parrot", "parrot_ivb" and "parrot_freon" boards that have
+ // devices with rotating disks. All other ChromeOS devices have SSDs.
+ if (board != "unknown" &&
+ !base::StartsWith(board, "parrot", base::CompareCase::SENSITIVE)) {
*has_seek_penalty = false;
return true;
}
« no previous file with comments | « base/sys_info_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698