diff options
author | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-04 00:10:01 +0000 |
---|---|---|
committer | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-04 00:10:01 +0000 |
commit | 49f28bc7d531ffd28b94f2406997e2216adb0df7 (patch) | |
tree | 1720b0e395a9ed37ebdedc52cf5b86b9a8ce1e5a /chrome/browser/browser_process_impl.cc | |
parent | 7df7001734cc8ec68d14571cccbe88ef439a09a5 (diff) | |
download | chromium_src-49f28bc7d531ffd28b94f2406997e2216adb0df7.zip chromium_src-49f28bc7d531ffd28b94f2406997e2216adb0df7.tar.gz chromium_src-49f28bc7d531ffd28b94f2406997e2216adb0df7.tar.bz2 |
Make sure locally stored site data is deleted after DB and WebKit threads are gone.
BUG=32719
TEST=none
Review URL: http://codereview.chromium.org/564050
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38048 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser_process_impl.cc')
-rw-r--r-- | chrome/browser/browser_process_impl.cc | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc index f58357b..f96fd10 100644 --- a/chrome/browser/browser_process_impl.cc +++ b/chrome/browser/browser_process_impl.cc @@ -164,16 +164,12 @@ BrowserProcessImpl::~BrowserProcessImpl() { // SaveFileManager and SessionService. file_thread_.reset(); - // At this point, no render process exist, so it's safe to access local - // state data such as cookies, database, or local storage. - if (clear_local_state_on_exit) - ClearLocalState(profile_path); - // With the file_thread_ flushed, we can release any icon resources. icon_manager_.reset(); // Need to destroy ResourceDispatcherHost before PluginService and - // SafeBrowsingService, since it caches a pointer to it. + // SafeBrowsingService, since it caches a pointer to it. This also + // causes the webkit thread to terminate. resource_dispatcher_host_.reset(); // Wait for the pending print jobs to finish. @@ -183,6 +179,16 @@ BrowserProcessImpl::~BrowserProcessImpl() { // Now OK to destroy NotificationService. main_notification_service_.reset(); + // Prior to clearing local state, we want to complete tasks pending + // on the db thread too. + db_thread_.reset(); + + // At this point, no render process exist and the file, io, db, and + // webkit threads in this process have all terminated, so it's safe + // to access local state data such as cookies, database, or local storage. + if (clear_local_state_on_exit) + ClearLocalState(profile_path); + g_browser_process = NULL; } |