| 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 REMOTING_HOST_PROCESS_STATS_SENDER_H_ | 5 #ifndef REMOTING_HOST_PROCESS_STATS_SENDER_H_ |
| 6 #define REMOTING_HOST_PROCESS_STATS_SENDER_H_ | 6 #define REMOTING_HOST_PROCESS_STATS_SENDER_H_ |
| 7 | 7 |
| 8 #include <initializer_list> | 8 #include <initializer_list> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 public: | 26 public: |
| 27 // ProcessStatsSender reports statistic data to |host_stats_stub| once per | 27 // ProcessStatsSender reports statistic data to |host_stats_stub| once per |
| 28 // |interval|. | 28 // |interval|. |
| 29 // ProcessStatsSender does not take the ownership of both |host_stats_stub| | 29 // ProcessStatsSender does not take the ownership of both |host_stats_stub| |
| 30 // and |agents|. They must outlive the ProcessStatsSender object. | 30 // and |agents|. They must outlive the ProcessStatsSender object. |
| 31 ProcessStatsSender(protocol::ProcessStatsStub* host_stats_stub, | 31 ProcessStatsSender(protocol::ProcessStatsStub* host_stats_stub, |
| 32 base::TimeDelta interval, | 32 base::TimeDelta interval, |
| 33 std::initializer_list<ProcessStatsAgent*> agents); | 33 std::initializer_list<ProcessStatsAgent*> agents); |
| 34 | 34 |
| 35 ~ProcessStatsSender(); | 35 ~ProcessStatsSender(); |
| 36 |
| 37 base::TimeDelta interval() const; |
| 38 |
| 36 private: | 39 private: |
| 37 void ReportUsage(); | 40 void ReportUsage(); |
| 38 | 41 |
| 39 protocol::ProcessStatsStub* const host_stats_stub_; | 42 protocol::ProcessStatsStub* const host_stats_stub_; |
| 40 std::vector<ProcessStatsAgent*> agents_; | 43 std::vector<ProcessStatsAgent*> agents_; |
| 44 const base::TimeDelta interval_; |
| 41 base::RepeatingTimer timer_; | 45 base::RepeatingTimer timer_; |
| 42 const base::ThreadChecker thread_checker_; | 46 const base::ThreadChecker thread_checker_; |
| 43 }; | 47 }; |
| 44 | 48 |
| 45 } // namespace remoting | 49 } // namespace remoting |
| 46 | 50 |
| 47 #endif // REMOTING_HOST_PROCESS_STATS_SENDER_H_ | 51 #endif // REMOTING_HOST_PROCESS_STATS_SENDER_H_ |
| OLD | NEW |