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

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

Issue 8527018: Refactor ChannelAuthenticator so that it can be used with Authenticator. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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
« no previous file with comments | « remoting/protocol/jingle_stream_connector.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/pepper_stream_channel.h" 5 #include "remoting/protocol/pepper_stream_channel.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "crypto/hmac.h" 8 #include "crypto/hmac.h"
9 #include "jingle/glue/utils.h" 9 #include "jingle/glue/utils.h"
10 #include "net/base/cert_status_flags.h" 10 #include "net/base/cert_status_flags.h"
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 return; 229 return;
230 } 230 }
231 231
232 DCHECK(socket_->IsConnected()); 232 DCHECK(socket_->IsConnected());
233 AuthenticateChannel(); 233 AuthenticateChannel();
234 } 234 }
235 235
236 void PepperStreamChannel::AuthenticateChannel() { 236 void PepperStreamChannel::AuthenticateChannel() {
237 DCHECK(CalledOnValidThread()); 237 DCHECK(CalledOnValidThread());
238 238
239 authenticator_.reset(new ClientChannelAuthenticator(ssl_client_socket_)); 239 authenticator_.reset(
240 authenticator_->Authenticate( 240 new ClientChannelAuthenticator(session_->shared_secret()));
241 session_->shared_secret(), 241 authenticator_->Authenticate(ssl_client_socket_, base::Bind(
242 base::Bind(&PepperStreamChannel::OnAuthenticationDone, 242 &PepperStreamChannel::OnAuthenticationDone, base::Unretained(this)));
243 base::Unretained(this)));
244 } 243 }
245 244
246 void PepperStreamChannel::OnAuthenticationDone( 245 void PepperStreamChannel::OnAuthenticationDone(
247 ChannelAuthenticator::Result result) { 246 ChannelAuthenticator::Result result) {
248 DCHECK(CalledOnValidThread()); 247 DCHECK(CalledOnValidThread());
249 248
250 switch (result) { 249 switch (result) {
251 case ChannelAuthenticator::SUCCESS: 250 case ChannelAuthenticator::SUCCESS:
252 NotifyConnected(socket_.release()); 251 NotifyConnected(socket_.release());
253 break; 252 break;
(...skipping 13 matching lines...) Expand all
267 void PepperStreamChannel::NotifyConnectFailed() { 266 void PepperStreamChannel::NotifyConnectFailed() {
268 channel_ = NULL; 267 channel_ = NULL;
269 owned_channel_.reset(); 268 owned_channel_.reset();
270 socket_.reset(); 269 socket_.reset();
271 270
272 NotifyConnected(NULL); 271 NotifyConnected(NULL);
273 } 272 }
274 273
275 } // namespace protocol 274 } // namespace protocol
276 } // namespace remoting 275 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/protocol/jingle_stream_connector.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698