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

Side by Side Diff: components/metrics/drive_metrics_provider_linux.cc

Issue 1548113002: Switch to standard integer types in components/, part 2 of 4. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: gn Created 4 years, 12 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/metrics/drive_metrics_provider.h" 5 #include "components/metrics/drive_metrics_provider.h"
6 6
7 #include <linux/kdev_t.h> // For MAJOR()/MINOR(). 7 #include <linux/kdev_t.h> // For MAJOR()/MINOR().
8 #include <sys/stat.h> 8 #include <sys/stat.h>
9 #include <string> 9 #include <string>
10 10
11 #include "base/files/file.h" 11 #include "base/files/file.h"
12 #include "base/files/file_path.h" 12 #include "base/files/file_path.h"
13 #include "base/files/file_util.h" 13 #include "base/files/file_util.h"
14 #include "base/strings/stringprintf.h" 14 #include "base/strings/stringprintf.h"
15 #include "build/build_config.h"
15 16
16 #if defined(OS_CHROMEOS) 17 #if defined(OS_CHROMEOS)
17 #include "base/sys_info.h" 18 #include "base/sys_info.h"
18 #endif 19 #endif
19 20
20 namespace metrics { 21 namespace metrics {
21 22
22 namespace { 23 namespace {
23 24
24 // See http://www.kernel.org/doc/Documentation/devices.txt for more info. 25 // See http://www.kernel.org/doc/Documentation/devices.txt for more info.
(...skipping 30 matching lines...) Expand all
55 std::string rotational_path = base::StringPrintf(kRotationalFormat, sdX); 56 std::string rotational_path = base::StringPrintf(kRotationalFormat, sdX);
56 std::string rotates; 57 std::string rotates;
57 if (!base::ReadFileToString(base::FilePath(rotational_path), &rotates)) 58 if (!base::ReadFileToString(base::FilePath(rotational_path), &rotates))
58 return false; 59 return false;
59 60
60 *has_seek_penalty = rotates.substr(0, 1) == "1"; 61 *has_seek_penalty = rotates.substr(0, 1) == "1";
61 return true; 62 return true;
62 } 63 }
63 64
64 } // namespace metrics 65 } // namespace metrics
OLDNEW
« no previous file with comments | « components/metrics/daily_event_unittest.cc ('k') | components/metrics/gpu/gpu_metrics_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698