| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_POWER_POWER_DATA_COLLECTOR_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_POWER_POWER_DATA_COLLECTOR_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_POWER_POWER_DATA_COLLECTOR_H_ | 6 #define CHROME_BROWSER_CHROMEOS_POWER_POWER_DATA_COLLECTOR_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 | 76 |
| 77 // Can be called only if initialized via Initialize, and before | 77 // Can be called only if initialized via Initialize, and before |
| 78 // DBusThreadManager is destroyed. | 78 // DBusThreadManager is destroyed. |
| 79 static void Shutdown(); | 79 static void Shutdown(); |
| 80 | 80 |
| 81 // Returns the global instance of PowerDataCollector. | 81 // Returns the global instance of PowerDataCollector. |
| 82 static PowerDataCollector* Get(); | 82 static PowerDataCollector* Get(); |
| 83 | 83 |
| 84 // PowerManagerClient::Observer implementation: | 84 // PowerManagerClient::Observer implementation: |
| 85 virtual void PowerChanged( | 85 virtual void PowerChanged( |
| 86 const power_manager::PowerSupplyProperties& prop) OVERRIDE; | 86 const power_manager::PowerSupplyProperties& prop) override; |
| 87 virtual void SuspendDone(const base::TimeDelta& sleep_duration) OVERRIDE; | 87 virtual void SuspendDone(const base::TimeDelta& sleep_duration) override; |
| 88 | 88 |
| 89 // Only those power data samples which fall within the last | 89 // Only those power data samples which fall within the last |
| 90 // |kSampleTimeLimitSec| are stored in memory. | 90 // |kSampleTimeLimitSec| are stored in memory. |
| 91 static const int kSampleTimeLimitSec; | 91 static const int kSampleTimeLimitSec; |
| 92 | 92 |
| 93 private: | 93 private: |
| 94 explicit PowerDataCollector(const bool start_cpu_data_collector); | 94 explicit PowerDataCollector(const bool start_cpu_data_collector); |
| 95 | 95 |
| 96 virtual ~PowerDataCollector(); | 96 virtual ~PowerDataCollector(); |
| 97 | 97 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 115 } else { | 115 } else { |
| 116 break; | 116 break; |
| 117 } | 117 } |
| 118 } | 118 } |
| 119 sample_queue->push_back(sample); | 119 sample_queue->push_back(sample); |
| 120 } | 120 } |
| 121 | 121 |
| 122 } // namespace chromeos | 122 } // namespace chromeos |
| 123 | 123 |
| 124 #endif // CHROME_BROWSER_CHROMEOS_POWER_POWER_DATA_COLLECTOR_H_ | 124 #endif // CHROME_BROWSER_CHROMEOS_POWER_POWER_DATA_COLLECTOR_H_ |
| OLD | NEW |