OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_NET_NQE_UI_NETWORK_QUALITY_ESTIMATOR_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_NET_NQE_UI_NETWORK_QUALITY_ESTIMATOR_SERVICE_H_ |
6 #define CHROME_BROWSER_NET_NQE_UI_NETWORK_QUALITY_ESTIMATOR_SERVICE_H_ | 6 #define CHROME_BROWSER_NET_NQE_UI_NETWORK_QUALITY_ESTIMATOR_SERVICE_H_ |
7 | 7 |
| 8 #include <stdint.h> |
| 9 |
8 #include <map> | 10 #include <map> |
9 #include <memory> | 11 #include <memory> |
10 | 12 |
11 #include "base/macros.h" | 13 #include "base/macros.h" |
12 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
13 #include "base/observer_list.h" | 15 #include "base/observer_list.h" |
14 #include "base/time/time.h" | 16 #include "base/time/time.h" |
15 #include "components/keyed_service/core/keyed_service.h" | 17 #include "components/keyed_service/core/keyed_service.h" |
16 #include "net/nqe/cached_network_quality.h" | 18 #include "net/nqe/cached_network_quality.h" |
17 #include "net/nqe/effective_connection_type.h" | 19 #include "net/nqe/effective_connection_type.h" |
(...skipping 21 matching lines...) Expand all Loading... |
39 // Must be called on the UI thread. |observer| will be notified on the UI | 41 // Must be called on the UI thread. |observer| will be notified on the UI |
40 // thread. |observer| would be notified of the current effective connection | 42 // thread. |observer| would be notified of the current effective connection |
41 // type in the next message pump. | 43 // type in the next message pump. |
42 void AddEffectiveConnectionTypeObserver( | 44 void AddEffectiveConnectionTypeObserver( |
43 net::NetworkQualityEstimator::EffectiveConnectionTypeObserver* observer) | 45 net::NetworkQualityEstimator::EffectiveConnectionTypeObserver* observer) |
44 override; | 46 override; |
45 // Must be called on the UI thread. | 47 // Must be called on the UI thread. |
46 void RemoveEffectiveConnectionTypeObserver( | 48 void RemoveEffectiveConnectionTypeObserver( |
47 net::NetworkQualityEstimator::EffectiveConnectionTypeObserver* observer) | 49 net::NetworkQualityEstimator::EffectiveConnectionTypeObserver* observer) |
48 override; | 50 override; |
| 51 base::Optional<base::TimeDelta> GetHttpRTT() const override; |
| 52 base::Optional<base::TimeDelta> GetTransportRTT() const override; |
| 53 base::Optional<int32_t> GetDownstreamThroughputKbps() const override; |
49 | 54 |
50 // Must be called on the UI thread. |observer| will be notified on the UI | 55 // Must be called on the UI thread. |observer| will be notified on the UI |
51 // thread. |observer| would be notified of the changes in the HTTP RTT, | 56 // thread. |observer| would be notified of the changes in the HTTP RTT, |
52 // transport RTT or throughput. |observer| would be notified of the current | 57 // transport RTT or throughput. |observer| would be notified of the current |
53 // values in the next message pump. | 58 // values in the next message pump. |
54 void AddRTTAndThroughputEstimatesObserver( | 59 void AddRTTAndThroughputEstimatesObserver( |
55 net::NetworkQualityEstimator::RTTAndThroughputEstimatesObserver* observer) | 60 net::NetworkQualityEstimator::RTTAndThroughputEstimatesObserver* observer) |
56 override; | 61 override; |
57 | 62 |
58 // Removes |observer| from the list of RTT and throughput estimate observers. | 63 // Removes |observer| from the list of RTT and throughput estimate observers. |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 // Prefs manager that is owned by this service. Created on the UI thread, but | 137 // Prefs manager that is owned by this service. Created on the UI thread, but |
133 // used and deleted on the IO thread. | 138 // used and deleted on the IO thread. |
134 std::unique_ptr<net::NetworkQualitiesPrefsManager> prefs_manager_; | 139 std::unique_ptr<net::NetworkQualitiesPrefsManager> prefs_manager_; |
135 | 140 |
136 base::WeakPtrFactory<UINetworkQualityEstimatorService> weak_factory_; | 141 base::WeakPtrFactory<UINetworkQualityEstimatorService> weak_factory_; |
137 | 142 |
138 DISALLOW_COPY_AND_ASSIGN(UINetworkQualityEstimatorService); | 143 DISALLOW_COPY_AND_ASSIGN(UINetworkQualityEstimatorService); |
139 }; | 144 }; |
140 | 145 |
141 #endif // CHROME_BROWSER_NET_NQE_UI_NETWORK_QUALITY_ESTIMATOR_SERVICE_H_ | 146 #endif // CHROME_BROWSER_NET_NQE_UI_NETWORK_QUALITY_ESTIMATOR_SERVICE_H_ |
OLD | NEW |