This source file includes following definitions.
- ServiceProcessMain
#include "base/debug/debugger.h"
#include "base/message_loop/message_loop.h"
#include "base/metrics/statistics_recorder.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/service_process_util.h"
#include "chrome/service/service_process.h"
#include "content/public/common/main_function_params.h"
#include "net/url_request/url_request.h"
#if defined(OS_WIN)
#include "content/public/common/sandbox_init.h"
#include "sandbox/win/src/sandbox_types.h"
#endif
int ServiceProcessMain(const content::MainFunctionParams& parameters) {
net::URLRequest::SetDefaultCookiePolicyToBlock();
base::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.GetCommandLineString();
base::PlatformThread::SetName("CrServiceMain");
base::StatisticsRecorder::Initialize();
scoped_ptr<ServiceProcessState> state(new ServiceProcessState);
if (!state->Initialize())
return 0;
ServiceProcess service_process;
if (service_process.Initialize(&main_message_loop,
parameters.command_line,
state.release())) {
base::MessageLoop::current()->Run();
} else {
LOG(ERROR) << "Service process failed to initialize";
}
service_process.Teardown();
return 0;
}