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 NET_NQE_CACHED_NETWORK_QUALITY_H_ | 5 #ifndef NET_NQE_CACHED_NETWORK_QUALITY_H_ |
6 #define NET_NQE_CACHED_NETWORK_QUALITY_H_ | 6 #define NET_NQE_CACHED_NETWORK_QUALITY_H_ |
7 | 7 |
8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
9 #include "net/base/net_export.h" | 9 #include "net/base/net_export.h" |
10 #include "net/nqe/effective_connection_type.h" | 10 #include "net/nqe/effective_connection_type.h" |
11 #include "net/nqe/network_quality.h" | 11 #include "net/nqe/network_quality.h" |
12 | 12 |
13 namespace net { | 13 namespace net { |
14 | 14 |
15 namespace nqe { | 15 namespace nqe { |
16 | 16 |
17 namespace internal { | 17 namespace internal { |
18 | 18 |
19 // CachedNetworkQuality stores the quality of a previously seen network. | 19 // CachedNetworkQuality stores the quality of a previously seen network. |
20 class NET_EXPORT_PRIVATE CachedNetworkQuality { | 20 class NET_EXPORT_PRIVATE CachedNetworkQuality { |
21 public: | 21 public: |
22 CachedNetworkQuality(); | 22 CachedNetworkQuality(); |
| 23 explicit CachedNetworkQuality( |
| 24 EffectiveConnectionType effective_connection_type); |
23 | 25 |
24 // |last_update_time| is the time when the |network_quality| was computed. | 26 // |last_update_time| is the time when the |network_quality| was computed. |
25 CachedNetworkQuality(base::TimeTicks last_update_time, | 27 CachedNetworkQuality(base::TimeTicks last_update_time, |
26 const NetworkQuality& network_quality, | 28 const NetworkQuality& network_quality, |
27 EffectiveConnectionType effective_connection_type); | 29 EffectiveConnectionType effective_connection_type); |
28 CachedNetworkQuality(const CachedNetworkQuality& other); | 30 CachedNetworkQuality(const CachedNetworkQuality& other); |
29 ~CachedNetworkQuality(); | 31 ~CachedNetworkQuality(); |
30 | 32 |
31 // Returns the network quality associated with this cached entry. | 33 // Returns the network quality associated with this cached entry. |
32 const NetworkQuality& network_quality() const { return network_quality_; } | 34 const NetworkQuality& network_quality() const { return network_quality_; } |
(...skipping 23 matching lines...) Expand all Loading... |
56 EffectiveConnectionType effective_connection_type_; | 58 EffectiveConnectionType effective_connection_type_; |
57 }; | 59 }; |
58 | 60 |
59 } // namespace internal | 61 } // namespace internal |
60 | 62 |
61 } // namespace nqe | 63 } // namespace nqe |
62 | 64 |
63 } // namespace net | 65 } // namespace net |
64 | 66 |
65 #endif // NET_NQE_CACHED_NETWORK_QUALITY_H_ | 67 #endif // NET_NQE_CACHED_NETWORK_QUALITY_H_ |
OLD | NEW |