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

Unified Diff: chrome/browser/profile_impl.cc

Issue 5359005: Moved deleting the indexed db context to the WebKitContext destructor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Niptucked. Created 10 years, 1 month 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
« no previous file with comments | « chrome/browser/profile_impl.h ('k') | chrome/test/testing_profile.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profile_impl.cc
diff --git a/chrome/browser/profile_impl.cc b/chrome/browser/profile_impl.cc
index cad400b6045ce09c74fd34f7293bea909ea5b98a..6e19ef48d2765446c168787a0361cb9108ab8f5b 100644
--- a/chrome/browser/profile_impl.cc
+++ b/chrome/browser/profile_impl.cc
@@ -273,6 +273,7 @@ ProfileImpl::ProfileImpl(const FilePath& path)
pref_change_registrar_.Add(prefs::kSpellCheckDictionary, this);
pref_change_registrar_.Add(prefs::kEnableSpellCheck, this);
pref_change_registrar_.Add(prefs::kEnableAutoSpellCorrect, this);
+ pref_change_registrar_.Add(prefs::kClearSiteDataOnExit, this);
// Convert active labs into switches. Modifies the current command line.
about_flags::ConvertFlagsToSwitches(prefs, CommandLine::ForCurrentProcess());
@@ -318,6 +319,8 @@ ProfileImpl::ProfileImpl(const FilePath& path)
GetPolicyContext()->Initialize();
+ clear_local_state_on_exit_ = prefs->GetBoolean(prefs::kClearSiteDataOnExit);
+
// Log the profile size after a reasonable startup delay.
BrowserThread::PostDelayedTask(BrowserThread::FILE, FROM_HERE,
new ProfileSizeTask(path_), 112000);
@@ -1166,7 +1169,7 @@ void ProfileImpl::SpellCheckHostInitialized() {
WebKitContext* ProfileImpl::GetWebKitContext() {
if (!webkit_context_.get())
- webkit_context_ = new WebKitContext(this);
+ webkit_context_ = new WebKitContext(this, clear_local_state_on_exit_);
DCHECK(webkit_context_.get());
return webkit_context_.get();
}
@@ -1205,6 +1208,12 @@ void ProfileImpl::Observe(NotificationType type,
NotificationService::current()->Notify(
NotificationType::SPELLCHECK_AUTOSPELL_TOGGLED,
Source<Profile>(this), NotificationService::NoDetails());
+ } else if (*pref_name_in == prefs::kClearSiteDataOnExit) {
+ clear_local_state_on_exit_ =
+ prefs->GetBoolean(prefs::kClearSiteDataOnExit);
+ if (webkit_context_)
+ webkit_context_->set_clear_local_state_on_exit(
+ clear_local_state_on_exit_);
}
} else if (NotificationType::THEME_INSTALLED == type) {
DCHECK_EQ(Source<Profile>(source).ptr(), GetOriginalProfile());
« no previous file with comments | « chrome/browser/profile_impl.h ('k') | chrome/test/testing_profile.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698