| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 CONTENT_BROWSER_DOWNLOAD_RATE_ESTIMATOR_H_ | 5 #ifndef CONTENT_BROWSER_DOWNLOAD_RATE_ESTIMATOR_H_ |
| 6 #define CONTENT_BROWSER_DOWNLOAD_RATE_ESTIMATOR_H_ | 6 #define CONTENT_BROWSER_DOWNLOAD_RATE_ESTIMATOR_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/time.h" | 12 #include "base/time/time.h" |
| 13 #include "content/common/content_export.h" | 13 #include "content/common/content_export.h" |
| 14 | 14 |
| 15 namespace content { | 15 namespace content { |
| 16 | 16 |
| 17 // RateEstimator generates rate estimates based on recent activity. | 17 // RateEstimator generates rate estimates based on recent activity. |
| 18 // | 18 // |
| 19 // Internally it uses a fixed-size ring buffer, and develops estimates | 19 // Internally it uses a fixed-size ring buffer, and develops estimates |
| 20 // based on a small sliding window of activity. | 20 // based on a small sliding window of activity. |
| 21 class CONTENT_EXPORT RateEstimator { | 21 class CONTENT_EXPORT RateEstimator { |
| 22 public: | 22 public: |
| (...skipping 20 matching lines...) Expand all Loading... |
| 43 std::vector<uint32> history_; | 43 std::vector<uint32> history_; |
| 44 base::TimeDelta bucket_time_; | 44 base::TimeDelta bucket_time_; |
| 45 size_t oldest_index_; | 45 size_t oldest_index_; |
| 46 size_t bucket_count_; | 46 size_t bucket_count_; |
| 47 base::TimeTicks oldest_time_; | 47 base::TimeTicks oldest_time_; |
| 48 }; | 48 }; |
| 49 | 49 |
| 50 } // namespace content | 50 } // namespace content |
| 51 | 51 |
| 52 #endif // CONTENT_BROWSER_DOWNLOAD_RATE_ESTIMATOR_H_ | 52 #endif // CONTENT_BROWSER_DOWNLOAD_RATE_ESTIMATOR_H_ |
| OLD | NEW |