Index: net/socket/tcp_socket_libevent.cc |
diff --git a/net/socket/tcp_socket_libevent.cc b/net/socket/tcp_socket_libevent.cc |
index 444e3c04231ce3f5279e56dad7e43d557d7bc86e..3b21b3bfdb83a54bdf35e5e173314b177f358430 100644 |
--- a/net/socket/tcp_socket_libevent.cc |
+++ b/net/socket/tcp_socket_libevent.cc |
@@ -369,6 +369,12 @@ bool TCPSocketLibevent::UsingTCPFastOpen() const { |
return use_tcp_fastopen_; |
} |
+void TCPSocketLibevent::EnableTCPFastOpen() { |
+ if (!use_tcp_fastopen_ && IsTCPFastOpenSupported()) { |
+ use_tcp_fastopen_ = true; |
+ } |
mmenke
2014/08/12 15:25:16
nit: There's a preference not to use braces for s
Jana
2014/08/13 07:33:40
Done.
|
+} |
+ |
bool TCPSocketLibevent::IsValid() const { |
return socket_ != NULL && socket_->socket_fd() != kInvalidSocket; |
} |
@@ -495,7 +501,7 @@ void TCPSocketLibevent::ReadCompleted(const scoped_refptr<IOBuffer>& buf, |
const CompletionCallback& callback, |
int rv) { |
DCHECK_NE(ERR_IO_PENDING, rv); |
- // Records fast open status regardless of error in asynchronous case. |
+ // Records fastopen status regardless of error in asynchronous case. |
mmenke
2014/08/12 15:25:16
nit: Maybe capitalize, too?
|
// TODO(rdsmith,jri): Change histogram name to indicate it could be called on |
// error. |
RecordFastOpenStatus(); |
@@ -597,7 +603,7 @@ void TCPSocketLibevent::RecordFastOpenStatus() { |
bool getsockopt_success(false); |
bool server_acked_data(false); |
#if defined(TCP_INFO) |
- // Probe to see the if the socket used TCP Fast Open. |
+ // Probe to see the if the socket used TCP FastOpen. |
tcp_info info; |
socklen_t info_len = sizeof(tcp_info); |
getsockopt_success = |
@@ -622,5 +628,4 @@ void TCPSocketLibevent::RecordFastOpenStatus() { |
} |
} |
} |
- |
} // namespace net |
mmenke
2014/08/12 15:25:16
nit: keep the blank line before the end of the na
|