tbansal | b67539d | 2016-05-16 17:54:13 | [diff] [blame] | 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 | #include "net/nqe/cached_network_quality.h" |
| 6 | |
| 7 | namespace net { |
| 8 | |
| 9 | namespace nqe { |
| 10 | |
| 11 | namespace internal { |
| 12 | |
tbansal | dbfae56 | 2016-08-10 05:40:23 | [diff] [blame] | 13 | CachedNetworkQuality::CachedNetworkQuality() |
| 14 | : effective_connection_type_(EFFECTIVE_CONNECTION_TYPE_UNKNOWN) {} |
tbansal | bff2aec | 2016-07-25 18:28:54 | [diff] [blame] | 15 | |
tbansal | b67539d | 2016-05-16 17:54:13 | [diff] [blame] | 16 | CachedNetworkQuality::CachedNetworkQuality( |
tbansal | 0d42d6c | 2016-10-21 16:01:04 | [diff] [blame] | 17 | EffectiveConnectionType effective_connection_type) |
| 18 | : CachedNetworkQuality(base::TimeTicks::Now(), |
| 19 | NetworkQuality(), |
| 20 | effective_connection_type) {} |
| 21 | |
| 22 | CachedNetworkQuality::CachedNetworkQuality( |
tbansal | bff2aec | 2016-07-25 18:28:54 | [diff] [blame] | 23 | base::TimeTicks last_update_time, |
tbansal | dbfae56 | 2016-08-10 05:40:23 | [diff] [blame] | 24 | const NetworkQuality& network_quality, |
| 25 | EffectiveConnectionType effective_connection_type) |
| 26 | : last_update_time_(last_update_time), |
| 27 | network_quality_(network_quality), |
| 28 | effective_connection_type_(effective_connection_type) {} |
tbansal | b67539d | 2016-05-16 17:54:13 | [diff] [blame] | 29 | |
tbansal | dbfae56 | 2016-08-10 05:40:23 | [diff] [blame] | 30 | CachedNetworkQuality::CachedNetworkQuality(const CachedNetworkQuality& other) = |
| 31 | default; |
tbansal | b67539d | 2016-05-16 17:54:13 | [diff] [blame] | 32 | |
Chris Watkins | f3c65a6 | 2017-12-01 02:06:41 | [diff] [blame] | 33 | CachedNetworkQuality::~CachedNetworkQuality() = default; |
tbansal | b67539d | 2016-05-16 17:54:13 | [diff] [blame] | 34 | |
tbansal | bff2aec | 2016-07-25 18:28:54 | [diff] [blame] | 35 | CachedNetworkQuality& CachedNetworkQuality::operator=( |
tbansal | dbfae56 | 2016-08-10 05:40:23 | [diff] [blame] | 36 | const CachedNetworkQuality& other) = default; |
tbansal | bff2aec | 2016-07-25 18:28:54 | [diff] [blame] | 37 | |
tbansal | b67539d | 2016-05-16 17:54:13 | [diff] [blame] | 38 | bool CachedNetworkQuality::OlderThan( |
| 39 | const CachedNetworkQuality& cached_network_quality) const { |
| 40 | return last_update_time_ < cached_network_quality.last_update_time_; |
| 41 | } |
| 42 | |
| 43 | } // namespace internal |
| 44 | |
| 45 | } // namespace nqe |
| 46 | |
bnc | 3698b0a0 | 2016-12-09 23:36:50 | [diff] [blame] | 47 | } // namespace net |