| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "net/socket/tcp_client_socket.h" | 5 #include "net/socket/tcp_client_socket.h" |
| 6 | 6 |
| 7 #include <errno.h> | 7 #include <errno.h> |
| 8 #include <fcntl.h> | 8 #include <fcntl.h> |
| 9 #include <netdb.h> | 9 #include <netdb.h> |
| 10 #include <sys/socket.h> | 10 #include <sys/socket.h> |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 : socket_(kInvalidSocket), | 129 : socket_(kInvalidSocket), |
| 130 bound_socket_(kInvalidSocket), | 130 bound_socket_(kInvalidSocket), |
| 131 addresses_(addresses), | 131 addresses_(addresses), |
| 132 current_address_index_(-1), | 132 current_address_index_(-1), |
| 133 read_watcher_(this), | 133 read_watcher_(this), |
| 134 write_watcher_(this), | 134 write_watcher_(this), |
| 135 next_connect_state_(CONNECT_STATE_NONE), | 135 next_connect_state_(CONNECT_STATE_NONE), |
| 136 connect_os_error_(0), | 136 connect_os_error_(0), |
| 137 net_log_(BoundNetLog::Make(net_log, NetLog::SOURCE_SOCKET)), | 137 net_log_(BoundNetLog::Make(net_log, NetLog::SOURCE_SOCKET)), |
| 138 previously_disconnected_(false), | 138 previously_disconnected_(false), |
| 139 use_tcp_fastopen_(false), | 139 use_tcp_fastopen_(is_tcp_fastopen_enabled()), |
| 140 tcp_fastopen_connected_(false), | 140 tcp_fastopen_connected_(false), |
| 141 num_bytes_read_(0) { | 141 num_bytes_read_(0) { |
| 142 net_log_.BeginEvent(NetLog::TYPE_SOCKET_ALIVE, | 142 net_log_.BeginEvent(NetLog::TYPE_SOCKET_ALIVE, |
| 143 source.ToEventParametersCallback()); | 143 source.ToEventParametersCallback()); |
| 144 | |
| 145 if (is_tcp_fastopen_enabled()) | |
| 146 use_tcp_fastopen_ = true; | |
| 147 } | 144 } |
| 148 | 145 |
| 149 TCPClientSocketLibevent::~TCPClientSocketLibevent() { | 146 TCPClientSocketLibevent::~TCPClientSocketLibevent() { |
| 150 Disconnect(); | 147 Disconnect(); |
| 151 net_log_.EndEvent(NetLog::TYPE_SOCKET_ALIVE); | 148 net_log_.EndEvent(NetLog::TYPE_SOCKET_ALIVE); |
| 152 } | 149 } |
| 153 | 150 |
| 154 int TCPClientSocketLibevent::AdoptSocket(int socket) { | 151 int TCPClientSocketLibevent::AdoptSocket(int socket) { |
| 155 DCHECK_EQ(socket_, kInvalidSocket); | 152 DCHECK_EQ(socket_, kInvalidSocket); |
| 156 | 153 |
| (...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 783 | 780 |
| 784 NextProto TCPClientSocketLibevent::GetNegotiatedProtocol() const { | 781 NextProto TCPClientSocketLibevent::GetNegotiatedProtocol() const { |
| 785 return kProtoUnknown; | 782 return kProtoUnknown; |
| 786 } | 783 } |
| 787 | 784 |
| 788 bool TCPClientSocketLibevent::GetSSLInfo(SSLInfo* ssl_info) { | 785 bool TCPClientSocketLibevent::GetSSLInfo(SSLInfo* ssl_info) { |
| 789 return false; | 786 return false; |
| 790 } | 787 } |
| 791 | 788 |
| 792 } // namespace net | 789 } // namespace net |
| OLD | NEW |