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 "net/log/net_log.h" | 8 #include "net/log/net_log.h" |
9 #include "net/socket/connection_attempts.h" | |
9 #include "net/socket/next_proto.h" | 10 #include "net/socket/next_proto.h" |
10 #include "net/socket/socket.h" | 11 #include "net/socket/socket.h" |
11 | 12 |
12 namespace net { | 13 namespace net { |
13 | 14 |
14 class AddressList; | 15 class AddressList; |
15 class IPEndPoint; | 16 class IPEndPoint; |
16 class SSLInfo; | 17 class SSLInfo; |
17 | 18 |
18 class NET_EXPORT_PRIVATE StreamSocket : public Socket { | 19 class NET_EXPORT_PRIVATE StreamSocket : public Socket { |
19 public: | 20 public: |
20 ~StreamSocket() override {} | 21 ~StreamSocket() override; |
21 | 22 |
22 // Called to establish a connection. Returns OK if the connection could be | 23 // Called to establish a connection. Returns OK if the connection could be |
23 // established synchronously. Otherwise, ERR_IO_PENDING is returned and the | 24 // established synchronously. Otherwise, ERR_IO_PENDING is returned and the |
24 // given callback will run asynchronously when the connection is established | 25 // given callback will run asynchronously when the connection is established |
25 // or when an error occurs. The result is some other error code if the | 26 // or when an error occurs. The result is some other error code if the |
26 // connection could not be established. | 27 // connection could not be established. |
27 // | 28 // |
28 // The socket's Read and Write methods may not be called until Connect | 29 // The socket's Read and Write methods may not be called until Connect |
29 // succeeds. | 30 // succeeds. |
30 // | 31 // |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
88 virtual bool WasNpnNegotiated() const = 0; | 89 virtual bool WasNpnNegotiated() const = 0; |
89 | 90 |
90 // Returns the protocol negotiated via NPN for this socket, or | 91 // Returns the protocol negotiated via NPN for this socket, or |
91 // kProtoUnknown will be returned if NPN is not applicable. | 92 // kProtoUnknown will be returned if NPN is not applicable. |
92 virtual NextProto GetNegotiatedProtocol() const = 0; | 93 virtual NextProto GetNegotiatedProtocol() const = 0; |
93 | 94 |
94 // Gets the SSL connection information of the socket. Returns false if | 95 // Gets the SSL connection information of the socket. Returns false if |
95 // SSL was not used by this socket. | 96 // SSL was not used by this socket. |
96 virtual bool GetSSLInfo(SSLInfo* ssl_info) = 0; | 97 virtual bool GetSSLInfo(SSLInfo* ssl_info) = 0; |
97 | 98 |
99 virtual void GetConnectionAttempts(ConnectionAttempts* out) const; | |
100 virtual void ClearConnectionAttempts(); | |
Randy Smith (Not in Mondays)
2015/05/12 20:11:09
I'm confused. My sense (please correct me if I'm
Deprecated (see juliatuttle)
2015/05/13 18:22:28
I believe you're wrong; can you point me to an ins
| |
101 virtual void AddConnectionAttempts(const ConnectionAttempts& attempts); | |
Randy Smith (Not in Mondays)
2015/05/12 20:11:09
Also note my earlier comment (different CL?) about
Randy Smith (Not in Mondays)
2015/05/12 20:11:09
So there's a philosophy issue here. I know that,
Deprecated (see juliatuttle)
2015/05/13 18:22:28
Done.
Deprecated (see juliatuttle)
2015/05/13 18:22:28
Will do. Sending comments in the meantime so you c
| |
102 | |
98 protected: | 103 protected: |
99 // The following class is only used to gather statistics about the history of | 104 // The following class is only used to gather statistics about the history of |
100 // a socket. It is only instantiated and used in basic sockets, such as | 105 // a socket. It is only instantiated and used in basic sockets, such as |
101 // TCPClientSocket* instances. Other classes that are derived from | 106 // TCPClientSocket* instances. Other classes that are derived from |
102 // StreamSocket should forward any potential settings to their underlying | 107 // StreamSocket should forward any potential settings to their underlying |
103 // transport sockets. | 108 // transport sockets. |
104 class UseHistory { | 109 class UseHistory { |
105 public: | 110 public: |
106 UseHistory(); | 111 UseHistory(); |
107 ~UseHistory(); | 112 ~UseHistory(); |
(...skipping 26 matching lines...) Expand all Loading... | |
134 // identify the motivation. | 139 // identify the motivation. |
135 bool omnibox_speculation_; | 140 bool omnibox_speculation_; |
136 bool subresource_speculation_; | 141 bool subresource_speculation_; |
137 DISALLOW_COPY_AND_ASSIGN(UseHistory); | 142 DISALLOW_COPY_AND_ASSIGN(UseHistory); |
138 }; | 143 }; |
139 }; | 144 }; |
140 | 145 |
141 } // namespace net | 146 } // namespace net |
142 | 147 |
143 #endif // NET_SOCKET_STREAM_SOCKET_H_ | 148 #endif // NET_SOCKET_STREAM_SOCKET_H_ |
OLD | NEW |