Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5754)

Unified Diff: chrome/browser/net/url_fetcher.cc

Issue 377041: Add instrumentation to track down a crash.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: make a comment more descriptive Created 11 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698