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

Side by Side Diff: chrome/browser/prefs/pref_service.cc

Issue 11027070: Moved JsonPrefStore to use SequencedWorkerPool (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/prefs/pref_service.h" 5 #include "chrome/browser/prefs/pref_service.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 116
117 } // namespace 117 } // namespace
118 118
119 PrefServiceBase* PrefServiceBase::FromBrowserContext(BrowserContext* context) { 119 PrefServiceBase* PrefServiceBase::FromBrowserContext(BrowserContext* context) {
120 return static_cast<Profile*>(context)->GetPrefs(); 120 return static_cast<Profile*>(context)->GetPrefs();
121 } 121 }
122 122
123 // static 123 // static
124 PrefService* PrefService::CreatePrefService( 124 PrefService* PrefService::CreatePrefService(
125 const FilePath& pref_filename, 125 const FilePath& pref_filename,
126 base::SequencedTaskRunner* pref_io_task_runner,
126 policy::PolicyService* policy_service, 127 policy::PolicyService* policy_service,
127 PrefStore* extension_prefs, 128 PrefStore* extension_prefs,
128 bool async) { 129 bool async) {
129 using policy::ConfigurationPolicyPrefStore; 130 using policy::ConfigurationPolicyPrefStore;
130 131
131 #if defined(OS_LINUX) 132 #if defined(OS_LINUX)
132 // We'd like to see what fraction of our users have the preferences 133 // We'd like to see what fraction of our users have the preferences
133 // stored on a network file system, as we've had no end of troubles 134 // stored on a network file system, as we've had no end of troubles
134 // with NFS/AFS. 135 // with NFS/AFS.
135 // TODO(evanm): remove this once we've collected state. 136 // TODO(evanm): remove this once we've collected state.
(...skipping 13 matching lines...) Expand all
149 ConfigurationPolicyPrefStore::CreateRecommendedPolicyPrefStore( 150 ConfigurationPolicyPrefStore::CreateRecommendedPolicyPrefStore(
150 policy_service); 151 policy_service);
151 #else 152 #else
152 ConfigurationPolicyPrefStore* managed = NULL; 153 ConfigurationPolicyPrefStore* managed = NULL;
153 ConfigurationPolicyPrefStore* recommended = NULL; 154 ConfigurationPolicyPrefStore* recommended = NULL;
154 #endif // ENABLE_CONFIGURATION_POLICY 155 #endif // ENABLE_CONFIGURATION_POLICY
155 156
156 CommandLinePrefStore* command_line = 157 CommandLinePrefStore* command_line =
157 new CommandLinePrefStore(CommandLine::ForCurrentProcess()); 158 new CommandLinePrefStore(CommandLine::ForCurrentProcess());
158 JsonPrefStore* user = new JsonPrefStore( 159 JsonPrefStore* user = new JsonPrefStore(
159 pref_filename, 160 pref_filename, pref_io_task_runner);
160 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE));
161 DefaultPrefStore* default_pref_store = new DefaultPrefStore(); 161 DefaultPrefStore* default_pref_store = new DefaultPrefStore();
162 162
163 PrefNotifierImpl* pref_notifier = new PrefNotifierImpl(); 163 PrefNotifierImpl* pref_notifier = new PrefNotifierImpl();
164 PrefModelAssociator* pref_sync_associator = new PrefModelAssociator(); 164 PrefModelAssociator* pref_sync_associator = new PrefModelAssociator();
165 165
166 return new PrefService( 166 return new PrefService(
167 pref_notifier, 167 pref_notifier,
168 new PrefValueStore( 168 new PrefValueStore(
169 managed, 169 managed,
170 extension_prefs, 170 extension_prefs,
(...skipping 888 matching lines...) Expand 10 before | Expand all | Expand 10 after
1059 return pref_value_store()->PrefValueFromDefaultStore(name_.c_str()); 1059 return pref_value_store()->PrefValueFromDefaultStore(name_.c_str());
1060 } 1060 }
1061 1061
1062 bool PrefService::Preference::IsUserModifiable() const { 1062 bool PrefService::Preference::IsUserModifiable() const {
1063 return pref_value_store()->PrefValueUserModifiable(name_.c_str()); 1063 return pref_value_store()->PrefValueUserModifiable(name_.c_str());
1064 } 1064 }
1065 1065
1066 bool PrefService::Preference::IsExtensionModifiable() const { 1066 bool PrefService::Preference::IsExtensionModifiable() const {
1067 return pref_value_store()->PrefValueExtensionModifiable(name_.c_str()); 1067 return pref_value_store()->PrefValueExtensionModifiable(name_.c_str());
1068 } 1068 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698