Chromium Code Reviews| Index: chrome/browser/net/url_fetcher.cc |
| =================================================================== |
| --- chrome/browser/net/url_fetcher.cc (revision 31506) |
| +++ chrome/browser/net/url_fetcher.cc (working copy) |
| @@ -95,6 +95,11 @@ |
| // specified by the protection manager, we'll give up. |
| int num_retries_; |
| + // Temporary member variable to test whether requests are being started |
| + // after they have already been cancelled. |
| + // TODO(eroman): Remove this after done investigating 27074. |
| + bool was_cancelled_; |
|
wtc
2009/11/10 01:09:25
You explained what this member is for, but you sho
|
| + |
| friend class URLFetcher; |
| DISALLOW_COPY_AND_ASSIGN(Core); |
| }; |
| @@ -135,12 +140,13 @@ |
| buffer_(new net::IOBuffer(kBufferSize)), |
| protect_entry_(URLFetcherProtectManager::GetInstance()->Register( |
| original_url_.host())), |
| - num_retries_(0) { |
| + num_retries_(0), |
| + was_cancelled_(false) { |
| } |
| void URLFetcher::Core::Start() { |
| DCHECK(delegate_loop_); |
| - DCHECK(request_context_getter_) << "We need an URLRequestContext!"; |
| + CHECK(request_context_getter_) << "We need an URLRequestContext!"; |
| ChromeThread::PostDelayedTask( |
| ChromeThread::IO, FROM_HERE, |
| NewRunnableMethod(this, &Core::StartURLRequest), |
| @@ -199,7 +205,9 @@ |
| void URLFetcher::Core::StartURLRequest() { |
| DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); |
| - DCHECK(!request_); |
| + CHECK(!was_cancelled_); |
| + CHECK(request_context_getter_); |
| + CHECK(!request_); |
| request_ = new URLRequest(original_url_, this); |
| int flags = request_->load_flags() | load_flags_; |
| @@ -252,6 +260,7 @@ |
| // delete the object, but we cannot delay the destruction of the request |
| // context. |
| request_context_getter_ = NULL; |
| + was_cancelled_ = true; |
| } |
| void URLFetcher::Core::OnCompletedURLRequest(const URLRequestStatus& status) { |