Chromium Code Reviews| Index: chrome/browser/browser_process_impl.cc |
| diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc |
| index bf1a52f2da288cc539fa678a1c5c431a96f97df0..0d58cbe6f0c8e149097fd9c8db0ae700cab82e30 100644 |
| --- a/chrome/browser/browser_process_impl.cc |
| +++ b/chrome/browser/browser_process_impl.cc |
| @@ -37,6 +37,7 @@ |
| #include "chrome/browser/net/sdch_dictionary_fetcher.h" |
| #include "chrome/browser/net/sqlite_persistent_cookie_store.h" |
| #include "chrome/browser/notifications/notification_ui_manager.h" |
| +#include "chrome/browser/plugin_data_remover.h" |
| #include "chrome/browser/plugin_service.h" |
| #include "chrome/browser/plugin_updater.h" |
| #include "chrome/browser/prefs/pref_service.h" |
| @@ -116,10 +117,20 @@ BrowserProcessImpl::BrowserProcessImpl(const CommandLine& command_line) |
| BrowserProcessImpl::~BrowserProcessImpl() { |
| FilePath profile_path; |
| - bool clear_local_state_on_exit; |
| - |
| - // Store the profile path for clearing local state data on exit. |
| - clear_local_state_on_exit = ShouldClearLocalState(&profile_path); |
| + bool clear_local_state_on_exit = false; |
| + Profile* profile = GetProfile(); |
| + if (profile) { |
| + // Store the profile path for clearing local state data on exit. |
| + profile_path = profile->GetPath(); |
| + PrefService* prefs = profile->GetPrefs(); |
| + clear_local_state_on_exit = prefs->GetBoolean(prefs::kClearSiteDataOnExit); |
| + if (prefs->GetBoolean(prefs::kClearPluginLSODataOnExit) && |
| + local_state()->GetBoolean(prefs::kClearPluginLSODataEnabled)) { |
| + PluginDataRemover remover; |
| + remover.StartRemoving(base::Time(), new MessageLoop::QuitTask()); |
| + MessageLoop::current()->Run(); |
|
jochen (gone - plz use gerrit)
2010/11/24 19:03:07
i think this is the wrong place to do this. Can't
Bernhard Bauer
2010/11/29 10:45:23
PluginDataRemover needs the PluginService in order
|
| + } |
| + } |
| // Delete the AutomationProviderList before NotificationService, |
| // since it may try to unregister notifications |
| @@ -509,23 +520,17 @@ void BrowserProcessImpl::ClearLocalState(const FilePath& profile_path) { |
| ChromeAppCacheService::ClearLocalState(profile_path); |
| } |
| -bool BrowserProcessImpl::ShouldClearLocalState(FilePath* profile_path) { |
| - FilePath user_data_dir; |
| - Profile* profile; |
| - |
| +Profile* BrowserProcessImpl::GetProfile() { |
| // Check for the existence of a profile manager. When quitting early, |
| // e.g. because another chrome instance is running, or when invoked with |
| // options such as --uninstall or --try-chrome-again=0, the profile manager |
| // does not exist yet. |
| if (!profile_manager_.get()) |
| - return false; |
| + return NULL; |
| + FilePath user_data_dir; |
| PathService::Get(chrome::DIR_USER_DATA, &user_data_dir); |
| - profile = profile_manager_->GetDefaultProfile(user_data_dir); |
| - if (!profile) |
| - return false; |
| - *profile_path = profile->GetPath(); |
| - return profile->GetPrefs()->GetBoolean(prefs::kClearSiteDataOnExit); |
| + return profile_manager_->GetDefaultProfile(user_data_dir); |
| } |
| void BrowserProcessImpl::CreateResourceDispatcherHost() { |