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

Unified Diff: net/nqe/socket_watcher_factory.h

Issue 2690113004: Throttle Socket watcher RTT notifications from QUIC (Closed)
Patch Set: ps Created 3 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/nqe/socket_watcher_factory.h
diff --git a/net/nqe/socket_watcher_factory.h b/net/nqe/socket_watcher_factory.h
index 5cffb720426d81f6a2cdb636e117c9b581c97314..c12e703a0db94aeb393cd8f26286e8bca79f91b0 100644
--- a/net/nqe/socket_watcher_factory.h
+++ b/net/nqe/socket_watcher_factory.h
@@ -12,6 +12,7 @@
#include "base/memory/weak_ptr.h"
#include "base/single_thread_task_runner.h"
#include "base/threading/thread_checker.h"
+#include "base/time/time.h"
#include "net/socket/socket_performance_watcher.h"
#include "net/socket/socket_performance_watcher_factory.h"
@@ -38,8 +39,11 @@ class SocketWatcherFactory : public SocketPerformanceWatcherFactory {
// Creates a SocketWatcherFactory. All socket watchers created by
// SocketWatcherFactory call |updated_rtt_observation_callback| on
// |task_runner| every time a new RTT observation is available.
+ // |min_notification_interval| is the minimum interval betweeen consecutive
+ // notifications to the socket watchers created by this factory.
SocketWatcherFactory(
scoped_refptr<base::SingleThreadTaskRunner> task_runner,
+ base::TimeDelta min_notification_interval,
OnUpdatedRTTAvailableCallback updated_rtt_observation_callback);
~SocketWatcherFactory() override;
@@ -51,6 +55,10 @@ class SocketWatcherFactory : public SocketPerformanceWatcherFactory {
private:
scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
+ // Minimum interval betweeen consecutive notifications to the socket watchers
+ // created by this factory.
+ const base::TimeDelta min_notification_interval_;
+
// Called every time a new RTT observation is available.
OnUpdatedRTTAvailableCallback updated_rtt_observation_callback_;

Powered by Google App Engine
This is Rietveld 408576698