| 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/ref_counted.h" | 10 #include "base/ref_counted.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 // otherwise it will be set to a new connected socket. Consumers can then | 39 // otherwise it will be set to a new connected socket. Consumers can then |
| 40 // call is_reused() to see if the socket was reused. If not reusing an | 40 // call is_reused() to see if the socket was reused. If not reusing an |
| 41 // existing socket, ClientSocketPool may need to establish a new | 41 // existing socket, ClientSocketPool may need to establish a new |
| 42 // connection to the |resolve_info.host| |resolve_info.port| pair. | 42 // connection to the |resolve_info.host| |resolve_info.port| pair. |
| 43 // | 43 // |
| 44 // This method returns ERR_IO_PENDING if it cannot complete synchronously, in | 44 // This method returns ERR_IO_PENDING if it cannot complete synchronously, in |
| 45 // which case the consumer will be notified of completion via |callback|. | 45 // which case the consumer will be notified of completion via |callback|. |
| 46 // | 46 // |
| 47 // Init may be called multiple times. | 47 // Init may be called multiple times. |
| 48 // | 48 // |
| 49 int Init(const std::string& group_name, | 49 // Profiling information for the request is saved to |load_log| if non-NULL. |
| 50 int Init(LoadLog* load_log, |
| 51 const std::string& group_name, |
| 50 const HostResolver::RequestInfo& resolve_info, | 52 const HostResolver::RequestInfo& resolve_info, |
| 51 int priority, | 53 int priority, |
| 52 CompletionCallback* callback); | 54 CompletionCallback* callback); |
| 53 | 55 |
| 54 // An initialized handle can be reset, which causes it to return to the | 56 // An initialized handle can be reset, which causes it to return to the |
| 55 // un-initialized state. This releases the underlying socket, which in the | 57 // un-initialized state. This releases the underlying socket, which in the |
| 56 // case of a socket that still has an established connection, indicates that | 58 // case of a socket that still has an established connection, indicates that |
| 57 // the socket may be kept alive for use by a subsequent ClientSocketHandle. | 59 // the socket may be kept alive for use by a subsequent ClientSocketHandle. |
| 58 // | 60 // |
| 59 // NOTE: To prevent the socket from being kept alive, be sure to call its | 61 // NOTE: To prevent the socket from being kept alive, be sure to call its |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 bool is_reused_; | 98 bool is_reused_; |
| 97 CompletionCallbackImpl<ClientSocketHandle> callback_; | 99 CompletionCallbackImpl<ClientSocketHandle> callback_; |
| 98 CompletionCallback* user_callback_; | 100 CompletionCallback* user_callback_; |
| 99 | 101 |
| 100 DISALLOW_COPY_AND_ASSIGN(ClientSocketHandle); | 102 DISALLOW_COPY_AND_ASSIGN(ClientSocketHandle); |
| 101 }; | 103 }; |
| 102 | 104 |
| 103 } // namespace net | 105 } // namespace net |
| 104 | 106 |
| 105 #endif // NET_SOCKET_CLIENT_SOCKET_HANDLE_H_ | 107 #endif // NET_SOCKET_CLIENT_SOCKET_HANDLE_H_ |
| OLD | NEW |