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

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

Issue 7040021: Fix crash condition if caller deletes PseudoTcpAdaptor from within a callback. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Change the flag we supply to Close(). Created 9 years, 7 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
« no previous file with comments | « jingle/glue/pseudotcp_adapter_unittest.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/jingle_session.h" 5 #include "remoting/protocol/jingle_session.h"
6 6
7 #include "base/message_loop.h" 7 #include "base/message_loop.h"
8 #include "crypto/rsa_private_key.h" 8 #include "crypto/rsa_private_key.h"
9 #include "jingle/glue/channel_socket_adapter.h" 9 #include "jingle/glue/channel_socket_adapter.h"
10 #include "jingle/glue/pseudotcp_adapter.h" 10 #include "jingle/glue/pseudotcp_adapter.h"
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 SetState(CONNECTING); 374 SetState(CONNECTING);
375 } 375 }
376 } 376 }
377 377
378 bool JingleSession::EstablishSSLConnection( 378 bool JingleSession::EstablishSSLConnection(
379 net::Socket* channel, scoped_ptr<SocketWrapper>* ssl_socket) { 379 net::Socket* channel, scoped_ptr<SocketWrapper>* ssl_socket) {
380 jingle_glue::PseudoTcpAdapter* pseudotcp = 380 jingle_glue::PseudoTcpAdapter* pseudotcp =
381 new jingle_glue::PseudoTcpAdapter(channel); 381 new jingle_glue::PseudoTcpAdapter(channel);
382 pseudotcp->Connect(&connect_callback_); 382 pseudotcp->Connect(&connect_callback_);
383 383
384 // TODO(wez): We shouldn't try to start SSL until the socket we're
385 // starting it on is connected.
384 if (cricket_session_->initiator()) { 386 if (cricket_session_->initiator()) {
385 // Create client SSL socket. 387 // Create client SSL socket.
386 net::SSLClientSocket* socket = CreateSSLClientSocket( 388 net::SSLClientSocket* socket = CreateSSLClientSocket(
387 pseudotcp, server_cert_, cert_verifier_.get()); 389 pseudotcp, server_cert_, cert_verifier_.get());
388 ssl_socket->reset(new SocketWrapper(socket)); 390 ssl_socket->reset(new SocketWrapper(socket));
389 391
390 int ret = socket->Connect(&ssl_connect_callback_); 392 int ret = socket->Connect(&ssl_connect_callback_);
391 if (ret == net::ERR_IO_PENDING) { 393 if (ret == net::ERR_IO_PENDING) {
392 return true; 394 return true;
393 } else if (ret != net::OK) { 395 } else if (ret != net::OK) {
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
542 544
543 state_ = new_state; 545 state_ = new_state;
544 if (!closed_ && state_change_callback_.get()) 546 if (!closed_ && state_change_callback_.get())
545 state_change_callback_->Run(new_state); 547 state_change_callback_->Run(new_state);
546 } 548 }
547 } 549 }
548 550
549 } // namespace protocol 551 } // namespace protocol
550 552
551 } // namespace remoting 553 } // namespace remoting
OLDNEW
« no previous file with comments | « jingle/glue/pseudotcp_adapter_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698