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

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

Issue 451383002: Plumbing for TCP FastOpen for SSL sockets. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved TFO enabling to client_socket_pool_manager and cleaned up tcp_socket.cc (added tcp_socket.cc … 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 unified diff | Download patch
OLDNEW
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 #ifndef NET_SOCKET_TRANSPORT_CLIENT_SOCKET_POOL_H_ 5 #ifndef NET_SOCKET_TRANSPORT_CLIENT_SOCKET_POOL_H_
6 #define NET_SOCKET_TRANSPORT_CLIENT_SOCKET_POOL_H_ 6 #define NET_SOCKET_TRANSPORT_CLIENT_SOCKET_POOL_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 25 matching lines...) Expand all
36 const HostPortPair& host_port_pair, 36 const HostPortPair& host_port_pair,
37 bool disable_resolver_cache, 37 bool disable_resolver_cache,
38 bool ignore_limits, 38 bool ignore_limits,
39 const OnHostResolutionCallback& host_resolution_callback); 39 const OnHostResolutionCallback& host_resolution_callback);
40 40
41 const HostResolver::RequestInfo& destination() const { return destination_; } 41 const HostResolver::RequestInfo& destination() const { return destination_; }
42 bool ignore_limits() const { return ignore_limits_; } 42 bool ignore_limits() const { return ignore_limits_; }
43 const OnHostResolutionCallback& host_resolution_callback() const { 43 const OnHostResolutionCallback& host_resolution_callback() const {
44 return host_resolution_callback_; 44 return host_resolution_callback_;
45 } 45 }
46 void enable_use_tcp_fastopen() { use_tcp_fastopen_ = true; }
47 bool use_tcp_fastopen() const { return use_tcp_fastopen_; }
46 48
47 private: 49 private:
48 friend class base::RefCounted<TransportSocketParams>; 50 friend class base::RefCounted<TransportSocketParams>;
49 ~TransportSocketParams(); 51 ~TransportSocketParams();
50 52
51 HostResolver::RequestInfo destination_; 53 HostResolver::RequestInfo destination_;
52 bool ignore_limits_; 54 bool ignore_limits_;
53 const OnHostResolutionCallback host_resolution_callback_; 55 const OnHostResolutionCallback host_resolution_callback_;
56 bool use_tcp_fastopen_;
mmenke 2014/08/14 17:56:03 Maybe use_tcp_fastopen_if_supported_?
Jana 2014/08/15 20:00:07 Done.
54 57
55 DISALLOW_COPY_AND_ASSIGN(TransportSocketParams); 58 DISALLOW_COPY_AND_ASSIGN(TransportSocketParams);
56 }; 59 };
57 60
58 // Common data and logic shared between TransportConnectJob and 61 // Common data and logic shared between TransportConnectJob and
59 // WebSocketTransportConnectJob. 62 // WebSocketTransportConnectJob.
60 class NET_EXPORT_PRIVATE TransportConnectJobHelper { 63 class NET_EXPORT_PRIVATE TransportConnectJobHelper {
61 public: 64 public:
62 enum State { 65 enum State {
63 STATE_RESOLVE_HOST, 66 STATE_RESOLVE_HOST,
(...skipping 19 matching lines...) Expand all
83 ~TransportConnectJobHelper(); 86 ~TransportConnectJobHelper();
84 87
85 ClientSocketFactory* client_socket_factory() { 88 ClientSocketFactory* client_socket_factory() {
86 return client_socket_factory_; 89 return client_socket_factory_;
87 } 90 }
88 91
89 const AddressList& addresses() const { return addresses_; } 92 const AddressList& addresses() const { return addresses_; }
90 State next_state() const { return next_state_; } 93 State next_state() const { return next_state_; }
91 void set_next_state(State next_state) { next_state_ = next_state; } 94 void set_next_state(State next_state) { next_state_ = next_state; }
92 CompletionCallback on_io_complete() const { return on_io_complete_; } 95 CompletionCallback on_io_complete() const { return on_io_complete_; }
96 const TransportSocketParams* params() { return params_.get(); }
93 97
94 int DoResolveHost(RequestPriority priority, const BoundNetLog& net_log); 98 int DoResolveHost(RequestPriority priority, const BoundNetLog& net_log);
95 int DoResolveHostComplete(int result, const BoundNetLog& net_log); 99 int DoResolveHostComplete(int result, const BoundNetLog& net_log);
96 100
97 template <class T> 101 template <class T>
98 int DoConnectInternal(T* job); 102 int DoConnectInternal(T* job);
99 103
100 template <class T> 104 template <class T>
101 void SetOnIOComplete(T* job); 105 void SetOnIOComplete(T* job);
102 106
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 break; 337 break;
334 } 338 }
335 } while (rv != ERR_IO_PENDING && next_state_ != STATE_NONE); 339 } while (rv != ERR_IO_PENDING && next_state_ != STATE_NONE);
336 340
337 return rv; 341 return rv;
338 } 342 }
339 343
340 } // namespace net 344 } // namespace net
341 345
342 #endif // NET_SOCKET_TRANSPORT_CLIENT_SOCKET_POOL_H_ 346 #endif // NET_SOCKET_TRANSPORT_CLIENT_SOCKET_POOL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698