Roll libjpeg_turbo to git hash 631e2dd119d49794e3572b6ca3f16ee39d59f372
[chromium-blink-merge.git] / net / base / network_quality.cc
blobdc8bc0f36a776618ce6a2af887bb5def28d54eff
1 // Copyright 2015 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.
5 #include "net/base/network_quality.h"
7 #include "base/logging.h"
9 namespace net {
11 const int32_t NetworkQuality::kInvalidThroughput = 0;
13 NetworkQuality::NetworkQuality()
14 : NetworkQuality(InvalidRTT(), kInvalidThroughput) {
17 NetworkQuality::NetworkQuality(const base::TimeDelta& rtt,
18 int32_t downstream_throughput_kbps)
19 : rtt_(rtt), downstream_throughput_kbps_(downstream_throughput_kbps) {
20 DCHECK_GE(rtt_, base::TimeDelta());
21 DCHECK_GE(downstream_throughput_kbps_, 0);
24 NetworkQuality::NetworkQuality(const NetworkQuality& other)
25 : NetworkQuality(other.rtt_, other.downstream_throughput_kbps_) {
28 NetworkQuality::~NetworkQuality() {
31 NetworkQuality& NetworkQuality::operator=(const NetworkQuality& other) {
32 rtt_ = other.rtt_;
33 downstream_throughput_kbps_ = other.downstream_throughput_kbps_;
34 return *this;
37 // static
38 const base::TimeDelta NetworkQuality::InvalidRTT() {
39 return base::TimeDelta::Max();
42 } // namespace net