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

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

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/client/session/blimp_client_session.cc
diff --git a/blimp/client/session/blimp_client_session.cc b/blimp/client/session/blimp_client_session.cc
index 6dbedcffcb8394b4ba2ebac082568d39d69d7c22..40c3713f1784adcf5684ecb669786c8b1f5d4aca 100644
--- a/blimp/client/session/blimp_client_session.cc
+++ b/blimp/client/session/blimp_client_session.cc
@@ -73,7 +73,8 @@ class ClientNetworkComponents : public ConnectionHandler,
public:
// Can be created on any thread.
explicit ClientNetworkComponents(
- std::unique_ptr<NetworkEventObserver> observer);
+ std::unique_ptr<NetworkEventObserver> observer,
+ BlimpConnectionDetails* blimp_connection_details);
Kevin M 2016/05/10 23:54:24 This is racy. |blimp_connection_details| can be de
shaktisahu 2016/05/16 05:41:38 Okay. I have redesigned now. |blimp_connection_det
~ClientNetworkComponents() override;
// Sets up network components.
@@ -96,13 +97,17 @@ class ClientNetworkComponents : public ConnectionHandler,
std::unique_ptr<ClientConnectionManager> connection_manager_;
std::unique_ptr<NetworkEventObserver> network_observer_;
+ BlimpConnectionDetails* connection_details_;
+
DISALLOW_COPY_AND_ASSIGN(ClientNetworkComponents);
};
ClientNetworkComponents::ClientNetworkComponents(
- std::unique_ptr<NetworkEventObserver> network_observer)
+ std::unique_ptr<NetworkEventObserver> network_observer,
+ BlimpConnectionDetails* details)
: connection_handler_(new BrowserConnectionHandler),
- network_observer_(std::move(network_observer)) {}
+ network_observer_(std::move(network_observer)),
+ connection_details_(details) {}
ClientNetworkComponents::~ClientNetworkComponents() {}
@@ -150,6 +155,7 @@ void ClientNetworkComponents::HandleConnection(
VLOG(1) << "Connection established.";
connection->AddConnectionErrorObserver(this);
network_observer_->OnConnected();
+ connection->SetBlimpConnectionDetails(connection_details_);
connection_handler_->HandleConnection(std::move(connection));
}
@@ -160,16 +166,19 @@ void ClientNetworkComponents::OnConnectionError(int result) {
BlimpClientSession::BlimpClientSession(const GURL& assigner_endpoint)
: io_thread_("BlimpIOThread"),
+ blimp_connection_details_(new BlimpConnectionDetails(this)),
tab_control_feature_(new TabControlFeature),
- navigation_feature_(new NavigationFeature),
+ navigation_feature_(
+ new NavigationFeature(blimp_connection_details_.get())),
ime_feature_(new ImeFeature),
render_widget_feature_(new RenderWidgetFeature),
settings_feature_(new SettingsFeature),
weak_factory_(this) {
net_components_.reset(new ClientNetworkComponents(
base::WrapUnique(new CrossThreadNetworkEventObserver(
- weak_factory_.GetWeakPtr(),
- base::SequencedTaskRunnerHandle::Get()))));
+ weak_factory_.GetWeakPtr(), base::SequencedTaskRunnerHandle::Get())),
+ blimp_connection_details_.get()));
+
base::Thread::Options options;
options.message_loop_type = base::MessageLoop::TYPE_IO;
io_thread_.StartWithOptions(options);
@@ -251,6 +260,10 @@ void BlimpClientSession::RegisterFeatures() {
ime_feature_.get()));
}
+void BlimpClientSession::OnPacketReceived(int bytes) {}
Kevin M 2016/05/10 23:54:24 nit: the name says OnPacketReceived, but the param
shaktisahu 2016/05/16 05:41:38 Method dropped. Now I have only one method called
+
+void BlimpClientSession::OnPacketSent(int bytes) {}
+
void BlimpClientSession::OnConnected() {}
void BlimpClientSession::OnDisconnected(int result) {}

Powered by Google App Engine
This is Rietveld 408576698