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

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

Issue 9764006: Make ExtensionPrefValueMap a ProfileKeyedService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: -- Created 8 years, 8 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 1f6179dfa3ed434b61533c46eb9b0d90cf6c9686..208a4c2abe7757194e688c8859c5a64312de70bf 100644
--- a/chrome/browser/profiles/profile_impl.cc
+++ b/chrome/browser/profiles/profile_impl.cc
@@ -31,6 +31,7 @@
#include "chrome/browser/extensions/extension_event_router.h"
#include "chrome/browser/extensions/extension_pref_store.h"
#include "chrome/browser/extensions/extension_pref_value_map.h"
+#include "chrome/browser/extensions/extension_pref_value_map_factory.h"
#include "chrome/browser/extensions/extension_process_manager.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/extension_special_storage_policy.h"
@@ -252,7 +253,8 @@ ProfileImpl::ProfileImpl(const FilePath& path,
if (create_mode == CREATE_MODE_ASYNCHRONOUS) {
prefs_.reset(PrefService::CreatePrefService(
GetPrefFilePath(),
- new ExtensionPrefStore(GetExtensionPrefValueMap(), false),
+ new ExtensionPrefStore(
+ ExtensionPrefValueMapFactory::GetForProfile(this), false),
true));
// Wait for the notification that prefs has been loaded (successfully or
// not).
@@ -262,7 +264,8 @@ ProfileImpl::ProfileImpl(const FilePath& path,
// Load prefs synchronously.
prefs_.reset(PrefService::CreatePrefService(
GetPrefFilePath(),
- new ExtensionPrefStore(GetExtensionPrefValueMap(), false),
+ new ExtensionPrefStore(
+ ExtensionPrefValueMapFactory::GetForProfile(this), false),
false));
OnPrefsLoaded(true);
} else {
@@ -561,7 +564,8 @@ Profile* ProfileImpl::GetOffTheRecordProfile() {
void ProfileImpl::DestroyOffTheRecordProfile() {
off_the_record_profile_.reset();
- extension_pref_value_map_->ClearAllIncognitoSessionOnlyPreferences();
+ ExtensionPrefValueMapFactory::GetForProfile(this)->
+ ClearAllIncognitoSessionOnlyPreferences();
}
bool ProfileImpl::HasOffTheRecordProfile() {
@@ -663,7 +667,8 @@ PrefService* ProfileImpl::GetOffTheRecordPrefs() {
// The new ExtensionPrefStore is ref_counted and the new PrefService
// stores a reference so that we do not leak memory here.
otr_prefs_.reset(GetPrefs()->CreateIncognitoPrefService(
- new ExtensionPrefStore(GetExtensionPrefValueMap(), true)));
+ new ExtensionPrefStore(
+ ExtensionPrefValueMapFactory::GetForProfile(this), true)));
}
return otr_prefs_.get();
}
@@ -882,12 +887,6 @@ history::TopSites* ProfileImpl::GetTopSitesWithoutCreating() {
return top_sites_;
}
-ExtensionPrefValueMap* ProfileImpl::GetExtensionPrefValueMap() {
- if (!extension_pref_value_map_.get())
- extension_pref_value_map_.reset(new ExtensionPrefValueMap);
- return extension_pref_value_map_.get();
-}
-
void ProfileImpl::MarkAsCleanShutdown() {
if (prefs_.get()) {
// The session cleanly exited, set kSessionExitedCleanly appropriately.
« no previous file with comments | « chrome/browser/profiles/profile_impl.h ('k') | chrome/browser/protector/protected_prefs_watcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698