OLD | NEW |
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_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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "base/time.h" | 14 #include "base/time.h" |
15 #include "net/base/completion_callback.h" | 15 #include "net/base/completion_callback.h" |
16 #include "net/base/load_states.h" | 16 #include "net/base/load_states.h" |
17 #include "net/base/net_errors.h" | 17 #include "net/base/net_errors.h" |
18 #include "net/base/net_api.h" | 18 #include "net/base/net_export.h" |
19 #include "net/base/net_log.h" | 19 #include "net/base/net_log.h" |
20 #include "net/base/request_priority.h" | 20 #include "net/base/request_priority.h" |
21 #include "net/http/http_response_info.h" | 21 #include "net/http/http_response_info.h" |
22 #include "net/socket/client_socket_pool.h" | 22 #include "net/socket/client_socket_pool.h" |
23 #include "net/socket/stream_socket.h" | 23 #include "net/socket/stream_socket.h" |
24 | 24 |
25 namespace net { | 25 namespace net { |
26 | 26 |
27 // A container for a StreamSocket. | 27 // A container for a StreamSocket. |
28 // | 28 // |
29 // The handle's |group_name| uniquely identifies the origin and type of the | 29 // The handle's |group_name| uniquely identifies the origin and type of the |
30 // connection. It is used by the ClientSocketPool to group similar connected | 30 // connection. It is used by the ClientSocketPool to group similar connected |
31 // client socket objects. | 31 // client socket objects. |
32 // | 32 // |
33 class NET_API ClientSocketHandle { | 33 class NET_EXPORT ClientSocketHandle { |
34 public: | 34 public: |
35 enum SocketReuseType { | 35 enum SocketReuseType { |
36 UNUSED = 0, // unused socket that just finished connecting | 36 UNUSED = 0, // unused socket that just finished connecting |
37 UNUSED_IDLE, // unused socket that has been idle for awhile | 37 UNUSED_IDLE, // unused socket that has been idle for awhile |
38 REUSED_IDLE, // previously used socket | 38 REUSED_IDLE, // previously used socket |
39 NUM_TYPES, | 39 NUM_TYPES, |
40 }; | 40 }; |
41 | 41 |
42 ClientSocketHandle(); | 42 ClientSocketHandle(); |
43 ~ClientSocketHandle(); | 43 ~ClientSocketHandle(); |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 user_callback_ = callback; | 208 user_callback_ = callback; |
209 } else { | 209 } else { |
210 HandleInitCompletion(rv); | 210 HandleInitCompletion(rv); |
211 } | 211 } |
212 return rv; | 212 return rv; |
213 } | 213 } |
214 | 214 |
215 } // namespace net | 215 } // namespace net |
216 | 216 |
217 #endif // NET_SOCKET_CLIENT_SOCKET_HANDLE_H_ | 217 #endif // NET_SOCKET_CLIENT_SOCKET_HANDLE_H_ |
OLD | NEW |