Index: blimp/net/blimp_connection_details.h |
diff --git a/blimp/net/blimp_connection_details.h b/blimp/net/blimp_connection_details.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..c912adfda7ca75ed8fbaa45f7c5dd69406e834d1 |
--- /dev/null |
+++ b/blimp/net/blimp_connection_details.h |
@@ -0,0 +1,43 @@ |
+// Copyright 2016 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 BLIMP_NET_BLIMP_CONNECTION_DETAILS_H_ |
+#define BLIMP_NET_BLIMP_CONNECTION_DETAILS_H_ |
+ |
+#include "base/macros.h" |
+#include "blimp/net/blimp_net_export.h" |
+ |
+namespace blimp { |
+ |
+class NetworkActivityObserver { |
Kevin M
2016/05/10 23:54:24
Push a NetLog object down the layers to collect by
shaktisahu
2016/05/11 22:08:00
Apparently the NetLog::ThreadSafeObserver is depre
|
+ public: |
+ virtual void OnPacketReceived(int bytes) = 0; |
+ virtual void OnPacketSent(int bytes) = 0; |
+}; |
+ |
+// Collects network traffic information like packets received and sent over a |
+// blimp a network connection. |
+class BLIMP_NET_EXPORT BlimpConnectionDetails { |
+ public: |
+ BlimpConnectionDetails(NetworkActivityObserver* observer); |
+ |
+ ~BlimpConnectionDetails(); |
+ |
+ void OnPacketReceived(int bytes); |
+ void OnPacketSent(int bytes); |
+ |
+ void ResetStats(); |
+ |
+ protected: |
+ private: |
+ int bytes_received_; |
+ int bytes_sent_; |
+ NetworkActivityObserver* observer_ = nullptr; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(BlimpConnectionDetails); |
+}; |
+ |
+} // namespace blimp |
+ |
+#endif // BLIMP_NET_BLIMP_CONNECTION_DETAILS_H_ |