summaryrefslogtreecommitdiffstats
path: root/chrome/browser/browser_process_impl.cc
diff options
context:
space:
mode:
authorjar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-13 23:32:01 +0000
committerjar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-13 23:32:01 +0000
commitd393a0fdb47c3416153589b5acfc6ccaae280477 (patch)
tree4fad2a87a450cac90f5c0c4594eca7737a56c3a6 /chrome/browser/browser_process_impl.cc
parent042070d932d4689d2f2e7907348ecd3b52aba3be (diff)
downloadchromium_src-d393a0fdb47c3416153589b5acfc6ccaae280477.zip
chromium_src-d393a0fdb47c3416153589b5acfc6ccaae280477.tar.gz
chromium_src-d393a0fdb47c3416153589b5acfc6ccaae280477.tar.bz2
Ensure that IO thread is not called in last actions by SDCH shutdown
Unregister the sdch_dictionary_fetcher so that it destroys any pending URLFetcher instances when we are nearing shutdown time. Dictionaries are only *potentially* useful (and not needed) for future SDCH fetches, so abandoning any pending items is safe and harmless. b=9669 r=wtc Review URL: http://codereview.chromium.org/113235 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16015 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser_process_impl.cc')
-rw-r--r--chrome/browser/browser_process_impl.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc
index a031374..759934b 100644
--- a/chrome/browser/browser_process_impl.cc
+++ b/chrome/browser/browser_process_impl.cc
@@ -19,6 +19,7 @@
#include "chrome/browser/google_url_tracker.h"
#include "chrome/browser/metrics/metrics_service.h"
#include "chrome/browser/net/dns_global.h"
+#include "chrome/browser/net/sdch_dictionary_fetcher.h"
#include "chrome/browser/plugin_service.h"
#include "chrome/browser/profile_manager.h"
#include "chrome/browser/renderer_host/render_process_host.h"
@@ -143,10 +144,16 @@ BrowserProcessImpl::~BrowserProcessImpl() {
// this destructor is run.
automation_provider_list_.reset();
+ // We need to shutdown the SdchDictionaryFetcher as it regularly holds
+ // a pointer to a URLFetcher, and that URLFetcher (upon destruction) will do
+ // a PostDelayedTask onto the IO thread. This shutdown call will both discard
+ // any pending URLFetchers, and avoid creating any more.
+ SdchDictionaryFetcher::Shutdown();
+
// We need to destroy the MetricsService and GoogleURLTracker before the
// io_thread_ gets destroyed, since both destructors can call the URLFetcher
- // destructor, which does an InvokeLater operation on the IO thread. (The IO
- // thread will handle that URLFetcher operation before going away.)
+ // destructor, which does an PostDelayedTask operation on the IO thread. (The
+ // IO thread will handle that URLFetcher operation before going away.)
metrics_service_.reset();
google_url_tracker_.reset();