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

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

Issue 2391263005: Propagate error messages to UI for blimp. (Closed)
Patch Set: Minor polish. Created 4 years, 2 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/context/blimp_client_context_impl.cc
diff --git a/blimp/client/core/context/blimp_client_context_impl.cc b/blimp/client/core/context/blimp_client_context_impl.cc
index e9eda6ae2de473637f806adc9f7556721a620a36..c3d8d1e9c9e9897ed37e9dfd7f676bf08622d43b 100644
--- a/blimp/client/core/context/blimp_client_context_impl.cc
+++ b/blimp/client/core/context/blimp_client_context_impl.cc
@@ -108,6 +108,8 @@ BlimpClientContextImpl::BlimpClientContextImpl(
RegisterFeatures();
InitializeSettings();
+ connection_status_.AddObserver(this);
+
// Initialize must only be posted after the features have been
// registered.
io_thread_task_runner_->PostTask(
@@ -119,6 +121,7 @@ BlimpClientContextImpl::BlimpClientContextImpl(
BlimpClientContextImpl::~BlimpClientContextImpl() {
io_thread_task_runner_->DeleteSoon(FROM_HERE, net_components_.release());
+ connection_status_.RemoveObserver(this);
}
void BlimpClientContextImpl::SetDelegate(BlimpClientContextDelegate* delegate) {
@@ -254,5 +257,20 @@ void BlimpClientContextImpl::OnImageDecodeError() {
DropConnection();
}
+void BlimpClientContextImpl::OnConnected() {
+ if (delegate_) {
+ delegate_->OnConnected();
+ }
+}
David Trainor- moved to gerrit 2016/10/07 06:58:53 new line after }
xingliu 2016/10/10 17:09:50 Done.
+void BlimpClientContextImpl::OnDisconnected(int result) {
+ if (delegate_) {
+ if (result >= 0) {
+ delegate_->OnEngineDisconnected(result);
+ } else {
+ delegate_->OnNetworkDisconnected(result);
+ }
+ }
+}
+
} // namespace client
} // namespace blimp

Powered by Google App Engine
This is Rietveld 408576698