diff options
author | akalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-28 08:10:05 +0000 |
---|---|---|
committer | akalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-28 08:10:05 +0000 |
commit | ebc16006305a09c27f2b9ec006f6e4fc78667e1a (patch) | |
tree | e9511c554f2e3938203e208788d6b20cc91a1689 /net/socket/client_socket_handle.h | |
parent | be81f5c2542a09e8ac22ff7c48f990a3d0768cab (diff) | |
download | chromium_src-ebc16006305a09c27f2b9ec006f6e4fc78667e1a.zip chromium_src-ebc16006305a09c27f2b9ec006f6e4fc78667e1a.tar.gz chromium_src-ebc16006305a09c27f2b9ec006f6e4fc78667e1a.tar.bz2 |
Clarify conditions of use of ClientSocketHandle::PassSocket()
Restructure ClientSocketHandle::ResetInternal() to have accurate comments
and control flow.
This was spun off from comments on https://codereview.chromium.org/22995002/ .
BUG=166689
Review URL: https://chromiumcodereview.appspot.com/23566005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@219961 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/socket/client_socket_handle.h')
-rw-r--r-- | net/socket/client_socket_handle.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/net/socket/client_socket_handle.h b/net/socket/client_socket_handle.h index 8f2d4ae..30b7c03 100644 --- a/net/socket/client_socket_handle.h +++ b/net/socket/client_socket_handle.h @@ -122,6 +122,9 @@ class NET_EXPORT ClientSocketHandle { LoadTimingInfo* load_timing_info) const; // Used by ClientSocketPool to initialize the ClientSocketHandle. + // + // SetSocket() may also be used if this handle is used as simply for + // socket storage (e.g., http://crbug.com/37810). void SetSocket(scoped_ptr<StreamSocket> s); void set_is_reused(bool is_reused) { is_reused_ = is_reused; } void set_idle_time(base::TimeDelta idle_time) { idle_time_ = idle_time; } @@ -149,9 +152,13 @@ class NET_EXPORT ClientSocketHandle { return pending_http_proxy_connection_.release(); } - // These may only be used if is_initialized() is true. - scoped_ptr<StreamSocket> PassSocket(); StreamSocket* socket() { return socket_.get(); } + + // SetSocket() must be called with a new socket before this handle + // is destroyed if is_initialized() is true. + scoped_ptr<StreamSocket> PassSocket(); + + // These may only be used if is_initialized() is true. const std::string& group_name() const { return group_name_; } int id() const { return pool_id_; } bool is_reused() const { return is_reused_; } |