OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |