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

Unified Diff: blimp/client/session/blimp_client_session.h

Issue 1962393004: Added a debug info UI for Blimp (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Built debug UI 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/client/session/blimp_client_session.h
diff --git a/blimp/client/session/blimp_client_session.h b/blimp/client/session/blimp_client_session.h
index 71b4d3d0cf6b953ea465672811788d050b10311a..8cb6dd230cc8690f84b0ec7b47f102139586f457 100644
--- a/blimp/client/session/blimp_client_session.h
+++ b/blimp/client/session/blimp_client_session.h
@@ -13,6 +13,7 @@
#include "base/threading/thread.h"
#include "blimp/client/session/assignment_source.h"
#include "blimp/common/proto/blimp_message.pb.h"
+#include "blimp/net/blimp_connection_details.h"
#include "blimp/net/blimp_message_processor.h"
namespace net {
@@ -53,7 +54,8 @@ class NetworkEventObserver {
// This session glues together the feature proxy components and the network
// layer. The network components must be interacted with on the IO thread. The
// feature proxies must be interacted with on the UI thread.
-class BlimpClientSession : public NetworkEventObserver {
+class BlimpClientSession : public NetworkEventObserver,
+ public NetworkActivityObserver {
public:
explicit BlimpClientSession(const GURL& assigner_endpoint);
@@ -70,6 +72,8 @@ class BlimpClientSession : public NetworkEventObserver {
RenderWidgetFeature* GetRenderWidgetFeature() const;
SettingsFeature* GetSettingsFeature() const;
+ BlimpConnectionDetails* GetBlimpConnectionDetails() const;
+
// The AssignmentCallback for when an assignment is ready. This will trigger
// a connection to the engine.
virtual void ConnectWithAssignment(AssignmentSource::Result result,
@@ -82,10 +86,14 @@ class BlimpClientSession : public NetworkEventObserver {
// assignment request.
virtual void OnAssignmentConnectionAttempted(AssignmentSource::Result result,
const Assignment& assignment);
+ void EnableDebugInfo(bool enable);
private:
void RegisterFeatures();
+ // NetworkActivityObserver implementation.
+ void UpdateDebugInfo(int received, int sent, int commits) override;
+
// NetworkEventObserver implementation.
void OnConnected() override;
void OnDisconnected(int result) override;
@@ -101,6 +109,10 @@ class BlimpClientSession : public NetworkEventObserver {
// Connect() to get a valid assignment and later connect to the engine.
std::unique_ptr<AssignmentSource> assignment_source_;
+ // Collects details of network, such as number of commits and bytes
+ // transferred over network.
+ std::unique_ptr<BlimpConnectionDetails> blimp_connection_details_;
+
// Container struct for network components.
// Must be deleted on the IO thread.
std::unique_ptr<ClientNetworkComponents> net_components_;

Powered by Google App Engine
This is Rietveld 408576698