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

Side by Side Diff: net/base/socket_performance_watcher.h

Issue 1672513002: Expose packet loss counts from QUIC to NetworkQualityEstimator (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 #ifndef NET_BASE_SOCKET_PERFORMANCE_WATCHER_H_ 5 #ifndef NET_BASE_SOCKET_PERFORMANCE_WATCHER_H_
6 #define NET_BASE_SOCKET_PERFORMANCE_WATCHER_H_ 6 #define NET_BASE_SOCKET_PERFORMANCE_WATCHER_H_
7 7
8 #include <stdint.h>
9
8 #include "base/macros.h" 10 #include "base/macros.h"
9 #include "net/base/net_export.h" 11 #include "net/base/net_export.h"
10 #include "net/base/socket_performance_watcher_factory.h" 12 #include "net/base/socket_performance_watcher_factory.h"
11 13
12 namespace base { 14 namespace base {
13 class TimeDelta; 15 class TimeDelta;
14 } // namespace base 16 } // namespace base
15 17
16 namespace net { 18 namespace net {
17 19
18 // SocketPerformanceWatcher is the base class for recording and aggregating 20 // SocketPerformanceWatcher is the base class for recording and aggregating
19 // socket statistics. 21 // socket statistics.
20 class NET_EXPORT_PRIVATE SocketPerformanceWatcher { 22 class NET_EXPORT_PRIVATE SocketPerformanceWatcher {
21 public: 23 public:
22 // |socket_performance_watcher_factory| is the factory that constructed 24 // |socket_performance_watcher_factory| is the factory that constructed
23 // |this| watcher. 25 // |this| watcher.
24 SocketPerformanceWatcher( 26 SocketPerformanceWatcher(
25 const SocketPerformanceWatcherFactory::Protocol protocol, 27 const SocketPerformanceWatcherFactory::Protocol protocol,
26 SocketPerformanceWatcherFactory* socket_performance_watcher_factory); 28 SocketPerformanceWatcherFactory* socket_performance_watcher_factory);
27 29
28 virtual ~SocketPerformanceWatcher(); 30 virtual ~SocketPerformanceWatcher();
29 31
30 // Called when updated transport layer RTT information is available. This 32 // Called when updated transport layer RTT information is available. This
31 // must be the transport layer RTT from this device to the remote transport 33 // must be the transport layer RTT from this device to the remote transport
32 // layer endpoint. This method is called immediately after the observation is 34 // layer endpoint. This method is called immediately after the observation is
33 // made, hence no timestamp. 35 // made, hence no timestamp.
34 void OnUpdatedRTTAvailable(const base::TimeDelta& rtt) const; 36 void OnUpdatedRTTAvailable(const base::TimeDelta& rtt) const;
35 37
38 // Called when updated packet count at transport layer is available.
bengr 2016/02/09 15:41:03 when -> when an at -> at the
tbansal1 2016/02/09 17:54:12 Done.
39 // |num_packets_lost| is the number of packets lost.
40 // |num_packets_received_in_order| is the number of packets received in
41 // order. |num_packets_received_not_in_order| is the number of packets
42 // received out of order. All the counts are since the last call to the
43 // OnUpdatedPacketCountAvailable. This method is called immediately after the
44 // observation is made, hence no timestamp.
45 void OnUpdatedPacketCountAvailable(
46 uint64_t num_packets_lost,
47 uint64_t num_packets_received_in_order,
48 uint64_t num_packets_received_not_in_order) const;
49
36 private: 50 private:
37 // Transport layer protocol used by the socket that |this| is watching. 51 // Transport layer protocol used by the socket that |this| is watching.
38 const SocketPerformanceWatcherFactory::Protocol protocol_; 52 const SocketPerformanceWatcherFactory::Protocol protocol_;
39 53
40 // |socket_performance_watcher_factory_| is the factory that created 54 // |socket_performance_watcher_factory_| is the factory that created
41 // |this| watcher. 55 // |this| watcher.
42 SocketPerformanceWatcherFactory* socket_performance_watcher_factory_; 56 SocketPerformanceWatcherFactory* socket_performance_watcher_factory_;
43 57
44 DISALLOW_COPY_AND_ASSIGN(SocketPerformanceWatcher); 58 DISALLOW_COPY_AND_ASSIGN(SocketPerformanceWatcher);
45 }; 59 };
46 60
47 } // namespace net 61 } // namespace net
48 62
49 #endif // NET_BASE_SOCKET_PERFORMANCE_WATCHER_H_ 63 #endif // NET_BASE_SOCKET_PERFORMANCE_WATCHER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698