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

Unified Diff: net/base/socket_performance_watcher.h

Issue 1376473003: Notify NQE of TCP RTT values (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed rsleevi comments 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 side-by-side diff with in-line comments
Download patch
Index: net/base/socket_performance_watcher.h
diff --git a/net/base/socket_performance_watcher.h b/net/base/socket_performance_watcher.h
index e0e76327ce63541e8d0dc2ba23215d34f953df41..51ddb1b66cd14d4e83776004e14d64af2b2a0c57 100644
--- a/net/base/socket_performance_watcher.h
+++ b/net/base/socket_performance_watcher.h
@@ -5,7 +5,9 @@
#ifndef NET_BASE_SOCKET_PERFORMANCE_WATCHER_H_
#define NET_BASE_SOCKET_PERFORMANCE_WATCHER_H_
+#include "base/compiler_specific.h"
#include "base/macros.h"
+#include "base/time/time.h"
#include "net/base/net_export.h"
#include "net/base/socket_performance_watcher_factory.h"
@@ -31,12 +33,28 @@ class NET_EXPORT_PRIVATE SocketPerformanceWatcher {
// must be the transport layer RTT from this device to the remote transport
// layer endpoint. This method is called immediately after the observation is
// made, hence no timestamp.
- void OnUpdatedRTTAvailable(const base::TimeDelta& rtt) const;
+ void OnUpdatedRTTAvailable(const base::TimeDelta& rtt);
+
+ // Returns true if |this| should be notified of the updated RTT value.
+ bool ShouldNotifyUpdatedRTT() const WARN_UNUSED_RESULT;
Ryan Sleevi 2016/03/04 01:38:38 I still don't know how to make sense of this - or
tbansal1 2016/03/04 02:37:53 Yes, that's what I meant.
+
+ // Resets the internal state of this SocketPerformanceWatcher in preparation
+ // for observing a new socket.
+ // Note: The new socket must share the same protocol as the previously
+ // observed socket.
+ void Reset();
private:
// Transport layer protocol used by the socket that |this| is watching.
const SocketPerformanceWatcherFactory::Protocol protocol_;
+ // Time when the last RTT notification was received.
+ base::TimeTicks last_rtt_notification_;
+
+ // Minimum time interval between two successive OnUpdatedRTTAvailable
+ // notifications to |this|.
+ const base::TimeDelta rtt_notification_interval_;
+
// |socket_performance_watcher_factory_| is the factory that created
// |this| watcher.
SocketPerformanceWatcherFactory* socket_performance_watcher_factory_;

Powered by Google App Engine
This is Rietveld 408576698