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

Unified Diff: net/nqe/socket_watcher_factory.h

Issue 2690113004: Throttle Socket watcher RTT notifications from QUIC (Closed)
Patch Set: Rebased, rch comments 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
« no previous file with comments | « net/nqe/socket_watcher.cc ('k') | net/nqe/socket_watcher_factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..e4fd23fd084ffb41080469c940acbed7f1d37aff 100644
--- a/net/nqe/socket_watcher_factory.h
+++ b/net/nqe/socket_watcher_factory.h
@@ -12,10 +12,12 @@
#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"
namespace base {
+class TickClock;
class TimeDelta;
} // namespace base
@@ -38,9 +40,14 @@ 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. |tick_clock|
+ // is guaranteed to be non-null.
SocketWatcherFactory(
scoped_refptr<base::SingleThreadTaskRunner> task_runner,
- OnUpdatedRTTAvailableCallback updated_rtt_observation_callback);
+ base::TimeDelta min_notification_interval,
+ OnUpdatedRTTAvailableCallback updated_rtt_observation_callback,
+ base::TickClock* tick_clock);
~SocketWatcherFactory() override;
@@ -51,9 +58,15 @@ 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_;
+ base::TickClock* tick_clock_;
+
DISALLOW_COPY_AND_ASSIGN(SocketWatcherFactory);
};
« no previous file with comments | « net/nqe/socket_watcher.cc ('k') | net/nqe/socket_watcher_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698