summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/net/url_fetcher.cc11
-rw-r--r--chrome/browser/net/url_fetcher_unittest.cc2
-rwxr-xr-xtools/valgrind/memcheck/suppressions.txt6
3 files changed, 10 insertions, 9 deletions
diff --git a/chrome/browser/net/url_fetcher.cc b/chrome/browser/net/url_fetcher.cc
index 350dd50..0d1fbac 100644
--- a/chrome/browser/net/url_fetcher.cc
+++ b/chrome/browser/net/url_fetcher.cc
@@ -156,6 +156,7 @@ void URLFetcher::Core::Start() {
void URLFetcher::Core::Stop() {
DCHECK_EQ(MessageLoop::current(), delegate_loop_);
delegate_ = NULL;
+ fetcher_ = NULL;
ChromeThread::PostTask(
ChromeThread::IO, FROM_HERE,
NewRunnableMethod(this, &Core::CancelURLRequest));
@@ -278,7 +279,10 @@ void URLFetcher::Core::OnCompletedURLRequest(const URLRequestStatus& status) {
// after backoff time.
int64 back_off_time =
protect_entry_->UpdateBackoff(URLFetcherProtectEntry::FAILURE);
- fetcher_->backoff_delay_ = base::TimeDelta::FromMilliseconds(back_off_time);
+ if (delegate_) {
+ fetcher_->backoff_delay_ =
+ base::TimeDelta::FromMilliseconds(back_off_time);
+ }
++num_retries_;
// Restarts the request if we still need to notify the delegate.
if (delegate_) {
@@ -293,11 +297,12 @@ void URLFetcher::Core::OnCompletedURLRequest(const URLRequestStatus& status) {
}
}
} else {
- fetcher_->backoff_delay_ = base::TimeDelta();
protect_entry_->UpdateBackoff(URLFetcherProtectEntry::SUCCESS);
- if (delegate_)
+ if (delegate_) {
+ fetcher_->backoff_delay_ = base::TimeDelta();
delegate_->OnURLFetchComplete(fetcher_, url_, status, response_code_,
cookies_, data_);
+ }
}
}
diff --git a/chrome/browser/net/url_fetcher_unittest.cc b/chrome/browser/net/url_fetcher_unittest.cc
index 079bad5..6136c7e 100644
--- a/chrome/browser/net/url_fetcher_unittest.cc
+++ b/chrome/browser/net/url_fetcher_unittest.cc
@@ -18,6 +18,8 @@
using base::Time;
using base::TimeDelta;
+// TODO(eroman): Add a regression test for http://crbug.com/40505.
+
namespace {
const wchar_t kDocRoot[] = L"chrome/test/data";
diff --git a/tools/valgrind/memcheck/suppressions.txt b/tools/valgrind/memcheck/suppressions.txt
index 630e38c3..fedb4f4 100755
--- a/tools/valgrind/memcheck/suppressions.txt
+++ b/tools/valgrind/memcheck/suppressions.txt
@@ -2625,12 +2625,6 @@
fun:main
}
{
- bug_40505
- Memcheck:Addr4
- fun:_ZN4base9TimeDeltaaSES0_
- fun:_ZN10URLFetcher4Core21OnCompletedURLRequestERK16URLRequestStatus
-}
-{
bug_40877
Memcheck:Leak
fun:_Znw*