Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "net/nqe/socket_watcher_factory.h" | 5 #include "net/nqe/socket_watcher_factory.h" |
| 6 | 6 |
| 7 #include "base/time/time.h" | 7 #include "base/time/time.h" |
| 8 #include "net/nqe/socket_watcher.h" | 8 #include "net/nqe/socket_watcher.h" |
| 9 | 9 |
| 10 namespace net { | 10 namespace net { |
| 11 | 11 |
| 12 namespace nqe { | 12 namespace nqe { |
| 13 | 13 |
| 14 namespace internal { | 14 namespace internal { |
| 15 | 15 |
| 16 SocketWatcherFactory::SocketWatcherFactory( | 16 SocketWatcherFactory::SocketWatcherFactory( |
| 17 scoped_refptr<base::SingleThreadTaskRunner> task_runner, | 17 scoped_refptr<base::SingleThreadTaskRunner> task_runner, |
| 18 base::TimeDelta min_notification_interval, | |
| 18 OnUpdatedRTTAvailableCallback updated_rtt_observation_callback) | 19 OnUpdatedRTTAvailableCallback updated_rtt_observation_callback) |
| 19 : task_runner_(std::move(task_runner)), | 20 : task_runner_(std::move(task_runner)), |
| 21 min_notification_interval_(min_notification_interval), | |
| 20 updated_rtt_observation_callback_(updated_rtt_observation_callback) {} | 22 updated_rtt_observation_callback_(updated_rtt_observation_callback) {} |
| 21 | 23 |
| 22 SocketWatcherFactory::~SocketWatcherFactory() {} | 24 SocketWatcherFactory::~SocketWatcherFactory() {} |
| 23 | 25 |
| 24 std::unique_ptr<SocketPerformanceWatcher> | 26 std::unique_ptr<SocketPerformanceWatcher> |
| 25 SocketWatcherFactory::CreateSocketPerformanceWatcher(const Protocol protocol) { | 27 SocketWatcherFactory::CreateSocketPerformanceWatcher(const Protocol protocol) { |
| 26 return std::unique_ptr<SocketPerformanceWatcher>(new SocketWatcher( | 28 return std::unique_ptr<SocketPerformanceWatcher>( |
|
RyanSturm
2017/02/15 17:42:08
change this to make_unique while you're here.
tbansal1
2017/02/15 20:37:42
Done.
| |
| 27 protocol, task_runner_, updated_rtt_observation_callback_)); | 29 new SocketWatcher(protocol, min_notification_interval_, task_runner_, |
| 30 updated_rtt_observation_callback_)); | |
| 28 } | 31 } |
| 29 | 32 |
| 30 } // namespace internal | 33 } // namespace internal |
| 31 | 34 |
| 32 } // namespace nqe | 35 } // namespace nqe |
| 33 | 36 |
| 34 } // namespace net | 37 } // namespace net |
| OLD | NEW |