Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(469)

Side by Side Diff: net/base/network_quality.cc

Issue 1144163008: Add in-memory caching of network quality estimates across network changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 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 #include "net/base/network_quality.h" 5 #include "net/base/network_quality.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 8
9 namespace net { 9 namespace net {
10 10
11 NetworkQuality::NetworkQuality(const base::TimeDelta& rtt, 11 NetworkQuality::NetworkQuality(const base::TimeDelta& rtt,
12 int32_t downstream_throughput_kbps) 12 int32_t downstream_throughput_kbps)
13 : rtt_(rtt), downstream_throughput_kbps_(downstream_throughput_kbps) { 13 : rtt_(rtt), downstream_throughput_kbps_(downstream_throughput_kbps) {
14 DCHECK_GE(rtt_, base::TimeDelta()); 14 DCHECK_GE(rtt_, base::TimeDelta());
15 DCHECK_GE(downstream_throughput_kbps_, 0); 15 DCHECK_GE(downstream_throughput_kbps_, 0);
16 } 16 }
17 17
18 NetworkQuality::NetworkQuality(const NetworkQuality& other)
19 : rtt_(other.rtt_),
20 downstream_throughput_kbps_(other.downstream_throughput_kbps_) {
21 }
22
23 NetworkQuality& NetworkQuality::operator=(const NetworkQuality& other) {
24 rtt_ = other.rtt_;
25 downstream_throughput_kbps_ = other.downstream_throughput_kbps_;
26 return *this;
27 }
28
18 NetworkQuality::~NetworkQuality() { 29 NetworkQuality::~NetworkQuality() {
19 } 30 }
20 31
21 } // namespace net 32 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698