| OLD | NEW |
| 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_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 <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 // | 78 // |
| 79 template <typename PoolType> | 79 template <typename PoolType> |
| 80 int Init(const std::string& group_name, | 80 int Init(const std::string& group_name, |
| 81 const scoped_refptr<typename PoolType::SocketParams>& socket_params, | 81 const scoped_refptr<typename PoolType::SocketParams>& socket_params, |
| 82 RequestPriority priority, | 82 RequestPriority priority, |
| 83 ClientSocketPool::RespectLimits respect_limits, | 83 ClientSocketPool::RespectLimits respect_limits, |
| 84 const CompletionCallback& callback, | 84 const CompletionCallback& callback, |
| 85 PoolType* pool, | 85 PoolType* pool, |
| 86 const BoundNetLog& net_log); | 86 const BoundNetLog& net_log); |
| 87 | 87 |
| 88 // Changes the priority of the ClientSocketHandle to the passed value. |
| 89 void SetPriority(RequestPriority priority); |
| 90 |
| 88 // An initialized handle can be reset, which causes it to return to the | 91 // An initialized handle can be reset, which causes it to return to the |
| 89 // un-initialized state. This releases the underlying socket, which in the | 92 // un-initialized state. This releases the underlying socket, which in the |
| 90 // case of a socket that still has an established connection, indicates that | 93 // case of a socket that still has an established connection, indicates that |
| 91 // the socket may be kept alive for use by a subsequent ClientSocketHandle. | 94 // the socket may be kept alive for use by a subsequent ClientSocketHandle. |
| 92 // | 95 // |
| 93 // NOTE: To prevent the socket from being kept alive, be sure to call its | 96 // NOTE: To prevent the socket from being kept alive, be sure to call its |
| 94 // Disconnect method. This will result in the ClientSocketPool deleting the | 97 // Disconnect method. This will result in the ClientSocketPool deleting the |
| 95 // StreamSocket. | 98 // StreamSocket. |
| 96 void Reset(); | 99 void Reset(); |
| 97 | 100 |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 user_callback_ = callback; | 260 user_callback_ = callback; |
| 258 } else { | 261 } else { |
| 259 HandleInitCompletion(rv); | 262 HandleInitCompletion(rv); |
| 260 } | 263 } |
| 261 return rv; | 264 return rv; |
| 262 } | 265 } |
| 263 | 266 |
| 264 } // namespace net | 267 } // namespace net |
| 265 | 268 |
| 266 #endif // NET_SOCKET_CLIENT_SOCKET_HANDLE_H_ | 269 #endif // NET_SOCKET_CLIENT_SOCKET_HANDLE_H_ |
| OLD | NEW |