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

Unified Diff: chrome/browser/chrome_browser_main.cc

Issue 11027070: Moved JsonPrefStore to use SequencedWorkerPool (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 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/chrome_browser_main.cc
diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc
index 309041ee9d42ee2629b730926910227b5fc03633..b5833adda27b50f8744306ab9969588bd5400c49 100644
--- a/chrome/browser/chrome_browser_main.cc
+++ b/chrome/browser/chrome_browser_main.cc
@@ -268,8 +268,11 @@ void InitializeNetworkOptions(const CommandLine& parsed_command_line,
}
// Returns the new local state object, guaranteed non-NULL.
-PrefService* InitializeLocalState(const CommandLine& parsed_command_line,
- bool is_first_run) {
+// |local_state_task_runner| must be a shutdown-blocking task runner.
+PrefService* InitializeLocalState(
+ base::SequencedTaskRunner* local_state_task_runner,
+ const CommandLine& parsed_command_line,
+ bool is_first_run) {
FilePath local_state_path;
PathService::Get(chrome::FILE_LOCAL_STATE, &local_state_path);
bool local_state_file_exists = file_util::PathExists(local_state_path);
@@ -325,7 +328,7 @@ PrefService* InitializeLocalState(const CommandLine& parsed_command_line,
scoped_ptr<PrefService> parent_local_state(
PrefService::CreatePrefService(parent_profile,
g_browser_process->policy_service(),
- NULL, false));
+ NULL, false, local_state_task_runner));
parent_local_state->RegisterStringPref(prefs::kApplicationLocale,
std::string());
// Right now, we only inherit the locale setting from the parent profile.
@@ -704,7 +707,15 @@ int ChromeBrowserMainParts::PreCreateThreadsImpl() {
parsed_command_line().HasSwitch(switches::kFirstRun)) &&
!HasImportSwitch(parsed_command_line());
#endif
- browser_process_.reset(new BrowserProcessImpl(parsed_command_line()));
+
+
+ FilePath local_state_path;
+ PathService::Get(chrome::FILE_LOCAL_STATE, &local_state_path);
akalin 2012/10/19 23:12:21 hmm. CHECK or otherwise handle if Get() returns fa
zel 2012/10/21 20:03:19 Done.
+ scoped_refptr<base::SequencedTaskRunner> local_state_task_runner =
+ JsonPrefStore::GetTaskRunnerForFile(local_state_path,
+ BrowserThread::GetBlockingPool());
+ browser_process_.reset(new BrowserProcessImpl(local_state_task_runner,
+ parsed_command_line()));
if (parsed_command_line().HasSwitch(switches::kEnableProfiling)) {
// User wants to override default tracking status.
@@ -726,7 +737,9 @@ int ChromeBrowserMainParts::PreCreateThreadsImpl() {
switches::kProfilingOutputFile));
}
- local_state_ = InitializeLocalState(parsed_command_line(), is_first_run_);
+ local_state_ = InitializeLocalState(local_state_task_runner,
+ parsed_command_line(),
+ is_first_run_);
// These members must be initialized before returning from this function.
master_prefs_.reset(new first_run::MasterPrefs);

Powered by Google App Engine
This is Rietveld 408576698