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

Unified Diff: net/socket/tcp_socket_libevent.cc

Issue 451383002: Plumbing for TCP FastOpen for SSL sockets. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changed one shared bool to a normal bool Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698