OLD | NEW |
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2014 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 #ifndef NET_BASE_NETWORK_ACTIVITY_MONITOR_H_ | 5 #ifndef NET_BASE_NETWORK_ACTIVITY_MONITOR_H_ |
6 #define NET_BASE_NETWORK_ACTIVITY_MONITOR_H_ | 6 #define NET_BASE_NETWORK_ACTIVITY_MONITOR_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 uint64_t GetBytesSent() const; | 44 uint64_t GetBytesSent() const; |
45 | 45 |
46 base::TimeDelta GetTimeSinceLastReceived() const; | 46 base::TimeDelta GetTimeSinceLastReceived() const; |
47 base::TimeDelta GetTimeSinceLastSent() const; | 47 base::TimeDelta GetTimeSinceLastSent() const; |
48 | 48 |
49 private: | 49 private: |
50 friend class test::NetworkActivityMonitorPeer; | 50 friend class test::NetworkActivityMonitorPeer; |
51 | 51 |
52 NetworkActivityMonitor(); | 52 NetworkActivityMonitor(); |
53 ~NetworkActivityMonitor(); | 53 ~NetworkActivityMonitor(); |
54 friend struct base::DefaultLazyInstanceTraits<NetworkActivityMonitor>; | 54 friend struct base::LazyInstanceTraitsBase<NetworkActivityMonitor>; |
55 | 55 |
56 // Protects all the following members. | 56 // Protects all the following members. |
57 mutable base::Lock lock_; | 57 mutable base::Lock lock_; |
58 | 58 |
59 uint64_t bytes_received_; | 59 uint64_t bytes_received_; |
60 uint64_t bytes_sent_; | 60 uint64_t bytes_sent_; |
61 | 61 |
62 base::TimeTicks last_received_ticks_; | 62 base::TimeTicks last_received_ticks_; |
63 base::TimeTicks last_sent_ticks_; | 63 base::TimeTicks last_sent_ticks_; |
64 | 64 |
65 DISALLOW_COPY_AND_ASSIGN(NetworkActivityMonitor); | 65 DISALLOW_COPY_AND_ASSIGN(NetworkActivityMonitor); |
66 }; | 66 }; |
67 | 67 |
68 } // namespace net | 68 } // namespace net |
69 | 69 |
70 #endif // NET_BASE_NETWORK_ACTIVITY_MONITOR_H_ | 70 #endif // NET_BASE_NETWORK_ACTIVITY_MONITOR_H_ |
OLD | NEW |