| OLD | NEW |
| (Empty) |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "net/base/socket_performance_watcher.h" | |
| 6 | |
| 7 #include "base/logging.h" | |
| 8 | |
| 9 namespace net { | |
| 10 | |
| 11 SocketPerformanceWatcher::SocketPerformanceWatcher( | |
| 12 const SocketPerformanceWatcherFactory::Protocol protocol, | |
| 13 SocketPerformanceWatcherFactory* socket_performance_watcher_factory) | |
| 14 : protocol_(protocol), | |
| 15 socket_performance_watcher_factory_(socket_performance_watcher_factory) { | |
| 16 DCHECK(socket_performance_watcher_factory_); | |
| 17 | |
| 18 switch (protocol) { | |
| 19 case SocketPerformanceWatcherFactory::PROTOCOL_TCP: | |
| 20 case SocketPerformanceWatcherFactory::PROTOCOL_QUIC: | |
| 21 return; | |
| 22 default: | |
| 23 NOTREACHED(); | |
| 24 } | |
| 25 } | |
| 26 | |
| 27 SocketPerformanceWatcher::~SocketPerformanceWatcher() {} | |
| 28 | |
| 29 void SocketPerformanceWatcher::OnUpdatedRTTAvailable( | |
| 30 const base::TimeDelta& rtt) const { | |
| 31 socket_performance_watcher_factory_->OnUpdatedRTTAvailable(protocol_, rtt); | |
| 32 } | |
| 33 | |
| 34 } // namespace net | |
| OLD | NEW |