diff options
author | bryner@chromium.org <bryner@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-20 02:01:04 +0000 |
---|---|---|
committer | bryner@chromium.org <bryner@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-20 02:01:04 +0000 |
commit | 51ac040769ee6aaaccc0d6e3d80459d115622c49 (patch) | |
tree | fc638eb4263a1b18e100138be4f5fb9b335fd971 /chrome/browser/browser_process_impl.cc | |
parent | 8574bfc817ff84bd9fc6ba4e2453a7c7a7b2df3b (diff) | |
download | chromium_src-51ac040769ee6aaaccc0d6e3d80459d115622c49.zip chromium_src-51ac040769ee6aaaccc0d6e3d80459d115622c49.tar.gz chromium_src-51ac040769ee6aaaccc0d6e3d80459d115622c49.tar.bz2 |
Fix a possible crash in the ClientSideDetectionService.
This fixes a problem where if the model fetch is still running when the
ClientSideDetectionService is destroyed, the URLFetcher is not deleted.
This could potentially cause the OnURLFetchComplete callback to be called
on a deleted ClientSideDetectionService object.
Now the model fetcher will always be deleted, and we will also make sure to
destroy the ClientSideDetectionService before tearing down the IO thread
(since the URLFetcher dtor can post messages there).
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/6298004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71901 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser_process_impl.cc')
-rw-r--r-- | chrome/browser/browser_process_impl.cc | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc index 30ecd9a..0acf6a3 100644 --- a/chrome/browser/browser_process_impl.cc +++ b/chrome/browser/browser_process_impl.cc @@ -146,14 +146,16 @@ BrowserProcessImpl::~BrowserProcessImpl() { // any pending URLFetchers, and avoid creating any more. SdchDictionaryFetcher::Shutdown(); - // We need to destroy the MetricsService, GoogleURLTracker, and - // IntranetRedirectDetector before the io_thread_ gets destroyed, since their - // destructors can call the URLFetcher destructor, which does a - // PostDelayedTask operation on the IO thread. (The IO thread will handle - // that URLFetcher operation before going away.) + // We need to destroy the MetricsService, GoogleURLTracker, + // IntranetRedirectDetector, and SafeBrowsing ClientSideDetectionService + // before the io_thread_ gets destroyed, since their destructors can call the + // URLFetcher destructor, which does a PostDelayedTask operation on the IO + // thread. (The IO thread will handle that URLFetcher operation before going + // away.) metrics_service_.reset(); google_url_tracker_.reset(); intranet_redirect_detector_.reset(); + safe_browsing_detection_service_.reset(); // Need to clear the desktop notification balloons before the io_thread_ and // before the profiles, since if there are any still showing we will access |