Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1773)

Unified Diff: net/base/network_activity_monitor.h

Issue 992733002: Remove //net (except for Android test stuff) and sdch (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/base/net_util_win.cc ('k') | net/base/network_activity_monitor.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/network_activity_monitor.h
diff --git a/net/base/network_activity_monitor.h b/net/base/network_activity_monitor.h
deleted file mode 100644
index 531947732010a3c9290b1d9a83e2f85ee547a564..0000000000000000000000000000000000000000
--- a/net/base/network_activity_monitor.h
+++ /dev/null
@@ -1,68 +0,0 @@
-// Copyright (c) 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef NET_BASE_NETWORK_ACTIVITY_MONITOR_H_
-#define NET_BASE_NETWORK_ACTIVITY_MONITOR_H_
-
-#include "base/basictypes.h"
-#include "base/lazy_instance.h"
-#include "base/synchronization/lock.h"
-#include "base/time/time.h"
-#include "net/base/net_export.h"
-
-namespace net {
-
-namespace test {
-
-class NetworkActivityMonitorPeer;
-
-} // namespace test
-
-// NetworkActivityMonitor tracks network activity across all sockets and
-// provides cumulative statistics about bytes sent to and received from
-// the network. It uses a lock to ensure thread-safety.
-//
-// There are a few caveats:
-// * Bytes "sent" includes all send attempts and may include
-// some bytes which were actually never sent over the network.
-// * Bytes received includes only bytes actually received from the network,
-// and does not include any bytes read from the the cache.
-// * Network activity not initiated directly using chromium sockets won't
-// be reflected here (for instance DNS queries issued by getaddrinfo()).
-class NET_EXPORT_PRIVATE NetworkActivityMonitor {
- public:
- // Returns the singleton instance of the monitor.
- static NetworkActivityMonitor* GetInstance();
-
- void IncrementBytesReceived(uint64_t bytes_received);
- void IncrementBytesSent(uint64_t bytes_sent);
-
- uint64_t GetBytesReceived() const;
- uint64_t GetBytesSent() const;
-
- base::TimeDelta GetTimeSinceLastReceived() const;
- base::TimeDelta GetTimeSinceLastSent() const;
-
- private:
- friend class test::NetworkActivityMonitorPeer;
-
- NetworkActivityMonitor();
- ~NetworkActivityMonitor();
- friend struct base::DefaultLazyInstanceTraits<NetworkActivityMonitor>;
-
- // Protects all the following members.
- mutable base::Lock lock_;
-
- uint64_t bytes_received_;
- uint64_t bytes_sent_;
-
- base::TimeTicks last_received_ticks_;
- base::TimeTicks last_sent_ticks_;
-
- DISALLOW_COPY_AND_ASSIGN(NetworkActivityMonitor);
-};
-
-} // namespace net
-
-#endif // NET_BASE_NETWORK_ACTIVITY_MONITOR_H_
« no previous file with comments | « net/base/net_util_win.cc ('k') | net/base/network_activity_monitor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698