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