summaryrefslogtreecommitdiffstats
path: root/chrome/service/service_main.cc
diff options
context:
space:
mode:
authorsanjeevr@chromium.org <sanjeevr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-31 07:57:00 +0000
committersanjeevr@chromium.org <sanjeevr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-31 07:57:00 +0000
commit38fe1964640f28c273b2a68a564b7c47a68f8b01 (patch)
tree872c11ad9630842dc2a39b6bbe64877bcd41f0d0 /chrome/service/service_main.cc
parent6364aad5c4a477197165def0a06f118acd422744 (diff)
downloadchromium_src-38fe1964640f28c273b2a68a564b7c47a68f8b01.zip
chromium_src-38fe1964640f28c273b2a68a564b7c47a68f8b01.tar.gz
chromium_src-38fe1964640f28c273b2a68a564b7c47a68f8b01.tar.bz2
Added an IPC server in the service process to listen to commands. This is not used yet.
BUG=None TEST=None for now since this code is not enabled. Review URL: http://codereview.chromium.org/3041036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54440 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/service/service_main.cc')
-rw-r--r--chrome/service/service_main.cc24
1 files changed, 3 insertions, 21 deletions
diff --git a/chrome/service/service_main.cc b/chrome/service/service_main.cc
index 2f09489..e44521e 100644
--- a/chrome/service/service_main.cc
+++ b/chrome/service/service_main.cc
@@ -4,10 +4,8 @@
#include "base/message_loop.h"
#include "base/path_service.h"
-#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h"
-#include "chrome/common/json_pref_store.h"
#include "chrome/common/main_function_params.h"
#include "chrome/common/sandbox_policy.h"
#include "chrome/service/cloud_print/cloud_print_proxy.h"
@@ -44,29 +42,12 @@ int ServiceProcessMain(const MainFunctionParams& parameters) {
ServiceProcess service_process;
service_process.Initialize();
- // TODO(sanjeevr): The interface to start individual services such as the
- // cloud print proxy needs to change from a command-line interface to an
- // IPC interface. There will be eventually only one service process to handle
- // requests from multiple Chrome browser profiles. The path of the user data
- // directory will be passed in to the command and there will be one instance
- // of services such as the cloud print proxy per requesting profile.
- FilePath user_data_dir;
- PathService::Get(chrome::DIR_USER_DATA, &user_data_dir);
- FilePath pref_path = user_data_dir.Append(chrome::kServiceStateFileName);
- scoped_ptr<JsonPrefStore> service_prefs(
- new JsonPrefStore(
- pref_path,
- service_process.file_thread()->message_loop_proxy()));
- service_prefs->ReadPrefs();
-
// Enable Cloud Print if needed.
if (parameters.command_line_.HasSwitch(switches::kEnableCloudPrintProxy)) {
std::string lsid =
parameters.command_line_.GetSwitchValueASCII(
switches::kServiceAccountLsid);
- CloudPrintProxy* cloud_print_proxy =
- service_process.CreateCloudPrintProxy(service_prefs.get());
- cloud_print_proxy->EnableForUser(lsid);
+ service_process.GetCloudPrintProxy()->EnableForUser(lsid);
}
#if defined(ENABLE_REMOTING)
@@ -74,6 +55,8 @@ int ServiceProcessMain(const MainFunctionParams& parameters) {
// TODO(hclam): Merge this config file with Cloud Printing.
// TODO(hclam): There is only start but not stop of the chromoting host
// process.
+ FilePath user_data_dir;
+ PathService::Get(chrome::DIR_USER_DATA, &user_data_dir);
FilePath chromoting_config_path =
user_data_dir.Append(FILE_PATH_LITERAL(".ChromotingConfig.json"));
scoped_refptr<remoting::JsonHostConfig> chromoting_config;
@@ -107,7 +90,6 @@ int ServiceProcessMain(const MainFunctionParams& parameters) {
#endif
MessageLoop::current()->Run();
- service_prefs->WritePrefs();
service_process.Teardown();
return 0;