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..5a9650d657d41bdd86e3934f654542cf2e73fe56 100644 |
--- a/net/base/socket_performance_watcher.h |
+++ b/net/base/socket_performance_watcher.h |
@@ -5,6 +5,9 @@ |
#ifndef NET_BASE_SOCKET_PERFORMANCE_WATCHER_H_ |
#define NET_BASE_SOCKET_PERFORMANCE_WATCHER_H_ |
+#include <stddef.h> |
+ |
+#include "base/compiler_specific.h" |
#include "base/macros.h" |
#include "net/base/net_export.h" |
#include "net/base/socket_performance_watcher_factory.h" |
@@ -25,18 +28,34 @@ class NET_EXPORT_PRIVATE SocketPerformanceWatcher { |
const SocketPerformanceWatcherFactory::Protocol protocol, |
SocketPerformanceWatcherFactory* socket_performance_watcher_factory); |
- virtual ~SocketPerformanceWatcher(); |
+ ~SocketPerformanceWatcher(); |
// Called when updated transport layer RTT information is available. This |
// 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 the current SocketPerformanceWatcher is interested |
+ // in receiving a new RTT estimate (via OnUpdatedRTTAvailable). |
+ // Callers may use this to avoid doing expensive work computing the |
+ // RTT when the SocketPerformanceWatcher is not interested in such |
+ // updates. |
+ bool ShouldNotifyUpdatedRTT() const WARN_UNUSED_RESULT; |
+ |
+ // 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_; |
+ // Number of RTT notifications received. |
+ size_t rtt_notification_received_count_; |
+ |
// |socket_performance_watcher_factory_| is the factory that created |
// |this| watcher. |
SocketPerformanceWatcherFactory* socket_performance_watcher_factory_; |