#include "net/nqe/socket_watcher.h"
#include "base/functional/bind.h"
#include "base/location.h"
#include "base/task/single_thread_task_runner.h"
#include "base/time/tick_clock.h"
#include "base/time/time.h"
#include "net/base/ip_address.h"
namespace net::nqe::internal {
namespace {
std::optional<IPHash> CalculateIPHash(const IPAddress& ip_addr) { … }
}
SocketWatcher::SocketWatcher(
SocketPerformanceWatcherFactory::Protocol protocol,
const IPAddress& address,
base::TimeDelta min_notification_interval,
bool allow_rtt_private_address,
scoped_refptr<base::SingleThreadTaskRunner> task_runner,
OnUpdatedRTTAvailableCallback updated_rtt_observation_callback,
ShouldNotifyRTTCallback should_notify_rtt_callback,
const base::TickClock* tick_clock)
: … { … }
SocketWatcher::~SocketWatcher() = default;
bool SocketWatcher::ShouldNotifyUpdatedRTT() const { … }
void SocketWatcher::OnUpdatedRTTAvailable(const base::TimeDelta& rtt) { … }
void SocketWatcher::OnConnectionChanged() { … }
}