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

Unified Diff: blimp/net/blimp_connection_details.h

Issue 1962393004: Added a debug info UI for Blimp (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
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_

Powered by Google App Engine
This is Rietveld 408576698