| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 | 7 |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/non_thread_safe.h" |
| 9 #include "base/ref_counted.h" | 10 #include "base/ref_counted.h" |
| 10 #include "base/scoped_ptr.h" | 11 #include "base/scoped_ptr.h" |
| 11 #include "net/base/address_list.h" | 12 #include "net/base/address_list.h" |
| 12 #include "net/base/completion_callback.h" | 13 #include "net/base/completion_callback.h" |
| 13 #include "net/base/net_log.h" | 14 #include "net/base/net_log.h" |
| 14 #include "net/socket/client_socket.h" | 15 #include "net/socket/client_socket.h" |
| 15 | 16 |
| 16 struct event; // From libevent | 17 struct event; // From libevent |
| 17 | 18 |
| 18 namespace net { | 19 namespace net { |
| 19 | 20 |
| 20 class BoundNetLog; | 21 class BoundNetLog; |
| 21 | 22 |
| 22 // A client socket that uses TCP as the transport layer. | 23 // A client socket that uses TCP as the transport layer. |
| 23 class TCPClientSocketLibevent : public ClientSocket { | 24 class TCPClientSocketLibevent : public ClientSocket, NonThreadSafe { |
| 24 public: | 25 public: |
| 25 // The IP address(es) and port number to connect to. The TCP socket will try | 26 // The IP address(es) and port number to connect to. The TCP socket will try |
| 26 // each IP address in the list until it succeeds in establishing a | 27 // each IP address in the list until it succeeds in establishing a |
| 27 // connection. | 28 // connection. |
| 28 explicit TCPClientSocketLibevent(const AddressList& addresses, | 29 explicit TCPClientSocketLibevent(const AddressList& addresses, |
| 29 net::NetLog* net_log); | 30 net::NetLog* net_log); |
| 30 | 31 |
| 31 virtual ~TCPClientSocketLibevent(); | 32 virtual ~TCPClientSocketLibevent(); |
| 32 | 33 |
| 33 // ClientSocket methods: | 34 // ClientSocket methods: |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 CompletionCallback* write_callback_; | 134 CompletionCallback* write_callback_; |
| 134 | 135 |
| 135 BoundNetLog net_log_; | 136 BoundNetLog net_log_; |
| 136 | 137 |
| 137 DISALLOW_COPY_AND_ASSIGN(TCPClientSocketLibevent); | 138 DISALLOW_COPY_AND_ASSIGN(TCPClientSocketLibevent); |
| 138 }; | 139 }; |
| 139 | 140 |
| 140 } // namespace net | 141 } // namespace net |
| 141 | 142 |
| 142 #endif // NET_SOCKET_TCP_CLIENT_SOCKET_LIBEVENT_H_ | 143 #endif // NET_SOCKET_TCP_CLIENT_SOCKET_LIBEVENT_H_ |
| OLD | NEW |