diff options
author | battre@chromium.org <battre@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-13 08:59:05 +0000 |
---|---|---|
committer | battre@chromium.org <battre@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-13 08:59:05 +0000 |
commit | f13746128d2eee11781a6536e64f27980d2811dc (patch) | |
tree | de0304a60b756512ae45019a43ecb954078235e2 /net/base | |
parent | 5844c59008ee40cc0f723fec6cc305cb8d401671 (diff) | |
download | chromium_src-f13746128d2eee11781a6536e64f27980d2811dc.zip chromium_src-f13746128d2eee11781a6536e64f27980d2811dc.tar.gz chromium_src-f13746128d2eee11781a6536e64f27980d2811dc.tar.bz2 |
Revert 117342 - Prevent callbacks after URLRequest/URLRequestJob have been canceled/completed/killed.
With this CL, URLRequestJobs notify their NetworkDelegate when they are being destroyed to insure that the NetworkDelegate does not access any of their variables or call callbacks.
Also the WebRequest API does not execute any callbacks if they URLRequest has informed the API that the Request has been completed or canceled.
Both cases could happen in rare race conditions.
BUG=108968
TEST=no
Review URL: http://codereview.chromium.org/9147018
TBR=battre@chromium.org
Review URL: http://codereview.chromium.org/9173005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@117620 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base')
-rw-r--r-- | net/base/network_delegate.h | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/net/base/network_delegate.h b/net/base/network_delegate.h index c18a897..00bbc25 100644 --- a/net/base/network_delegate.h +++ b/net/base/network_delegate.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -92,16 +92,13 @@ class NetworkDelegate : public base::NonThreadSafe { // Called right before the HTTP headers are sent. Allows the delegate to // read/write |headers| before they get sent out. |callback| and |headers| are - // valid only until OnCompleted or OnURLRequestDestroyed is called for this - // request. + // valid only until OnURLRequestDestroyed is called for this request. // Returns a net status code. virtual int OnBeforeSendHeaders(URLRequest* request, const CompletionCallback& callback, HttpRequestHeaders* headers) = 0; // Called right before the HTTP request(s) are being sent to the network. - // |headers| is only valid until OnCompleted or OnURLRequestDestroyed is - // called for this request. virtual void OnSendHeaders(URLRequest* request, const HttpRequestHeaders& headers) = 0; @@ -114,8 +111,6 @@ class NetworkDelegate : public base::NonThreadSafe { // network, these must not be modified. |override_response_headers| can be set // to new values, that should be considered as overriding // |original_response_headers|. - // |callback|, |original_response_headers|, and |override_response_headers| - // are only valid until OnURLRequestDestroyed is called for this request. virtual int OnHeadersReceived( URLRequest* request, const CompletionCallback& callback, @@ -123,8 +118,6 @@ class NetworkDelegate : public base::NonThreadSafe { scoped_refptr<HttpResponseHeaders>* override_response_headers) = 0; // Called right after a redirect response code was received. - // |new_location| is only valid until OnURLRequestDestroyed is called for this - // request. virtual void OnBeforeRedirect(URLRequest* request, const GURL& new_location) = 0; |