blob: 2343a1b6dbe1bc54bba859a93c8090c888d388e0 [file] [log] [blame]
tbansalb67539d2016-05-16 17:54:131// 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
7namespace net {
8
9namespace nqe {
10
11namespace internal {
12
tbansaldbfae562016-08-10 05:40:2313CachedNetworkQuality::CachedNetworkQuality()
14 : effective_connection_type_(EFFECTIVE_CONNECTION_TYPE_UNKNOWN) {}
tbansalbff2aec2016-07-25 18:28:5415
tbansalb67539d2016-05-16 17:54:1316CachedNetworkQuality::CachedNetworkQuality(
tbansal0d42d6c2016-10-21 16:01:0417 EffectiveConnectionType effective_connection_type)
18 : CachedNetworkQuality(base::TimeTicks::Now(),
19 NetworkQuality(),
20 effective_connection_type) {}
21
22CachedNetworkQuality::CachedNetworkQuality(
tbansalbff2aec2016-07-25 18:28:5423 base::TimeTicks last_update_time,
tbansaldbfae562016-08-10 05:40:2324 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) {}
tbansalb67539d2016-05-16 17:54:1329
tbansaldbfae562016-08-10 05:40:2330CachedNetworkQuality::CachedNetworkQuality(const CachedNetworkQuality& other) =
31 default;
tbansalb67539d2016-05-16 17:54:1332
Chris Watkinsf3c65a62017-12-01 02:06:4133CachedNetworkQuality::~CachedNetworkQuality() = default;
tbansalb67539d2016-05-16 17:54:1334
tbansalbff2aec2016-07-25 18:28:5435CachedNetworkQuality& CachedNetworkQuality::operator=(
tbansaldbfae562016-08-10 05:40:2336 const CachedNetworkQuality& other) = default;
tbansalbff2aec2016-07-25 18:28:5437
tbansalb67539d2016-05-16 17:54:1338bool 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
bnc3698b0a02016-12-09 23:36:5047} // namespace net