Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_STATUS_COLLECTOR_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_STATUS_COLLECTOR_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_STATUS_COLLECTOR_H_ | 6 #define CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_STATUS_COLLECTOR_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <deque> | 10 #include <deque> |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 61 | 61 |
| 62 // Reads CPU temperatures from /sys/class/hwmon/hwmon*/temp*_input and | 62 // Reads CPU temperatures from /sys/class/hwmon/hwmon*/temp*_input and |
| 63 // appropriate labels from /sys/class/hwmon/hwmon*/temp*_label. | 63 // appropriate labels from /sys/class/hwmon/hwmon*/temp*_label. |
| 64 using CPUTempFetcher = | 64 using CPUTempFetcher = |
| 65 base::Callback<std::vector<enterprise_management::CPUTempInfo>()>; | 65 base::Callback<std::vector<enterprise_management::CPUTempInfo>()>; |
| 66 | 66 |
| 67 // Passed into asynchronous mojo interface for communicating with Android. | 67 // Passed into asynchronous mojo interface for communicating with Android. |
| 68 using AndroidStatusReceiver = | 68 using AndroidStatusReceiver = |
| 69 base::Callback<void(const std::string&, const std::string&)>; | 69 base::Callback<void(const std::string&, const std::string&)>; |
| 70 // Calls the enterprise reporting mojo interface, passing over the | 70 // Calls the enterprise reporting mojo interface, passing over the |
| 71 // AndroidStatusReceiver. | 71 // AndroidStatusReceiver. Returns false if the mojo interface isn't available, |
| 72 // in which case no asynchronous query is emitted and the android status query | |
| 73 // fails synchronously. The |AndroidStatusReceiver| is not called in this | |
| 74 // case. | |
| 72 using AndroidStatusFetcher = | 75 using AndroidStatusFetcher = |
| 73 base::Callback<bool(const AndroidStatusReceiver&)>; | 76 base::Callback<bool(const AndroidStatusReceiver&)>; |
| 74 | 77 |
| 75 // Called in the UI thread after the device and session status have been | 78 // Called in the UI thread after the device and session status have been |
| 76 // collected asynchronously in GetDeviceAndSessionStatusAsync. Null pointers | 79 // collected asynchronously in GetDeviceAndSessionStatusAsync. Null pointers |
| 77 // indicate errors or that device or session status reporting is disabled. | 80 // indicate errors or that device or session status reporting is disabled. |
| 78 using StatusCallback = base::Callback<void( | 81 using StatusCallback = base::Callback<void( |
| 79 std::unique_ptr<enterprise_management::DeviceStatusReportRequest>, | 82 std::unique_ptr<enterprise_management::DeviceStatusReportRequest>, |
| 80 std::unique_ptr<enterprise_management::SessionStatusReportRequest>)>; | 83 std::unique_ptr<enterprise_management::SessionStatusReportRequest>)>; |
| 81 | 84 |
| 82 // Constructor. Callers can inject their own VolumeInfoFetcher, | 85 // Constructor. Callers can inject their own VolumeInfoFetcher, |
| 83 // CPUStatisticsFetcher and CPUTempFetcher. These callbacks are executed on | 86 // CPUStatisticsFetcher and CPUTempFetcher. These callbacks are executed on |
| 84 // Blocking Pool. A null callback can be passed for either parameter, to use | 87 // Blocking Pool. A null callback can be passed for either parameter, to use |
|
Andrew T Wilson (Slow)
2016/11/28 10:37:20
"either parameter" is out of date - let's update t
| |
| 85 // the default implementation. | 88 // the default implementation. |
| 86 DeviceStatusCollector( | 89 DeviceStatusCollector( |
| 87 PrefService* local_state, | 90 PrefService* local_state, |
| 88 chromeos::system::StatisticsProvider* provider, | 91 chromeos::system::StatisticsProvider* provider, |
| 89 const VolumeInfoFetcher& volume_info_fetcher, | 92 const VolumeInfoFetcher& volume_info_fetcher, |
| 90 const CPUStatisticsFetcher& cpu_statistics_fetcher, | 93 const CPUStatisticsFetcher& cpu_statistics_fetcher, |
| 91 const CPUTempFetcher& cpu_temp_fetcher, | 94 const CPUTempFetcher& cpu_temp_fetcher, |
| 92 const AndroidStatusFetcher& android_status_fetcher); | 95 const AndroidStatusFetcher& android_status_fetcher); |
| 93 virtual ~DeviceStatusCollector(); | 96 virtual ~DeviceStatusCollector(); |
| 94 | 97 |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 285 base::ThreadChecker thread_checker_; | 288 base::ThreadChecker thread_checker_; |
| 286 | 289 |
| 287 base::WeakPtrFactory<DeviceStatusCollector> weak_factory_; | 290 base::WeakPtrFactory<DeviceStatusCollector> weak_factory_; |
| 288 | 291 |
| 289 DISALLOW_COPY_AND_ASSIGN(DeviceStatusCollector); | 292 DISALLOW_COPY_AND_ASSIGN(DeviceStatusCollector); |
| 290 }; | 293 }; |
| 291 | 294 |
| 292 } // namespace policy | 295 } // namespace policy |
| 293 | 296 |
| 294 #endif // CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_STATUS_COLLECTOR_H_ | 297 #endif // CHROME_BROWSER_CHROMEOS_POLICY_DEVICE_STATUS_COLLECTOR_H_ |
| OLD | NEW |