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

Side by Side Diff: remoting/protocol/connection_to_host.cc

Issue 205583011: [Draft] Fix canceling pin prompt causes host overload (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Unittests and also reject connections upon authenticating Created 6 years, 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/protocol/connection_to_host.h" 5 #include "remoting/protocol/connection_to_host.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "remoting/base/constants.h" 10 #include "remoting/base/constants.h"
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 void ConnectionToHost::OnSessionStateChange( 145 void ConnectionToHost::OnSessionStateChange(
146 Session::State state) { 146 Session::State state) {
147 DCHECK(CalledOnValidThread()); 147 DCHECK(CalledOnValidThread());
148 DCHECK(event_callback_); 148 DCHECK(event_callback_);
149 149
150 switch (state) { 150 switch (state) {
151 case Session::INITIALIZING: 151 case Session::INITIALIZING:
152 case Session::CONNECTING: 152 case Session::CONNECTING:
153 case Session::ACCEPTING: 153 case Session::ACCEPTING:
154 case Session::CONNECTED: 154 case Session::CONNECTED:
155 case Session::AUTHENTICATING:
155 // Don't care about these events. 156 // Don't care about these events.
156 break; 157 break;
157 158
158 case Session::AUTHENTICATED: 159 case Session::AUTHENTICATED:
159 SetState(AUTHENTICATED, OK); 160 SetState(AUTHENTICATED, OK);
160 161
161 control_dispatcher_.reset(new ClientControlDispatcher()); 162 control_dispatcher_.reset(new ClientControlDispatcher());
162 control_dispatcher_->Init( 163 control_dispatcher_->Init(
163 session_.get(), session_->config().control_config(), 164 session_.get(), session_->config().control_config(),
164 base::Bind(&ConnectionToHost::OnChannelInitialized, 165 base::Bind(&ConnectionToHost::OnChannelInitialized,
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 282
282 if (state != state_) { 283 if (state != state_) {
283 state_ = state; 284 state_ = state;
284 error_ = error; 285 error_ = error;
285 event_callback_->OnConnectionState(state_, error_); 286 event_callback_->OnConnectionState(state_, error_);
286 } 287 }
287 } 288 }
288 289
289 } // namespace protocol 290 } // namespace protocol
290 } // namespace remoting 291 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698