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

Unified Diff: chrome/service/service_main.cc

Issue 6349029: Get service processes working on Mac and Linux. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix up small typo in comment Created 9 years, 11 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
« no previous file with comments | « chrome/service/service_ipc_server.cc ('k') | chrome/service/service_process.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/service/service_main.cc
diff --git a/chrome/service/service_main.cc b/chrome/service/service_main.cc
index 67f7c94a60cc7ad8362730937a1a7427107e7ffd..722ce3dd3e8ba9b3451d6765bc255ec172e05e78 100644
--- a/chrome/service/service_main.cc
+++ b/chrome/service/service_main.cc
@@ -4,53 +4,54 @@
#include "base/debug/debugger.h"
#include "base/message_loop.h"
-#include "base/path_service.h"
-#include "base/singleton.h"
-#include "base/threading/platform_thread.h"
-#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/main_function_params.h"
-#include "chrome/common/sandbox_policy.h"
#include "chrome/common/service_process_util.h"
-#include "chrome/service/cloud_print/cloud_print_proxy.h"
#include "chrome/service/service_process.h"
-#if defined(OS_MACOSX)
+#if defined(OS_WIN)
+#include "chrome/common/sandbox_policy.h"
+#elif defined(OS_MACOSX)
#include "chrome/common/chrome_application_mac.h"
-#endif
+#endif // defined(OS_WIN)
// Mainline routine for running as the service process.
int ServiceProcessMain(const MainFunctionParams& parameters) {
- // If there is already a service process running, quit now.
- if (!ServiceProcessState::GetInstance()->Initialize())
- return 0;
-
MessageLoopForUI main_message_loop;
+ main_message_loop.set_thread_name("MainThread");
if (parameters.command_line_.HasSwitch(switches::kWaitForDebugger)) {
base::debug::WaitForDebugger(60, true);
}
+ VLOG(1) << "Service process launched: "
+ << parameters.command_line_.command_line_string();
+
#if defined(OS_MACOSX)
chrome_application_mac::RegisterCrApp();
#endif
base::PlatformThread::SetName("CrServiceMain");
+ // If there is already a service process running, quit now.
+ if (!ServiceProcessState::GetInstance()->Initialize())
+ return 0;
+
#if defined(OS_WIN)
sandbox::BrokerServices* broker_services =
parameters.sandbox_info_.BrokerServices();
if (broker_services)
sandbox::InitBrokerServices(broker_services);
-#endif // defined(OS_WIN)
+#elif defined(OS_MACOSX)
+ chrome_application_mac::RegisterCrApp();
+#endif // defined(OS_WIN)
ServiceProcess service_process;
- if (!service_process.Initialize(&main_message_loop,
- parameters.command_line_)) {
+ if (service_process.Initialize(&main_message_loop,
+ parameters.command_line_)) {
+ MessageLoop::current()->Run();
+ } else {
LOG(ERROR) << "Service process failed to initialize";
- return 0;
}
-
- MessageLoop::current()->Run();
service_process.Teardown();
return 0;
}
« no previous file with comments | « chrome/service/service_ipc_server.cc ('k') | chrome/service/service_process.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698