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