OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef NET_NQE_NETWORK_QUALITY_EFFECTIVE_CONNECTION_TYPE_OBSERVER_H_ |
| 6 #define NET_NQE_NETWORK_QUALITY_EFFECTIVE_CONNECTION_TYPE_OBSERVER_H_ |
| 7 |
| 8 #include "base/compiler_specific.h" |
| 9 #include "base/macros.h" |
| 10 #include "net/base/net_export.h" |
| 11 #include "net/nqe/effective_connection_type.h" |
| 12 |
| 13 namespace net { |
| 14 |
| 15 // Observes changes in effective connection type. |
| 16 class NET_EXPORT EffectiveConnectionTypeObserver { |
| 17 public: |
| 18 // Notifies the observer of a change in the effective connection type. |
| 19 // NetworkQualityEstimator computes the effective connection type once in |
| 20 // every interval of duration |
| 21 // |effective_connection_type_recomputation_interval_|. Additionally, when |
| 22 // there is a change in the connection type of the device, then the |
| 23 // effective connection type is immediately recomputed. |
| 24 // |
| 25 // If the computed effective connection type is different from the |
| 26 // previously notified effective connection type, then all the registered |
| 27 // observers are notified of the new effective connection type. |
| 28 virtual void OnEffectiveConnectionTypeChanged( |
| 29 EffectiveConnectionType type) = 0; |
| 30 |
| 31 protected: |
| 32 EffectiveConnectionTypeObserver() {} |
| 33 virtual ~EffectiveConnectionTypeObserver() {} |
| 34 |
| 35 private: |
| 36 DISALLOW_COPY_AND_ASSIGN(EffectiveConnectionTypeObserver); |
| 37 }; |
| 38 |
| 39 } // namespace net |
| 40 |
| 41 #endif // NET_NQE_NETWORK_QUALITY_EFFECTIVE_CONNECTION_TYPE_OBSERVER_H_ |
OLD | NEW |