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

Side by Side Diff: remoting/client/chromoting_session.cc

Issue 2971903002: Adding error handling to the connection flow. (Closed)
Patch Set: Minor cleanup before review. Created 3 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "remoting/client/chromoting_session.h" 5 #include "remoting/client/chromoting_session.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback_helpers.h" 10 #include "base/callback_helpers.h"
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 logger_->LogSessionStateChange(ClientTelemetryLogger::TranslateState(state), 270 logger_->LogSessionStateChange(ClientTelemetryLogger::TranslateState(state),
271 ClientTelemetryLogger::TranslateError(error)); 271 ClientTelemetryLogger::TranslateError(error));
272 272
273 if (create_pairing_ && state == protocol::ConnectionToHost::CONNECTED) { 273 if (create_pairing_ && state == protocol::ConnectionToHost::CONNECTED) {
274 protocol::PairingRequest request; 274 protocol::PairingRequest request;
275 DCHECK(!device_name_.empty()); 275 DCHECK(!device_name_.empty());
276 request.set_client_name(device_name_); 276 request.set_client_name(device_name_);
277 client_->host_stub()->RequestPairing(request); 277 client_->host_stub()->RequestPairing(request);
278 } 278 }
279 279
280 if (state == protocol::ConnectionToHost::FAILED) {
281 remoting::SignalStrategy::Error err = signaling_->GetError();
Yuwei 2017/07/05 21:43:41 Where is err used?
nicholss 2017/07/06 20:49:01 Sorry, this was debug, I had already removed it in
282 }
283
280 runtime_->ui_task_runner()->PostTask( 284 runtime_->ui_task_runner()->PostTask(
281 FROM_HERE, base::Bind(&ChromotingSession::Delegate::OnConnectionState, 285 FROM_HERE, base::Bind(&ChromotingSession::Delegate::OnConnectionState,
282 delegate_, state, error)); 286 delegate_, state, error));
283 } 287 }
284 288
285 void ChromotingSession::OnConnectionReady(bool ready) { 289 void ChromotingSession::OnConnectionReady(bool ready) {
286 // We ignore this message, since OnConnectionState tells us the same thing. 290 // We ignore this message, since OnConnectionState tells us the same thing.
287 } 291 }
288 292
289 void ChromotingSession::OnRouteChanged(const std::string& channel_name, 293 void ChromotingSession::OnRouteChanged(const std::string& channel_name,
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 video_renderer_.reset(); 453 video_renderer_.reset();
450 signaling_.reset(); 454 signaling_.reset();
451 perf_tracker_.reset(); 455 perf_tracker_.reset();
452 client_context_.reset(); 456 client_context_.reset();
453 cursor_shape_stub_.reset(); 457 cursor_shape_stub_.reset();
454 458
455 weak_factory_.InvalidateWeakPtrs(); 459 weak_factory_.InvalidateWeakPtrs();
456 } 460 }
457 461
458 } // namespace remoting 462 } // namespace remoting
OLDNEW
« no previous file with comments | « no previous file | remoting/ios/app/BUILD.gn » ('j') | remoting/ios/app/client_connection_view_controller.mm » ('J')

Powered by Google App Engine
This is Rietveld 408576698