Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_CLIENT_SOCKET_HANDLE_H_ | 5 #ifndef NET_SOCKET_CLIENT_SOCKET_HANDLE_H_ |
| 6 #define NET_SOCKET_CLIENT_SOCKET_HANDLE_H_ | 6 #define NET_SOCKET_CLIENT_SOCKET_HANDLE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 21 | 21 |
| 22 // A container for a ClientSocket. | 22 // A container for a ClientSocket. |
| 23 // | 23 // |
| 24 // The handle's |group_name| uniquely identifies the origin and type of the | 24 // The handle's |group_name| uniquely identifies the origin and type of the |
| 25 // connection. It is used by the ClientSocketPool to group similar connected | 25 // connection. It is used by the ClientSocketPool to group similar connected |
| 26 // client socket objects. | 26 // client socket objects. |
| 27 // | 27 // |
| 28 class ClientSocketHandle { | 28 class ClientSocketHandle { |
| 29 public: | 29 public: |
| 30 typedef enum { | 30 typedef enum { |
| 31 UNUSED = 0, | 31 UNUSED = 0, // unused socket that just finished connectin |
|
darin (slow to review)
2009/08/24 16:54:41
nit: "connecting"
| |
| 32 UNUSED_IDLE, | 32 UNUSED_IDLE, // unused socket that has been idle for awhile |
| 33 REUSED_IDLE, | 33 REUSED_IDLE, // previously used socket |
| 34 NUM_TYPES, | 34 NUM_TYPES, |
| 35 } SocketReuseType; | 35 } SocketReuseType; |
| 36 | 36 |
| 37 ClientSocketHandle(); | 37 ClientSocketHandle(); |
| 38 ~ClientSocketHandle(); | 38 ~ClientSocketHandle(); |
| 39 | 39 |
| 40 // Initializes a ClientSocketHandle object, which involves talking to the | 40 // Initializes a ClientSocketHandle object, which involves talking to the |
| 41 // ClientSocketPool to obtain a connected socket, possibly reusing one. This | 41 // ClientSocketPool to obtain a connected socket, possibly reusing one. This |
| 42 // method returns either OK or ERR_IO_PENDING. On ERR_IO_PENDING, |priority| | 42 // method returns either OK or ERR_IO_PENDING. On ERR_IO_PENDING, |priority| |
| 43 // is used to determine the placement in ClientSocketPool's wait list. | 43 // is used to determine the placement in ClientSocketPool's wait list. |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 152 user_callback_ = callback; | 152 user_callback_ = callback; |
| 153 } else { | 153 } else { |
| 154 HandleInitCompletion(rv); | 154 HandleInitCompletion(rv); |
| 155 } | 155 } |
| 156 return rv; | 156 return rv; |
| 157 } | 157 } |
| 158 | 158 |
| 159 } // namespace net | 159 } // namespace net |
| 160 | 160 |
| 161 #endif // NET_SOCKET_CLIENT_SOCKET_HANDLE_H_ | 161 #endif // NET_SOCKET_CLIENT_SOCKET_HANDLE_H_ |
| OLD | NEW |