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

Side by Side Diff: net/socket/tcp_socket_libevent.h

Issue 451383002: Plumbing for TCP FastOpen for SSL sockets. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing linker error for Windows. Created 6 years, 3 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
« no previous file with comments | « net/socket/tcp_socket.cc ('k') | net/socket/tcp_socket_libevent.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #ifndef NET_SOCKET_TCP_SOCKET_LIBEVENT_H_ 5 #ifndef NET_SOCKET_TCP_SOCKET_LIBEVENT_H_
6 #define NET_SOCKET_TCP_SOCKET_LIBEVENT_H_ 6 #define NET_SOCKET_TCP_SOCKET_LIBEVENT_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 // - SetKeepAlive(true, 45). 58 // - SetKeepAlive(true, 45).
59 void SetDefaultOptionsForClient(); 59 void SetDefaultOptionsForClient();
60 int SetAddressReuse(bool allow); 60 int SetAddressReuse(bool allow);
61 int SetReceiveBufferSize(int32 size); 61 int SetReceiveBufferSize(int32 size);
62 int SetSendBufferSize(int32 size); 62 int SetSendBufferSize(int32 size);
63 bool SetKeepAlive(bool enable, int delay); 63 bool SetKeepAlive(bool enable, int delay);
64 bool SetNoDelay(bool no_delay); 64 bool SetNoDelay(bool no_delay);
65 65
66 void Close(); 66 void Close();
67 67
68 // Setter/Getter methods for TCP FastOpen socket option.
68 bool UsingTCPFastOpen() const; 69 bool UsingTCPFastOpen() const;
70 void EnableTCPFastOpenIfSupported();
71
69 bool IsValid() const; 72 bool IsValid() const;
70 73
71 // Marks the start/end of a series of connect attempts for logging purpose. 74 // Marks the start/end of a series of connect attempts for logging purpose.
72 // 75 //
73 // TCPClientSocket may attempt to connect to multiple addresses until it 76 // TCPClientSocket may attempt to connect to multiple addresses until it
74 // succeeds in establishing a connection. The corresponding log will have 77 // succeeds in establishing a connection. The corresponding log will have
75 // multiple NetLog::TYPE_TCP_CONNECT_ATTEMPT entries nested within a 78 // multiple NetLog::TYPE_TCP_CONNECT_ATTEMPT entries nested within a
76 // NetLog::TYPE_TCP_CONNECT. These methods set the start/end of 79 // NetLog::TYPE_TCP_CONNECT. These methods set the start/end of
77 // NetLog::TYPE_TCP_CONNECT. 80 // NetLog::TYPE_TCP_CONNECT.
78 // 81 //
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 int buf_len, 164 int buf_len,
162 const CompletionCallback& callback); 165 const CompletionCallback& callback);
163 166
164 // Called when the socket is known to be in a connected state. 167 // Called when the socket is known to be in a connected state.
165 void RecordFastOpenStatus(); 168 void RecordFastOpenStatus();
166 169
167 scoped_ptr<SocketLibevent> socket_; 170 scoped_ptr<SocketLibevent> socket_;
168 scoped_ptr<SocketLibevent> accept_socket_; 171 scoped_ptr<SocketLibevent> accept_socket_;
169 172
170 // Enables experimental TCP FastOpen option. 173 // Enables experimental TCP FastOpen option.
171 const bool use_tcp_fastopen_; 174 bool use_tcp_fastopen_;
172 175
173 // True when TCP FastOpen is in use and we have done the connect. 176 // True when TCP FastOpen is in use and we have done the connect.
174 bool tcp_fastopen_connected_; 177 bool tcp_fastopen_connected_;
175
176 FastOpenStatus fast_open_status_; 178 FastOpenStatus fast_open_status_;
177 179
178 bool logging_multiple_connect_attempts_; 180 bool logging_multiple_connect_attempts_;
179 181
180 BoundNetLog net_log_; 182 BoundNetLog net_log_;
181 183
182 DISALLOW_COPY_AND_ASSIGN(TCPSocketLibevent); 184 DISALLOW_COPY_AND_ASSIGN(TCPSocketLibevent);
183 }; 185 };
184 186
185 } // namespace net 187 } // namespace net
186 188
187 #endif // NET_SOCKET_TCP_SOCKET_LIBEVENT_H_ 189 #endif // NET_SOCKET_TCP_SOCKET_LIBEVENT_H_
OLDNEW
« no previous file with comments | « net/socket/tcp_socket.cc ('k') | net/socket/tcp_socket_libevent.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698