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

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

Issue 6930014: Rename ClientSocket to StreamSocket. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 7 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 | « net/socket/stream_socket.cc ('k') | net/socket/tcp_client_socket_win.h » ('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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_TCP_CLIENT_SOCKET_LIBEVENT_H_ 5 #ifndef NET_SOCKET_TCP_CLIENT_SOCKET_LIBEVENT_H_
6 #define NET_SOCKET_TCP_CLIENT_SOCKET_LIBEVENT_H_ 6 #define NET_SOCKET_TCP_CLIENT_SOCKET_LIBEVENT_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
11 #include "base/message_loop.h" 11 #include "base/message_loop.h"
12 #include "base/threading/non_thread_safe.h" 12 #include "base/threading/non_thread_safe.h"
13 #include "net/base/address_list.h" 13 #include "net/base/address_list.h"
14 #include "net/base/completion_callback.h" 14 #include "net/base/completion_callback.h"
15 #include "net/base/net_log.h" 15 #include "net/base/net_log.h"
16 #include "net/socket/client_socket.h" 16 #include "net/socket/stream_socket.h"
17 17
18 struct event; // From libevent 18 struct event; // From libevent
19 19
20 namespace net { 20 namespace net {
21 21
22 class BoundNetLog; 22 class BoundNetLog;
23 23
24 // A client socket that uses TCP as the transport layer. 24 // A client socket that uses TCP as the transport layer.
25 class TCPClientSocketLibevent : public ClientSocket, base::NonThreadSafe { 25 class TCPClientSocketLibevent : public StreamSocket, base::NonThreadSafe {
26 public: 26 public:
27 // The IP address(es) and port number to connect to. The TCP socket will try 27 // The IP address(es) and port number to connect to. The TCP socket will try
28 // each IP address in the list until it succeeds in establishing a 28 // each IP address in the list until it succeeds in establishing a
29 // connection. 29 // connection.
30 TCPClientSocketLibevent(const AddressList& addresses, 30 TCPClientSocketLibevent(const AddressList& addresses,
31 net::NetLog* net_log, 31 net::NetLog* net_log,
32 const net::NetLog::Source& source); 32 const net::NetLog::Source& source);
33 33
34 virtual ~TCPClientSocketLibevent(); 34 virtual ~TCPClientSocketLibevent();
35 35
36 // AdoptSocket causes the given, connected socket to be adopted as a TCP 36 // AdoptSocket causes the given, connected socket to be adopted as a TCP
37 // socket. This object must not be connected. This object takes ownership of 37 // socket. This object must not be connected. This object takes ownership of
38 // the given socket and then acts as if Connect() had been called. This 38 // the given socket and then acts as if Connect() had been called. This
39 // function is used by TCPServerSocket() to adopt accepted connections 39 // function is used by TCPServerSocket() to adopt accepted connections
40 // and for testing. 40 // and for testing.
41 void AdoptSocket(int socket); 41 void AdoptSocket(int socket);
42 42
43 // ClientSocket methods: 43 // StreamSocket methods:
44 virtual int Connect(CompletionCallback* callback); 44 virtual int Connect(CompletionCallback* callback);
45 virtual void Disconnect(); 45 virtual void Disconnect();
46 virtual bool IsConnected() const; 46 virtual bool IsConnected() const;
47 virtual bool IsConnectedAndIdle() const; 47 virtual bool IsConnectedAndIdle() const;
48 virtual int GetPeerAddress(AddressList* address) const; 48 virtual int GetPeerAddress(AddressList* address) const;
49 virtual int GetLocalAddress(IPEndPoint* address) const; 49 virtual int GetLocalAddress(IPEndPoint* address) const;
50 virtual const BoundNetLog& NetLog() const; 50 virtual const BoundNetLog& NetLog() const;
51 virtual void SetSubresourceSpeculation(); 51 virtual void SetSubresourceSpeculation();
52 virtual void SetOmniboxSpeculation(); 52 virtual void SetOmniboxSpeculation();
53 virtual bool WasEverUsed() const; 53 virtual bool WasEverUsed() const;
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 192
193 // True when TCP FastOpen is in use and we have done the connect. 193 // True when TCP FastOpen is in use and we have done the connect.
194 bool tcp_fastopen_connected_; 194 bool tcp_fastopen_connected_;
195 195
196 DISALLOW_COPY_AND_ASSIGN(TCPClientSocketLibevent); 196 DISALLOW_COPY_AND_ASSIGN(TCPClientSocketLibevent);
197 }; 197 };
198 198
199 } // namespace net 199 } // namespace net
200 200
201 #endif // NET_SOCKET_TCP_CLIENT_SOCKET_LIBEVENT_H_ 201 #endif // NET_SOCKET_TCP_CLIENT_SOCKET_LIBEVENT_H_
OLDNEW
« no previous file with comments | « net/socket/stream_socket.cc ('k') | net/socket/tcp_client_socket_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698