Only grant permissions to new extensions from sync if they have the expected version
[chromium-blink-merge.git] / net / base / socket_performance_watcher_factory.h
blobfc4767cb5b2fc4879e82e69500ad54f1178ba068
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.
5 #ifndef NET_BASE_SOCKET_PERFORMANCE_WATCHER_FACTORY_H_
6 #define NET_BASE_SOCKET_PERFORMANCE_WATCHER_FACTORY_H_
8 #include "base/macros.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "net/base/net_export.h"
12 namespace net {
14 class SocketRecorder;
16 // SocketPerformanceWatcherFactory creates socket performance watcher for
17 // different type of sockets.
18 class NET_EXPORT_PRIVATE SocketPerformanceWatcherFactory {
19 public:
20 virtual ~SocketPerformanceWatcherFactory() {}
22 // Creates a socket performance watcher that will record statistics for a
23 // single TCP socket. Implementations must return a valid, unique
24 // SocketRecorder for every call; recorders must not be shared across calls
25 // or objects, nor is nullptr valid.
26 virtual scoped_ptr<SocketPerformanceWatcher>
27 CreateTCPSocketPerformanceWatcher() const = 0;
29 // Creates a socket performance watcher that will record statistics for a
30 // single UDP socket. Implementations must return a valid, unique
31 // SocketRecorder for every call; recorders must not be shared across calls
32 // or objects, nor is nullptr valid.
33 virtual scoped_ptr<SocketPerformanceWatcher>
34 CreateUDPSocketPerformanceWatcher() const = 0;
36 protected:
37 SocketPerformanceWatcherFactory() {}
39 private:
40 DISALLOW_COPY_AND_ASSIGN(SocketPerformanceWatcherFactory);
43 } // namespace net
45 #endif // NET_BASE_SOCKET_PERFORMANCE_WATCHER_FACTORY_H_