blob: 17cd7b7200d97efacada7260d920fbd0356e3151 [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"
9#include "content/common/main_function_params.h"
10#include "content/ppapi_plugin/ppapi_thread.h"
[email protected]c08950d22011-10-13 22:20:2911#include "content/public/common/content_switches.h"
[email protected]36254f732011-04-07 16:32:5312
13// Main function for starting the PPAPI broker process.
14int PpapiBrokerMain(const MainFunctionParams& parameters) {
15 const CommandLine& command_line = parameters.command_line_;
16 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();
27 return 0;
28}