| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/base_switches.h" | 5 #include "base/base_switches.h" |
| 6 #include "base/debug/debugger.h" | 6 #include "base/debug/debugger.h" |
| 7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
| 8 #include "base/metrics/statistics_recorder.h" | 8 #include "base/metrics/statistics_recorder.h" |
| 9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "chrome/common/service_process_util.h" | 10 #include "chrome/common/service_process_util.h" |
| 11 #include "chrome/service/service_process.h" | 11 #include "chrome/service/service_process.h" |
| 12 #include "content/public/common/main_function_params.h" | 12 #include "content/public/common/main_function_params.h" |
| 13 #include "net/url_request/url_request.h" | 13 #include "net/url_request/url_request.h" |
| 14 | 14 |
| 15 // Mainline routine for running as the service process. | 15 // Mainline routine for running as the Cloud Print service process. |
| 16 int ServiceProcessMain(const content::MainFunctionParams& parameters) { | 16 int CloudPrintServiceProcessMain( |
| 17 const content::MainFunctionParams& parameters) { |
| 17 // Chrome disallows cookies by default. All code paths that want to use | 18 // Chrome disallows cookies by default. All code paths that want to use |
| 18 // cookies should go through the browser process. | 19 // cookies should go through the browser process. |
| 19 net::URLRequest::SetDefaultCookiePolicyToBlock(); | 20 net::URLRequest::SetDefaultCookiePolicyToBlock(); |
| 20 | 21 |
| 21 base::PlatformThread::SetName("CrServiceMain"); | 22 base::PlatformThread::SetName("CrServiceMain"); |
| 22 base::MessageLoopForUI main_message_loop; | 23 base::MessageLoopForUI main_message_loop; |
| 23 if (parameters.command_line.HasSwitch(switches::kWaitForDebugger)) { | 24 if (parameters.command_line.HasSwitch(switches::kWaitForDebugger)) { |
| 24 base::debug::WaitForDebugger(60, true); | 25 base::debug::WaitForDebugger(60, true); |
| 25 } | 26 } |
| 26 | 27 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 37 ServiceProcess service_process; | 38 ServiceProcess service_process; |
| 38 if (service_process.Initialize(&main_message_loop, | 39 if (service_process.Initialize(&main_message_loop, |
| 39 parameters.command_line, | 40 parameters.command_line, |
| 40 state.release())) { | 41 state.release())) { |
| 41 base::RunLoop().Run(); | 42 base::RunLoop().Run(); |
| 42 } else { | 43 } else { |
| 43 LOG(ERROR) << "Service process failed to initialize"; | 44 LOG(ERROR) << "Service process failed to initialize"; |
| 44 } | 45 } |
| 45 return 0; | 46 return 0; |
| 46 } | 47 } |
| OLD | NEW |