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

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

Issue 10803027: Fix TCPClientSocket::GetLocalAddress() to work when socket is not connected. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | net/socket/tcp_client_socket_libevent.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 // if a connection wasn't established, the connection is dead, or some data 52 // if a connection wasn't established, the connection is dead, or some data
53 // have been received. 53 // have been received.
54 virtual bool IsConnectedAndIdle() const = 0; 54 virtual bool IsConnectedAndIdle() const = 0;
55 55
56 // Copies the peer address to |address| and returns a network error code. 56 // Copies the peer address to |address| and returns a network error code.
57 // ERR_SOCKET_NOT_CONNECTED will be returned if the socket is not connected. 57 // ERR_SOCKET_NOT_CONNECTED will be returned if the socket is not connected.
58 // TODO(sergeyu): Use IPEndPoint instead of AddressList. 58 // TODO(sergeyu): Use IPEndPoint instead of AddressList.
59 virtual int GetPeerAddress(IPEndPoint* address) const = 0; 59 virtual int GetPeerAddress(IPEndPoint* address) const = 0;
60 60
61 // 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.
62 // ERR_SOCKET_NOT_CONNECTED will be returned if the socket is not connected. 62 // ERR_SOCKET_NOT_CONNECTED will be returned if the socket is not bound.
63 virtual int GetLocalAddress(IPEndPoint* address) const = 0; 63 virtual int GetLocalAddress(IPEndPoint* address) const = 0;
64 64
65 // Gets the NetLog for this socket. 65 // Gets the NetLog for this socket.
66 virtual const BoundNetLog& NetLog() const = 0; 66 virtual const BoundNetLog& NetLog() const = 0;
67 67
68 // Set the annotation to indicate this socket was created for speculative 68 // Set the annotation to indicate this socket was created for speculative
69 // reasons. This call is generally forwarded to a basic TCPClientSocket*, 69 // reasons. This call is generally forwarded to a basic TCPClientSocket*,
70 // where a UseHistory can be updated. 70 // where a UseHistory can be updated.
71 virtual void SetSubresourceSpeculation() = 0; 71 virtual void SetSubresourceSpeculation() = 0;
72 virtual void SetOmniboxSpeculation() = 0; 72 virtual void SetOmniboxSpeculation() = 0;
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 // identify the motivation. 129 // identify the motivation.
130 bool omnibox_speculation_; 130 bool omnibox_speculation_;
131 bool subresource_speculation_; 131 bool subresource_speculation_;
132 DISALLOW_COPY_AND_ASSIGN(UseHistory); 132 DISALLOW_COPY_AND_ASSIGN(UseHistory);
133 }; 133 };
134 }; 134 };
135 135
136 } // namespace net 136 } // namespace net
137 137
138 #endif // NET_SOCKET_STREAM_SOCKET_H_ 138 #endif // NET_SOCKET_STREAM_SOCKET_H_
OLDNEW
« no previous file with comments | « no previous file | net/socket/tcp_client_socket_libevent.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698