| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 #ifndef CHROMEOS_SYSTEM_CPU_TEMPERATURE_READER_H_ | 5 #ifndef CHROMEOS_SYSTEM_CPU_TEMPERATURE_READER_H_ |
| 6 #define CHROMEOS_SYSTEM_CPU_TEMPERATURE_READER_H_ | 6 #define CHROMEOS_SYSTEM_CPU_TEMPERATURE_READER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "chromeos/chromeos_export.h" |
| 14 | 15 |
| 15 namespace chromeos { | 16 namespace chromeos { |
| 16 namespace system { | 17 namespace system { |
| 17 | 18 |
| 18 // Used to read CPU temperature info from sysfs hwmon. | 19 // Used to read CPU temperature info from sysfs hwmon. |
| 19 class CPUTemperatureReader { | 20 class CHROMEOS_EXPORT CPUTemperatureReader { |
| 20 public: | 21 public: |
| 21 // Contains info from a CPU temperature sensor. | 22 // Contains info from a CPU temperature sensor. |
| 22 struct CPUTemperatureInfo { | 23 struct CPUTemperatureInfo { |
| 23 CPUTemperatureInfo(); | 24 CPUTemperatureInfo(); |
| 24 ~CPUTemperatureInfo(); | 25 ~CPUTemperatureInfo(); |
| 25 | 26 |
| 26 bool operator<(const CPUTemperatureInfo& other) const { | 27 bool operator<(const CPUTemperatureInfo& other) const { |
| 27 return std::make_pair(label, temp_celsius) < | 28 return std::make_pair(label, temp_celsius) < |
| 28 std::make_pair(other.label, other.temp_celsius); | 29 std::make_pair(other.label, other.temp_celsius); |
| 29 } | 30 } |
| (...skipping 21 matching lines...) Expand all Loading... |
| 51 // Sysfs hwmon directory path. | 52 // Sysfs hwmon directory path. |
| 52 base::FilePath hwmon_dir_; | 53 base::FilePath hwmon_dir_; |
| 53 | 54 |
| 54 DISALLOW_COPY_AND_ASSIGN(CPUTemperatureReader); | 55 DISALLOW_COPY_AND_ASSIGN(CPUTemperatureReader); |
| 55 }; | 56 }; |
| 56 | 57 |
| 57 } // namespace system | 58 } // namespace system |
| 58 } // namespace chromeos | 59 } // namespace chromeos |
| 59 | 60 |
| 60 #endif // CHROMEOS_SYSTEM_CPU_TEMPERATURE_READER_H_ | 61 #endif // CHROMEOS_SYSTEM_CPU_TEMPERATURE_READER_H_ |
| OLD | NEW |