| 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 */)); |
| 439 int status = transport_socket_->Connect(&ssl_connect_callback_); | 440 int status = transport_socket_->Connect(&ssl_connect_callback_); |
| 440 if (status != net::ERR_IO_PENDING) { | 441 if (status != net::ERR_IO_PENDING) { |
| 441 MessageLoop* message_loop = MessageLoop::current(); | 442 MessageLoop* message_loop = MessageLoop::current(); |
| 442 CHECK(message_loop); | 443 CHECK(message_loop); |
| 443 message_loop->PostTask( | 444 message_loop->PostTask( |
| 444 FROM_HERE, | 445 FROM_HERE, |
| 445 scoped_runnable_method_factory_.NewRunnableMethod( | 446 scoped_runnable_method_factory_.NewRunnableMethod( |
| 446 &ChromeAsyncSocket::ProcessSSLConnectDone, status)); | 447 &ChromeAsyncSocket::ProcessSSLConnectDone, status)); |
| 447 } | 448 } |
| 448 return true; | 449 return true; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 467 } | 468 } |
| 468 state_ = STATE_TLS_OPEN; | 469 state_ = STATE_TLS_OPEN; |
| 469 PostDoRead(); | 470 PostDoRead(); |
| 470 if (write_end_ > 0U) { | 471 if (write_end_ > 0U) { |
| 471 PostDoWrite(); | 472 PostDoWrite(); |
| 472 } | 473 } |
| 473 SignalSSLConnected(); | 474 SignalSSLConnected(); |
| 474 } | 475 } |
| 475 | 476 |
| 476 } // namespace notifier | 477 } // namespace notifier |
| OLD | NEW |