| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/message_loop.h" | 5 #include "base/message_loop.h" |
| 6 #include "base/path_service.h" | 6 #include "base/path_service.h" |
| 7 #include "chrome/common/chrome_constants.h" | 7 #include "chrome/common/chrome_constants.h" |
| 8 #include "chrome/common/chrome_paths.h" | 8 #include "chrome/common/chrome_paths.h" |
| 9 #include "chrome/common/chrome_switches.h" | 9 #include "chrome/common/chrome_switches.h" |
| 10 #include "chrome/common/json_pref_store.h" | 10 #include "chrome/common/json_pref_store.h" |
| 11 #include "chrome/common/main_function_params.h" | 11 #include "chrome/common/main_function_params.h" |
| 12 #include "chrome/service/cloud_print/cloud_print_proxy.h" | 12 #include "chrome/service/cloud_print/cloud_print_proxy.h" |
| 13 #include "chrome/service/service_process.h" | 13 #include "chrome/service/service_process.h" |
| 14 | 14 |
| 15 // Mainline routine for running as the service process. | 15 // Mainline routine for running as the service process. |
| 16 int ServiceProcessMain(const MainFunctionParams& parameters) { | 16 int ServiceProcessMain(const MainFunctionParams& parameters) { |
| 17 MessageLoopForUI main_message_loop; | 17 MessageLoopForUI main_message_loop; |
| 18 std::wstring app_name = chrome::kBrowserAppName; | 18 PlatformThread::SetName("CrServiceMain"); |
| 19 PlatformThread::SetName(WideToASCII(app_name + L"_ServiceMain").c_str()); | |
| 20 | 19 |
| 21 ServiceProcess service_process; | 20 ServiceProcess service_process; |
| 22 service_process.Initialize(); | 21 service_process.Initialize(); |
| 23 | 22 |
| 24 // TODO(sanjeevr): The interface to start individual services such as the | 23 // TODO(sanjeevr): The interface to start individual services such as the |
| 25 // cloud print proxy needs to change from a command-line interface to an | 24 // cloud print proxy needs to change from a command-line interface to an |
| 26 // IPC interface. There will be eventually only one service process to handle | 25 // IPC interface. There will be eventually only one service process to handle |
| 27 // requests from multiple Chrome browser profiles. The path of the user data | 26 // requests from multiple Chrome browser profiles. The path of the user data |
| 28 // directory will be passed in to the command and there will be one instance | 27 // directory will be passed in to the command and there will be one instance |
| 29 // of services such as the cloud print proxy per requesting profile. | 28 // of services such as the cloud print proxy per requesting profile. |
| (...skipping 14 matching lines...) Expand all Loading... |
| 44 service_process.CreateCloudPrintProxy(service_prefs.get()); | 43 service_process.CreateCloudPrintProxy(service_prefs.get()); |
| 45 cloud_print_proxy->EnableForUser(lsid); | 44 cloud_print_proxy->EnableForUser(lsid); |
| 46 } | 45 } |
| 47 MessageLoop::current()->Run(); | 46 MessageLoop::current()->Run(); |
| 48 service_prefs->WritePrefs(); | 47 service_prefs->WritePrefs(); |
| 49 service_process.Teardown(); | 48 service_process.Teardown(); |
| 50 | 49 |
| 51 return 0; | 50 return 0; |
| 52 } | 51 } |
| 53 | 52 |
| OLD | NEW |