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 #ifndef NET_SOCKET_STREAM_SOCKET_H_ | 5 #ifndef NET_SOCKET_STREAM_SOCKET_H_ |
6 #define NET_SOCKET_STREAM_SOCKET_H_ | 6 #define NET_SOCKET_STREAM_SOCKET_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 // reasons. This call is generally forwarded to a basic TCPClientSocket*, | 72 // reasons. This call is generally forwarded to a basic TCPClientSocket*, |
73 // where a UseHistory can be updated. | 73 // where a UseHistory can be updated. |
74 virtual void SetSubresourceSpeculation() = 0; | 74 virtual void SetSubresourceSpeculation() = 0; |
75 virtual void SetOmniboxSpeculation() = 0; | 75 virtual void SetOmniboxSpeculation() = 0; |
76 | 76 |
77 // Returns true if the socket ever had any reads or writes. StreamSockets | 77 // Returns true if the socket ever had any reads or writes. StreamSockets |
78 // layered on top of transport sockets should return if their own Read() or | 78 // layered on top of transport sockets should return if their own Read() or |
79 // Write() methods had been called, not the underlying transport's. | 79 // Write() methods had been called, not the underlying transport's. |
80 virtual bool WasEverUsed() const = 0; | 80 virtual bool WasEverUsed() const = 0; |
81 | 81 |
82 // TODO(jri): Clean up -- remove this method. | |
83 // Returns true if the underlying transport socket is using TCP FastOpen. | |
84 // TCP FastOpen is an experiment with sending data in the TCP SYN packet. | |
85 virtual bool UsingTCPFastOpen() const = 0; | |
86 | |
87 // TODO(jri): Clean up -- rename to a more general EnableAutoConnectOnWrite. | 82 // TODO(jri): Clean up -- rename to a more general EnableAutoConnectOnWrite. |
88 // Enables use of TCP FastOpen for the underlying transport socket. | 83 // Enables use of TCP FastOpen for the underlying transport socket. |
89 virtual void EnableTCPFastOpenIfSupported() {} | 84 virtual void EnableTCPFastOpenIfSupported() {} |
90 | 85 |
91 // Returns true if NPN was negotiated during the connection of this socket. | 86 // Returns true if NPN was negotiated during the connection of this socket. |
92 virtual bool WasNpnNegotiated() const = 0; | 87 virtual bool WasNpnNegotiated() const = 0; |
93 | 88 |
94 // Returns the protocol negotiated via NPN for this socket, or | 89 // Returns the protocol negotiated via NPN for this socket, or |
95 // kProtoUnknown will be returned if NPN is not applicable. | 90 // kProtoUnknown will be returned if NPN is not applicable. |
96 virtual NextProto GetNegotiatedProtocol() const = 0; | 91 virtual NextProto GetNegotiatedProtocol() const = 0; |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 // identify the motivation. | 149 // identify the motivation. |
155 bool omnibox_speculation_; | 150 bool omnibox_speculation_; |
156 bool subresource_speculation_; | 151 bool subresource_speculation_; |
157 DISALLOW_COPY_AND_ASSIGN(UseHistory); | 152 DISALLOW_COPY_AND_ASSIGN(UseHistory); |
158 }; | 153 }; |
159 }; | 154 }; |
160 | 155 |
161 } // namespace net | 156 } // namespace net |
162 | 157 |
163 #endif // NET_SOCKET_STREAM_SOCKET_H_ | 158 #endif // NET_SOCKET_STREAM_SOCKET_H_ |
OLD | NEW |