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

Unified Diff: content/common/net/url_fetcher_core.cc

Issue 10175006: Fixed a bug in URLFetcherCore that caused random failures if the object was freed while doing a chu… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 months 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: content/common/net/url_fetcher_core.cc
diff --git a/content/common/net/url_fetcher_core.cc b/content/common/net/url_fetcher_core.cc
index c384146c0c2bda719755f616076a2060d141df58..a067ed6c8f9917eaf175a549e0d1bc6715ffed46 100644
--- a/content/common/net/url_fetcher_core.cc
+++ b/content/common/net/url_fetcher_core.cc
@@ -562,6 +562,11 @@ void URLFetcherCore::OnResponseStarted(net::URLRequest* request) {
void URLFetcherCore::CompleteAddingUploadDataChunk(
const std::string& content, bool is_last_chunk) {
+ if (was_cancelled_) {
+ // Since CompleteAddingUploadDataChunk() is posted as a *delayed* task, it
+ // may run after the URLFetcher was already stopped.
+ return;
+ }
DCHECK(is_chunked_upload_);
DCHECK(request_.get());
DCHECK(!content.empty());
« 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