summaryrefslogtreecommitdiffstats
path: root/chrome/browser/net/sdch_dictionary_fetcher.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/net/sdch_dictionary_fetcher.cc')
-rw-r--r--chrome/browser/net/sdch_dictionary_fetcher.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/chrome/browser/net/sdch_dictionary_fetcher.cc b/chrome/browser/net/sdch_dictionary_fetcher.cc
index 3a36bde..b063748 100644
--- a/chrome/browser/net/sdch_dictionary_fetcher.cc
+++ b/chrome/browser/net/sdch_dictionary_fetcher.cc
@@ -33,10 +33,19 @@ void SdchDictionaryFetcher::StartFetching() {
DCHECK(task_is_pending_);
task_is_pending_ = false;
+ URLRequestContext* context = Profile::GetDefaultRequestContext();
+ if (!context) {
+ // Shutdown in progress.
+ // Simulate handling of all dictionary requests by clearing queue.
+ while (!fetch_queue_.empty())
+ fetch_queue_.pop();
+ return;
+ }
+
current_fetch_.reset(new URLFetcher(fetch_queue_.front(), URLFetcher::GET,
this));
fetch_queue_.pop();
- current_fetch_->set_request_context(Profile::GetDefaultRequestContext());
+ current_fetch_->set_request_context(context);
current_fetch_->Start();
}