| 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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 // | 84 // |
| 85 template <typename PoolType> | 85 template <typename PoolType> |
| 86 int Init(const std::string& group_name, | 86 int Init(const std::string& group_name, |
| 87 const scoped_refptr<typename PoolType::SocketParams>& socket_params, | 87 const scoped_refptr<typename PoolType::SocketParams>& socket_params, |
| 88 RequestPriority priority, | 88 RequestPriority priority, |
| 89 ClientSocketPool::RespectLimits respect_limits, | 89 ClientSocketPool::RespectLimits respect_limits, |
| 90 const CompletionCallback& callback, | 90 const CompletionCallback& callback, |
| 91 PoolType* pool, | 91 PoolType* pool, |
| 92 const NetLogWithSource& net_log); | 92 const NetLogWithSource& net_log); |
| 93 | 93 |
| 94 // Changes the priority of the ClientSocketHandle to the passed value. |
| 95 // This function is a no-op if |priority| is the same as the current |
| 96 // priority, of if Init() has not been called since the last time |
| 97 // the ClientSocketHandle was reset. |
| 98 void SetPriority(RequestPriority priority); |
| 99 |
| 94 // An initialized handle can be reset, which causes it to return to the | 100 // An initialized handle can be reset, which causes it to return to the |
| 95 // un-initialized state. This releases the underlying socket, which in the | 101 // un-initialized state. This releases the underlying socket, which in the |
| 96 // case of a socket that still has an established connection, indicates that | 102 // case of a socket that still has an established connection, indicates that |
| 97 // the socket may be kept alive for use by a subsequent ClientSocketHandle. | 103 // the socket may be kept alive for use by a subsequent ClientSocketHandle. |
| 98 // | 104 // |
| 99 // NOTE: To prevent the socket from being kept alive, be sure to call its | 105 // NOTE: To prevent the socket from being kept alive, be sure to call its |
| 100 // Disconnect method. This will result in the ClientSocketPool deleting the | 106 // Disconnect method. This will result in the ClientSocketPool deleting the |
| 101 // StreamSocket. | 107 // StreamSocket. |
| 102 void Reset(); | 108 void Reset(); |
| 103 | 109 |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 user_callback_ = callback; | 260 user_callback_ = callback; |
| 255 } else { | 261 } else { |
| 256 HandleInitCompletion(rv); | 262 HandleInitCompletion(rv); |
| 257 } | 263 } |
| 258 return rv; | 264 return rv; |
| 259 } | 265 } |
| 260 | 266 |
| 261 } // namespace net | 267 } // namespace net |
| 262 | 268 |
| 263 #endif // NET_SOCKET_CLIENT_SOCKET_HANDLE_H_ | 269 #endif // NET_SOCKET_CLIENT_SOCKET_HANDLE_H_ |
| OLD | NEW |