| 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 #ifndef NET_BASE_SOCKET_PERFORMANCE_WATCHER_FACTORY_H_ | |
| 6 #define NET_BASE_SOCKET_PERFORMANCE_WATCHER_FACTORY_H_ | |
| 7 | |
| 8 #include <memory> | |
| 9 | |
| 10 #include "base/macros.h" | |
| 11 #include "net/base/net_export.h" | |
| 12 | |
| 13 namespace net { | |
| 14 | |
| 15 class SocketPerformanceWatcher; | |
| 16 | |
| 17 // SocketPerformanceWatcherFactory creates socket performance watcher for | |
| 18 // different type of sockets. | |
| 19 class NET_EXPORT_PRIVATE SocketPerformanceWatcherFactory { | |
| 20 public: | |
| 21 // Transport layer protocol used by the socket that are supported by | |
| 22 // |SocketPerformanceWatcherFactory|. | |
| 23 enum Protocol { PROTOCOL_TCP, PROTOCOL_QUIC }; | |
| 24 | |
| 25 virtual ~SocketPerformanceWatcherFactory() {} | |
| 26 | |
| 27 // Creates a socket performance watcher that will record statistics for a | |
| 28 // single socket that uses |protocol| as the transport layer protocol. | |
| 29 // Implementations must return a valid, unique SocketRecorder for every call; | |
| 30 // recorders must not be shared across calls or objects, nor is nullptr valid. | |
| 31 virtual std::unique_ptr<SocketPerformanceWatcher> | |
| 32 CreateSocketPerformanceWatcher(const Protocol protocol) = 0; | |
| 33 | |
| 34 protected: | |
| 35 SocketPerformanceWatcherFactory() {} | |
| 36 | |
| 37 private: | |
| 38 DISALLOW_COPY_AND_ASSIGN(SocketPerformanceWatcherFactory); | |
| 39 }; | |
| 40 | |
| 41 } // namespace net | |
| 42 | |
| 43 #endif // NET_BASE_SOCKET_PERFORMANCE_WATCHER_FACTORY_H_ | |
| OLD | NEW |