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

Unified Diff: chrome/service/service_process.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 side-by-side diff with in-line comments
Download patch
Index: chrome/service/service_process.cc
diff --git a/chrome/service/service_process.cc b/chrome/service/service_process.cc
index f820f938d6401a95a76f0692788265fd65ed5c82..40607d9be222056bf8baa1da48eea4f0a9620d74 100644
--- a/chrome/service/service_process.cc
+++ b/chrome/service/service_process.cc
@@ -13,6 +13,7 @@
#include "base/i18n/rtl.h"
#include "base/memory/singleton.h"
#include "base/path_service.h"
+#include "base/prefs/json_pref_store.h"
#include "base/string16.h"
#include "base/utf_string_conversions.h"
#include "base/values.h"
@@ -152,6 +153,7 @@ bool ServiceProcess::Initialize(MessageLoopForUI* message_loop,
Teardown();
return false;
}
+ blocking_pool_ = new base::SequencedWorkerPool(3, "ServiceBlocking");
request_context_getter_ = new ServiceURLRequestContextGetter();
@@ -159,7 +161,9 @@ bool ServiceProcess::Initialize(MessageLoopForUI* message_loop,
PathService::Get(chrome::DIR_USER_DATA, &user_data_dir);
FilePath pref_path = user_data_dir.Append(chrome::kServiceStateFileName);
service_prefs_.reset(
- new ServiceProcessPrefs(pref_path, file_thread_->message_loop_proxy()));
+ new ServiceProcessPrefs(
+ pref_path,
+ JsonPrefStore::GetTaskRunnerForFile(pref_path, blocking_pool_)));
service_prefs_->ReadPrefs();
// Check if a locale override has been specified on the command-line.
@@ -218,6 +222,12 @@ bool ServiceProcess::Teardown() {
shutdown_event_.Signal();
io_thread_.reset();
file_thread_.reset();
+
+ if (blocking_pool_.get()) {
+ blocking_pool_->Shutdown();
+ blocking_pool_ = NULL;
+ }
+
// The NetworkChangeNotifier must be destroyed after all other threads that
// might use it have been shut down.
network_change_notifier_.reset();

Powered by Google App Engine
This is Rietveld 408576698