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

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

Issue 1164713004: Store network quality samples so we can compute percentiles. (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
(Empty)
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.
4
5 #include "net/base/network_quality.h"
6
7 #include "base/logging.h"
8
9 namespace {
10
11 // If two double values are within |kDelta| of each other, they are assumed to
12 // be equal.
13 const double kDelta = 0.001;
14
15 } // namespace
16
17 namespace net {
18
19 NetworkQuality::NetworkQuality(const base::TimeDelta& rtt,
20 uint64_t downlink_throughput_kbps,
21 double confidence)
22 : rtt_(rtt),
23 downlink_throughput_kbps_(downlink_throughput_kbps),
24 confidence_(confidence) {
25 DCHECK_GE(rtt_, base::TimeDelta());
26 DCHECK_GE(downlink_throughput_kbps_, 0U);
27 DCHECK_GE(confidence_, 0 - kDelta);
28 DCHECK_LE(confidence_, 1 + kDelta);
29 }
30
31 NetworkQuality::~NetworkQuality() {
32 }
33
34 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698