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..523fc5888855c5152d513d0a8ab4de619bb643be 100644 |
--- a/chrome/browser/chrome_browser_main.cc |
+++ b/chrome/browser/chrome_browser_main.cc |
@@ -25,6 +25,7 @@ |
#include "base/string_split.h" |
#include "base/sys_string_conversions.h" |
#include "base/threading/platform_thread.h" |
+#include "base/threading/sequenced_worker_pool.h" |
akalin
2012/10/19 02:00:51
not needed anymore (if you use GetTaskRunnerForFil
zel
2012/10/19 18:45:07
Done.
|
#include "base/time.h" |
#include "base/utf_string_conversions.h" |
#include "base/values.h" |
@@ -268,8 +269,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 +329,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 +708,19 @@ 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); |
+ scoped_refptr<base::SequencedTaskRunner> local_state_task_runner = |
akalin
2012/10/19 02:00:51
did you forget to use JsonPrefStore::GetTaskRunner
zel
2012/10/19 18:45:07
Done.
|
+ BrowserThread::GetBlockingPool()-> |
+ GetSequencedTaskRunnerWithShutdownBehavior( |
+ BrowserThread::GetBlockingPool()->GetNamedSequenceToken( |
+ local_state_path.AsUTF8Unsafe()), |
+ base::SequencedWorkerPool::BLOCK_SHUTDOWN); |
+ |
+ 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 +742,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); |