| 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 MEDIA_CAST_LOGGING_STATS_EVENT_SUBSCRIBER_H_ | 5 #ifndef MEDIA_CAST_LOGGING_STATS_EVENT_SUBSCRIBER_H_ |
| 6 #define MEDIA_CAST_LOGGING_STATS_EVENT_SUBSCRIBER_H_ | 6 #define MEDIA_CAST_LOGGING_STATS_EVENT_SUBSCRIBER_H_ |
| 7 | 7 |
| 8 #include "base/gtest_prod_util.h" | 8 #include "base/gtest_prod_util.h" |
| 9 #include "base/memory/linked_ptr.h" | 9 #include "base/memory/linked_ptr.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 // |min| must be less than |max|. | 90 // |min| must be less than |max|. |
| 91 // |width| must divide |max - min| evenly. | 91 // |width| must divide |max - min| evenly. |
| 92 SimpleHistogram(int64 min, int64 max, int64 width); | 92 SimpleHistogram(int64 min, int64 max, int64 width); |
| 93 | 93 |
| 94 ~SimpleHistogram(); | 94 ~SimpleHistogram(); |
| 95 | 95 |
| 96 void Add(int64 sample); | 96 void Add(int64 sample); |
| 97 | 97 |
| 98 void Reset(); | 98 void Reset(); |
| 99 | 99 |
| 100 scoped_ptr<base::ListValue> GetHistogram() const; | 100 scoped_ptr<base::DictionaryValue> GetHistogram() const; |
| 101 | 101 |
| 102 private: | 102 private: |
| 103 int64 min_; | 103 int64 min_; |
| 104 int64 max_; | 104 int64 max_; |
| 105 int64 width_; | 105 int64 width_; |
| 106 std::vector<int> buckets_; | 106 std::vector<int> buckets_; |
| 107 }; | 107 }; |
| 108 | 108 |
| 109 enum CastStat { | 109 enum CastStat { |
| 110 // Capture frame rate. | 110 // Capture frame rate. |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 HistogramMap histograms_; | 254 HistogramMap histograms_; |
| 255 | 255 |
| 256 base::ThreadChecker thread_checker_; | 256 base::ThreadChecker thread_checker_; |
| 257 DISALLOW_COPY_AND_ASSIGN(StatsEventSubscriber); | 257 DISALLOW_COPY_AND_ASSIGN(StatsEventSubscriber); |
| 258 }; | 258 }; |
| 259 | 259 |
| 260 } // namespace cast | 260 } // namespace cast |
| 261 } // namespace media | 261 } // namespace media |
| 262 | 262 |
| 263 #endif // MEDIA_CAST_LOGGING_STATS_EVENT_SUBSCRIBER_H_ | 263 #endif // MEDIA_CAST_LOGGING_STATS_EVENT_SUBSCRIBER_H_ |
| OLD | NEW |