| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "jingle/notifier/base/chrome_async_socket.h" | 5 #include "jingle/notifier/base/chrome_async_socket.h" |
| 6 | 6 |
| 7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <winsock2.h> | 8 #include <winsock2.h> |
| 9 #elif defined(OS_POSIX) | 9 #elif defined(OS_POSIX) |
| 10 #include <arpa/inet.h> | 10 #include <arpa/inet.h> |
| (...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 428 read_start_ = 0U; | 428 read_start_ = 0U; |
| 429 read_end_ = 0U; | 429 read_end_ = 0U; |
| 430 DCHECK_EQ(write_end_, 0U); | 430 DCHECK_EQ(write_end_, 0U); |
| 431 | 431 |
| 432 // Clear out any posted DoRead() tasks. | 432 // Clear out any posted DoRead() tasks. |
| 433 scoped_runnable_method_factory_.RevokeAll(); | 433 scoped_runnable_method_factory_.RevokeAll(); |
| 434 | 434 |
| 435 DCHECK(transport_socket_.get()); | 435 DCHECK(transport_socket_.get()); |
| 436 transport_socket_.reset( | 436 transport_socket_.reset( |
| 437 client_socket_factory_->CreateSSLClientSocket( | 437 client_socket_factory_->CreateSSLClientSocket( |
| 438 transport_socket_.release(), domain_name, ssl_config_, | 438 transport_socket_.release(), domain_name, ssl_config_)); |
| 439 NULL /* ssl_host_info */)); | |
| 440 int status = transport_socket_->Connect(&ssl_connect_callback_); | 439 int status = transport_socket_->Connect(&ssl_connect_callback_); |
| 441 if (status != net::ERR_IO_PENDING) { | 440 if (status != net::ERR_IO_PENDING) { |
| 442 MessageLoop* message_loop = MessageLoop::current(); | 441 MessageLoop* message_loop = MessageLoop::current(); |
| 443 CHECK(message_loop); | 442 CHECK(message_loop); |
| 444 message_loop->PostTask( | 443 message_loop->PostTask( |
| 445 FROM_HERE, | 444 FROM_HERE, |
| 446 scoped_runnable_method_factory_.NewRunnableMethod( | 445 scoped_runnable_method_factory_.NewRunnableMethod( |
| 447 &ChromeAsyncSocket::ProcessSSLConnectDone, status)); | 446 &ChromeAsyncSocket::ProcessSSLConnectDone, status)); |
| 448 } | 447 } |
| 449 return true; | 448 return true; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 468 } | 467 } |
| 469 state_ = STATE_TLS_OPEN; | 468 state_ = STATE_TLS_OPEN; |
| 470 PostDoRead(); | 469 PostDoRead(); |
| 471 if (write_end_ > 0U) { | 470 if (write_end_ > 0U) { |
| 472 PostDoWrite(); | 471 PostDoWrite(); |
| 473 } | 472 } |
| 474 SignalSSLConnected(); | 473 SignalSSLConnected(); |
| 475 } | 474 } |
| 476 | 475 |
| 477 } // namespace notifier | 476 } // namespace notifier |
| OLD | NEW |