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 "base/time.h" | 8 #include "base/time.h" |
9 #include "net/base/net_log.h" | 9 #include "net/base/net_log.h" |
10 #include "net/socket/next_proto.h" | 10 #include "net/socket/next_proto.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 // connection wasn't established or the connection is dead. | 49 // connection wasn't established or the connection is dead. |
50 virtual bool IsConnected() const = 0; | 50 virtual bool IsConnected() const = 0; |
51 | 51 |
52 // Called to test if the connection is still alive and idle. Returns false | 52 // Called to test if the connection is still alive and idle. Returns false |
53 // if a connection wasn't established, the connection is dead, or some data | 53 // if a connection wasn't established, the connection is dead, or some data |
54 // have been received. | 54 // have been received. |
55 virtual bool IsConnectedAndIdle() const = 0; | 55 virtual bool IsConnectedAndIdle() const = 0; |
56 | 56 |
57 // Copies the peer address to |address| and returns a network error code. | 57 // Copies the peer address to |address| and returns a network error code. |
58 // ERR_SOCKET_NOT_CONNECTED will be returned if the socket is not connected. | 58 // ERR_SOCKET_NOT_CONNECTED will be returned if the socket is not connected. |
59 // TODO(sergeyu): Use IPEndPoint instead of AddressList. | |
60 virtual int GetPeerAddress(IPEndPoint* address) const = 0; | 59 virtual int GetPeerAddress(IPEndPoint* address) const = 0; |
61 | 60 |
62 // Copies the local address to |address| and returns a network error code. | 61 // Copies the local address to |address| and returns a network error code. |
63 // ERR_SOCKET_NOT_CONNECTED will be returned if the socket is not bound. | 62 // ERR_SOCKET_NOT_CONNECTED will be returned if the socket is not bound. |
64 virtual int GetLocalAddress(IPEndPoint* address) const = 0; | 63 virtual int GetLocalAddress(IPEndPoint* address) const = 0; |
65 | 64 |
66 // Gets the NetLog for this socket. | 65 // Gets the NetLog for this socket. |
67 virtual const BoundNetLog& NetLog() const = 0; | 66 virtual const BoundNetLog& NetLog() const = 0; |
68 | 67 |
69 // Set the annotation to indicate this socket was created for speculative | 68 // Set the annotation to indicate this socket was created for speculative |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 // identify the motivation. | 136 // identify the motivation. |
138 bool omnibox_speculation_; | 137 bool omnibox_speculation_; |
139 bool subresource_speculation_; | 138 bool subresource_speculation_; |
140 DISALLOW_COPY_AND_ASSIGN(UseHistory); | 139 DISALLOW_COPY_AND_ASSIGN(UseHistory); |
141 }; | 140 }; |
142 }; | 141 }; |
143 | 142 |
144 } // namespace net | 143 } // namespace net |
145 | 144 |
146 #endif // NET_SOCKET_STREAM_SOCKET_H_ | 145 #endif // NET_SOCKET_STREAM_SOCKET_H_ |
OLD | NEW |