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

Unified Diff: blimp/client/core/blimp_client_context_impl.cc

Issue 2322843002: Propagate connection info to Blimp android UI. (Closed)
Patch Set: git cl format.... Created 4 years, 3 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/core/blimp_client_context_impl.cc
diff --git a/blimp/client/core/blimp_client_context_impl.cc b/blimp/client/core/blimp_client_context_impl.cc
index 03e447668e88505c94d75d2cb33e080dafa1f93f..e431cb66052da5da6c27a2c196ad53cd11c4dd56 100644
--- a/blimp/client/core/blimp_client_context_impl.cc
+++ b/blimp/client/core/blimp_client_context_impl.cc
@@ -89,7 +89,8 @@ BlimpClientContextImpl::BlimpClientContextImpl(
weak_factory_(this) {
net_components_.reset(new ClientNetworkComponents(
base::MakeUnique<CrossThreadNetworkEventObserver>(
- weak_factory_.GetWeakPtr(), base::SequencedTaskRunnerHandle::Get())));
+ connection_status_.GetWeakPtr(),
+ base::SequencedTaskRunnerHandle::Get())));
// The |thread_pipe_manager_| must be set up correctly before features are
// registered.
@@ -143,10 +144,6 @@ void BlimpClientContextImpl::ConnectToAssignmentSource(
weak_factory_.GetWeakPtr()));
}
-void BlimpClientContextImpl::OnConnected() {}
-
-void BlimpClientContextImpl::OnDisconnected(int result) {}
-
GURL BlimpClientContextImpl::GetAssignerURL() {
return GURL(kDefaultAssignerUrl);
}
@@ -158,11 +155,19 @@ IdentitySource* BlimpClientContextImpl::GetIdentitySource() {
return identity_source_.get();
}
+ConnectionStatus* BlimpClientContextImpl::GetConnectionStatus() {
+ return &connection_status_;
+}
+
void BlimpClientContextImpl::ConnectWithAssignment(
AssignmentRequestResult result,
const Assignment& assignment) {
VLOG(1) << "Assignment result: " << result;
+ // Cache engine info.
+ connection_status_.OnAssignmentResult(result, assignment);
+
+ // Inform the embedder of the assignment result.
if (delegate_) {
delegate_->OnAssignmentConnectionAttempted(result, assignment);
}
@@ -172,6 +177,7 @@ void BlimpClientContextImpl::ConnectWithAssignment(
return;
}
+ // If we get the assignment, connect to engine.
io_thread_task_runner_->PostTask(
FROM_HERE,
base::Bind(&ClientNetworkComponents::ConnectWithAssignment,

Powered by Google App Engine
This is Rietveld 408576698