Index: net/base/socket_performance_watcher.cc |
diff --git a/net/base/socket_performance_watcher.cc b/net/base/socket_performance_watcher.cc |
index aa0dab3b03c9476a8d099bde13e15e9b65668850..3f66cf5035dcf724edc3ffd12716a4cb31c56a7f 100644 |
--- a/net/base/socket_performance_watcher.cc |
+++ b/net/base/socket_performance_watcher.cc |
@@ -12,6 +12,7 @@ SocketPerformanceWatcher::SocketPerformanceWatcher( |
const SocketPerformanceWatcherFactory::Protocol protocol, |
SocketPerformanceWatcherFactory* socket_performance_watcher_factory) |
: protocol_(protocol), |
+ rtt_notification_received_count_(0), |
socket_performance_watcher_factory_(socket_performance_watcher_factory) { |
DCHECK(socket_performance_watcher_factory_); |
@@ -27,8 +28,19 @@ SocketPerformanceWatcher::SocketPerformanceWatcher( |
SocketPerformanceWatcher::~SocketPerformanceWatcher() {} |
void SocketPerformanceWatcher::OnUpdatedRTTAvailable( |
- const base::TimeDelta& rtt) const { |
+ const base::TimeDelta& rtt) { |
+ rtt_notification_received_count_++; |
socket_performance_watcher_factory_->OnUpdatedRTTAvailable(protocol_, rtt); |
} |
+bool SocketPerformanceWatcher::ShouldNotifyUpdatedRTT() const { |
+ // Currently using a small value until crbug.com/590300 is fixed. |
bengr
2016/03/09 17:58:04
Could you elaborate in this comment?
tbansal1
2016/03/09 19:13:11
Done.
|
+ return rtt_notification_received_count_ < 1; |
+} |
+ |
+void SocketPerformanceWatcher::Reset() { |
+ rtt_notification_received_count_ = 0; |
+ socket_performance_watcher_factory_->OnWatcherReset(); |
+} |
+ |
} // namespace net |