blob: 7963e29194a9d26bed07f2d85fc8f5d8527d7b96 [file] [log] [blame]
[email protected]36254f732011-04-07 16:32:531// 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
3// found in the LICENSE file.
4
5#include "base/message_loop.h"
6#include "base/threading/platform_thread.h"
7#include "build/build_config.h"
[email protected]36254f732011-04-07 16:32:538#include "content/common/child_process.h"
[email protected]36254f732011-04-07 16:32:539#include "content/ppapi_plugin/ppapi_thread.h"
[email protected]c08950d22011-10-13 22:20:2910#include "content/public/common/content_switches.h"
[email protected]4573fbd2011-10-31 20:25:1811#include "content/public/common/main_function_params.h"
[email protected]36254f732011-04-07 16:32:5312
13// Main function for starting the PPAPI broker process.
[email protected]4573fbd2011-10-31 20:25:1814int PpapiBrokerMain(const content::MainFunctionParams& parameters) {
[email protected]badf5cf2011-10-29 03:44:4415 const CommandLine& command_line = parameters.command_line;
[email protected]36254f732011-04-07 16:32:5316 if (command_line.HasSwitch(switches::kPpapiStartupDialog)) {
[email protected]6407f2892011-04-14 02:41:0917 ChildProcess::WaitForDebugger("PpapiBroker");
[email protected]36254f732011-04-07 16:32:5318 }
19
20 MessageLoop main_message_loop(MessageLoop::TYPE_DEFAULT);
21 base::PlatformThread::SetName("CrPPAPIBrokerMain");
22
23 ChildProcess ppapi_broker_process;
[email protected]6407f2892011-04-14 02:41:0924 ppapi_broker_process.set_main_thread(new PpapiThread(true)); // Broker.
[email protected]36254f732011-04-07 16:32:5325
26 main_message_loop.Run();
[email protected]1977348dd2011-10-26 22:27:4127 DVLOG(1) << "PpapiBrokerMain exiting";
[email protected]36254f732011-04-07 16:32:5328 return 0;
29}