| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/threading/platform_thread.h" | 6 #include "base/threading/platform_thread.h" |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 #include "content/common/child_process.h" | 8 #include "content/common/child_process.h" |
| 9 #include "content/common/main_function_params.h" | 9 #include "content/common/main_function_params.h" |
| 10 #include "content/ppapi_plugin/ppapi_thread.h" | 10 #include "content/ppapi_plugin/ppapi_thread.h" |
| 11 #include "content/public/common/content_switches.h" | 11 #include "content/public/common/content_switches.h" |
| 12 | 12 |
| 13 // Main function for starting the PPAPI broker process. | 13 // Main function for starting the PPAPI broker process. |
| 14 int PpapiBrokerMain(const MainFunctionParams& parameters) { | 14 int PpapiBrokerMain(const MainFunctionParams& parameters) { |
| 15 const CommandLine& command_line = parameters.command_line_; | 15 const CommandLine& command_line = parameters.command_line; |
| 16 if (command_line.HasSwitch(switches::kPpapiStartupDialog)) { | 16 if (command_line.HasSwitch(switches::kPpapiStartupDialog)) { |
| 17 ChildProcess::WaitForDebugger("PpapiBroker"); | 17 ChildProcess::WaitForDebugger("PpapiBroker"); |
| 18 } | 18 } |
| 19 | 19 |
| 20 MessageLoop main_message_loop(MessageLoop::TYPE_DEFAULT); | 20 MessageLoop main_message_loop(MessageLoop::TYPE_DEFAULT); |
| 21 base::PlatformThread::SetName("CrPPAPIBrokerMain"); | 21 base::PlatformThread::SetName("CrPPAPIBrokerMain"); |
| 22 | 22 |
| 23 ChildProcess ppapi_broker_process; | 23 ChildProcess ppapi_broker_process; |
| 24 ppapi_broker_process.set_main_thread(new PpapiThread(true)); // Broker. | 24 ppapi_broker_process.set_main_thread(new PpapiThread(true)); // Broker. |
| 25 | 25 |
| 26 main_message_loop.Run(); | 26 main_message_loop.Run(); |
| 27 DVLOG(1) << "PpapiBrokerMain exiting"; | 27 DVLOG(1) << "PpapiBrokerMain exiting"; |
| 28 return 0; | 28 return 0; |
| 29 } | 29 } |
| OLD | NEW |