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

Unified Diff: net/nqe/socket_watcher_factory.cc

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_factory.h ('k') | net/nqe/socket_watcher_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/nqe/socket_watcher_factory.cc
diff --git a/net/nqe/socket_watcher_factory.cc b/net/nqe/socket_watcher_factory.cc
index 88fa5a94cb201697bd777efed006cd6f4352f418..496dd9bc74cf0d77e5ccc47a099db73b42afd890 100644
--- a/net/nqe/socket_watcher_factory.cc
+++ b/net/nqe/socket_watcher_factory.cc
@@ -4,6 +4,7 @@
#include "net/nqe/socket_watcher_factory.h"
+#include "base/memory/ptr_util.h"
#include "base/time/time.h"
#include "net/nqe/socket_watcher.h"
@@ -15,16 +16,23 @@ namespace internal {
SocketWatcherFactory::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)
: task_runner_(std::move(task_runner)),
- updated_rtt_observation_callback_(updated_rtt_observation_callback) {}
+ min_notification_interval_(min_notification_interval),
+ updated_rtt_observation_callback_(updated_rtt_observation_callback),
+ tick_clock_(tick_clock) {
+ DCHECK(tick_clock_);
+}
SocketWatcherFactory::~SocketWatcherFactory() {}
std::unique_ptr<SocketPerformanceWatcher>
SocketWatcherFactory::CreateSocketPerformanceWatcher(const Protocol protocol) {
- return std::unique_ptr<SocketPerformanceWatcher>(new SocketWatcher(
- protocol, task_runner_, updated_rtt_observation_callback_));
+ return base::MakeUnique<SocketWatcher>(
+ protocol, min_notification_interval_, task_runner_,
+ updated_rtt_observation_callback_, tick_clock_);
}
} // namespace internal
« no previous file with comments | « net/nqe/socket_watcher_factory.h ('k') | net/nqe/socket_watcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698