Index: extensions/browser/api/system_cpu/cpu_info_provider.cc |
diff --git a/extensions/browser/api/system_cpu/cpu_info_provider.cc b/extensions/browser/api/system_cpu/cpu_info_provider.cc |
index e926aaac66be2398f62a9c15ada10caaa43b5c88..f9b3c08b429d1d97d315f032bb0d61eae4e54e6b 100644 |
--- a/extensions/browser/api/system_cpu/cpu_info_provider.cc |
+++ b/extensions/browser/api/system_cpu/cpu_info_provider.cc |
@@ -6,6 +6,10 @@ |
#include "base/sys_info.h" |
+#if defined(OS_CHROMEOS) |
+#include "chromeos/system/cpu_temperature_reader.h" |
+#endif // defined(OS_CHROMEOS) |
+ |
namespace extensions { |
using api::system_cpu::CpuInfo; |
@@ -39,6 +43,16 @@ bool CpuInfoProvider::QueryInfo() { |
// Initialize the ProcessorInfos, or return an empty array if that fails. |
if (!QueryCpuTimePerProcessor(&info_.processors)) |
info_.processors.clear(); |
+ |
+#if defined(OS_CHROMEOS) |
+ info_.temperatures.clear(); |
Devlin
2017/04/26 02:04:59
what is this clear()ing?
Simon Que
2017/04/26 02:27:21
CpuInfoProvider is a singleton class. |info_| reta
|
+ auto cpu_temp_info = |
+ chromeos::system::CPUTemperatureReader().GetCPUTemperatures(); |
Devlin
2017/04/26 02:04:58
GetCPUTemperatures() doesn't make it clear what th
Simon Que
2017/04/26 02:27:21
Done.
|
+ for (const auto& info : cpu_temp_info) { |
Devlin
2017/04/26 02:04:59
info_.temperatures.reserve(cpu_temp_info.size())
Simon Que
2017/04/26 02:27:21
Done.
|
+ info_.temperatures.push_back(info.temp_celsius); |
+ } |
+#endif // defined(OS_CHROMEOS) |
+ |
return true; |
} |