diff options
author | ukai@chromium.org <ukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-01 08:42:43 +0000 |
---|---|---|
committer | ukai@chromium.org <ukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-01 08:42:43 +0000 |
commit | 1bcf5271fd99b0c6474c86d1993f4f880062dc9d (patch) | |
tree | 20a0895cb4d96b19e41d29178770e2829fef6d31 /net | |
parent | 40c7cfe39957248d38d8c376fbfc7d332c796741 (diff) | |
download | chromium_src-1bcf5271fd99b0c6474c86d1993f4f880062dc9d.zip chromium_src-1bcf5271fd99b0c6474c86d1993f4f880062dc9d.tar.gz chromium_src-1bcf5271fd99b0c6474c86d1993f4f880062dc9d.tar.bz2 |
Cancel proxy request when context is about to change in SocketStream.
If SocketStream is deleted while ResolvProxy is running, proxy service
might access SocketStream's member fields, such as proxy_info_, after
SocketStream is deleted, so it would cause crash like
http://crash/reportdetail?reportid=40166b9529ce6b74
In SocketStream destructor, it will set context to NULL, so it will
cancel proxy request if pac_request_ is not NULL.
BUG=46750
TEST=none
Review URL: http://codereview.chromium.org/2852034
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51351 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r-- | net/socket_stream/socket_stream.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/net/socket_stream/socket_stream.cc b/net/socket_stream/socket_stream.cc index 333e383..d38242c 100644 --- a/net/socket_stream/socket_stream.cc +++ b/net/socket_stream/socket_stream.cc @@ -72,6 +72,7 @@ SocketStream::SocketStream(const GURL& url, Delegate* delegate) SocketStream::~SocketStream() { set_context(NULL); DCHECK(!delegate_); + DCHECK(!pac_request_); } SocketStream::UserData* SocketStream::GetUserData( @@ -92,6 +93,11 @@ void SocketStream::set_context(URLRequestContext* context) { context_ = context; if (prev_context != context) { + if (prev_context && pac_request_) { + prev_context->proxy_service()->CancelPacRequest(pac_request_); + pac_request_ = NULL; + } + net_log_.EndEvent(NetLog::TYPE_REQUEST_ALIVE, NULL); net_log_ = BoundNetLog(); |