| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef NET_NQE_CACHED_NETWORK_QUALITY_H_ |
| 6 #define NET_NQE_CACHED_NETWORK_QUALITY_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "base/time/time.h" |
| 10 #include "net/base/net_export.h" |
| 11 #include "net/nqe/network_quality.h" |
| 12 |
| 13 namespace net { |
| 14 |
| 15 namespace nqe { |
| 16 |
| 17 namespace internal { |
| 18 |
| 19 // CachedNetworkQuality stores the quality of a previously seen network. |
| 20 class NET_EXPORT_PRIVATE CachedNetworkQuality { |
| 21 public: |
| 22 explicit CachedNetworkQuality(const NetworkQuality& network_quality); |
| 23 CachedNetworkQuality(const CachedNetworkQuality& other); |
| 24 ~CachedNetworkQuality(); |
| 25 |
| 26 // Returns the network quality associated with this cached entry. |
| 27 const NetworkQuality& network_quality() const { return network_quality_; } |
| 28 |
| 29 // Returns true if this cache entry was updated before |
| 30 // |cached_network_quality|. |
| 31 bool OlderThan(const CachedNetworkQuality& cached_network_quality) const; |
| 32 |
| 33 // Time when this cache entry was last updated. |
| 34 const base::TimeTicks last_update_time_; |
| 35 |
| 36 // Quality of this cached network. |
| 37 const NetworkQuality network_quality_; |
| 38 |
| 39 private: |
| 40 DISALLOW_ASSIGN(CachedNetworkQuality); |
| 41 }; |
| 42 |
| 43 } // namespace internal |
| 44 |
| 45 } // namespace nqe |
| 46 |
| 47 } // namespace net |
| 48 |
| 49 #endif // NET_NQE_CACHED_NETWORK_QUALITY_H_ |
| OLD | NEW |