Index: chrome/service/service_process.cc |
diff --git a/chrome/service/service_process.cc b/chrome/service/service_process.cc |
index f820f938d6401a95a76f0692788265fd65ed5c82..6a3c99dc6a09c22832facb7dbf895e3a8027ae73 100644 |
--- a/chrome/service/service_process.cc |
+++ b/chrome/service/service_process.cc |
@@ -20,6 +20,7 @@ |
#include "chrome/common/chrome_paths.h" |
#include "chrome/common/chrome_switches.h" |
#include "chrome/common/env_vars.h" |
+#include "chrome/common/json_pref_store.h" |
#include "chrome/common/pref_names.h" |
#include "chrome/common/service_process_util.h" |
#include "chrome/service/cloud_print/cloud_print_proxy.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(); |