Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4920)

Unified Diff: chrome/browser/profiles/profile_impl.cc

Issue 7210006: AppCaches which belong to hosted apps are not protected from deletion (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Fixing the merge. Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);

Powered by Google App Engine
This is Rietveld 408576698