Index: chrome/browser/profiles/profile_impl.cc |
diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc |
index 6599b978a8cba3bdcec2051fc9b552119086d46c..ff1c9ce3fb8ab606e37d7af0ceb2aa33475f0167 100644 |
--- a/chrome/browser/profiles/profile_impl.cc |
+++ b/chrome/browser/profiles/profile_impl.cc |
@@ -14,6 +14,7 @@ |
#include "base/path_service.h" |
#include "base/string_number_conversions.h" |
#include "base/string_util.h" |
+#include "base/synchronization/waitable_event.h" |
#include "chrome/browser/autocomplete/autocomplete_classifier.h" |
#include "chrome/browser/autofill/personal_data_manager.h" |
#include "chrome/browser/background/background_contents_service_factory.h" |
@@ -589,6 +590,12 @@ ProfileImpl::~ProfileImpl() { |
Source<Profile>(this), |
NotificationService::NoDetails()); |
+ if (appcache_service_ && prefs_->GetBoolean(prefs::kClearSiteDataOnExit)) { |
+ // We don't own event |
+ base::WaitableEvent* event = appcache_service_->ClearAppCache(NULL); |
+ event->Wait(); |
michaeln
2011/07/02 00:29:09
We should not block the UI thread for this as prof
jochen (gone - plz use gerrit)
2011/07/06 09:41:45
I agree that we shouldn't wait on the UI thread. O
marja(google)
2011/07/06 11:44:39
The appcache deletion procedure posts tasks across
|
+ } |
+ |
StopCreateSessionServiceTimer(); |
// Remove pref observers |
@@ -1322,8 +1329,7 @@ void ProfileImpl::CreateQuotaManagerAndClients() { |
IsOffTheRecord() |
? FilePath() : GetPath().Append(chrome::kAppCacheDirname), |
&GetResourceContext(), |
- make_scoped_refptr(GetExtensionSpecialStoragePolicy()), |
- clear_local_state_on_exit_)); |
+ make_scoped_refptr(GetExtensionSpecialStoragePolicy()))); |
} |
WebKitContext* ProfileImpl::GetWebKitContext() { |
@@ -1377,10 +1383,6 @@ void ProfileImpl::Observe(NotificationType type, |
webkit_context_->set_clear_local_state_on_exit( |
clear_local_state_on_exit_); |
} |
- if (appcache_service_) { |
- appcache_service_->SetClearLocalStateOnExit( |
- clear_local_state_on_exit_); |
- } |
} else if (*pref_name_in == prefs::kGoogleServicesUsername) { |
ProfileManager* profile_manager = g_browser_process->profile_manager(); |
profile_manager->RegisterProfileName(this); |