Index: chrome/browser/net/sdch_dictionary_fetcher.cc |
diff --git a/chrome/browser/net/sdch_dictionary_fetcher.cc b/chrome/browser/net/sdch_dictionary_fetcher.cc |
index 1130fe336242b5b5c666a2ae433771e1b98d3bd4..dfc64f95442781b43e93b99d1639b8a0b7c57f3a 100644 |
--- a/chrome/browser/net/sdch_dictionary_fetcher.cc |
+++ b/chrome/browser/net/sdch_dictionary_fetcher.cc |
@@ -49,6 +49,16 @@ void SdchDictionaryFetcher::Schedule(const GURL& dictionary_url) { |
ScheduleDelayedRun(); |
} |
+void SdchDictionaryFetcher::Cancel() { |
+ DCHECK(CalledOnValidThread()); |
+ |
+ current_fetch_.reset(NULL); |
+ weak_factory_.InvalidateWeakPtrs(); |
+ attempted_load_.clear(); |
+ std::queue<GURL> trash_queue; |
+ fetch_queue_.swap(trash_queue); |
jar (doing other things)
2014/06/11 23:23:49
nit: (personal style): It is probably safer to fir
Randy Smith (Not in Mondays)
2014/06/12 18:15:45
Hmmm. So your comment made me think about orderin
|
+} |
+ |
void SdchDictionaryFetcher::ScheduleDelayedRun() { |
if (fetch_queue_.empty() || current_fetch_.get() || task_is_pending_) |
return; |