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

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: rebase 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..920719deb38ddf5f971f54258fd3d221820d7789 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"
#include "base/time.h"
#include "base/utf_string_conversions.h"
#include "base/values.h"
@@ -268,8 +269,10 @@ void InitializeNetworkOptions(const CommandLine& parsed_command_line,
}
// Returns the new local state object, guaranteed non-NULL.
akalin 2012/10/18 23:52:24 add a comment saying that local_state_task_runner
zel 2012/10/19 01:20:32 Done.
-PrefService* InitializeLocalState(const CommandLine& parsed_command_line,
- bool is_first_run) {
+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,17 @@ int ChromeBrowserMainParts::PreCreateThreadsImpl() {
parsed_command_line().HasSwitch(switches::kFirstRun)) &&
!HasImportSwitch(parsed_command_line());
#endif
- browser_process_.reset(new BrowserProcessImpl(parsed_command_line()));
+
+
+ scoped_refptr<base::SequencedTaskRunner> local_state_task_runner =
akalin 2012/10/18 23:52:24 can you instead get the local state path here and
zel 2012/10/19 01:20:32 Done.
+ BrowserThread::GetBlockingPool()->
+ GetSequencedTaskRunnerWithShutdownBehavior(
+ BrowserThread::GetBlockingPool()->GetNamedSequenceToken(
+ "local_state_pool"),
+ 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 +739,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