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/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/debug/debugger.h" | 6 #include "base/debug/debugger.h" |
7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
8 #include "base/threading/platform_thread.h" | |
9 #include "build/build_config.h" | 8 #include "build/build_config.h" |
10 #include "content/common/child_process.h" | 9 #include "content/common/child_process.h" |
11 #include "content/common/content_switches.h" | 10 #include "content/common/content_switches.h" |
12 #include "content/common/main_function_params.h" | 11 #include "content/common/main_function_params.h" |
13 #include "content/ppapi_plugin/ppapi_thread.h" | 12 #include "content/ppapi_plugin/ppapi_thread.h" |
14 #include "ppapi/proxy/proxy_module.h" | 13 #include "ppapi/proxy/proxy_module.h" |
15 | 14 |
16 #if defined(OS_WIN) | 15 #if defined(OS_WIN) |
17 #include "sandbox/src/sandbox.h" | 16 #include "sandbox/src/sandbox.h" |
18 #endif | 17 #endif |
(...skipping 15 matching lines...) Expand all Loading... |
34 // If |g_target_services| is not null this process is sandboxed. One side | 33 // If |g_target_services| is not null this process is sandboxed. One side |
35 // effect is that we can't pop dialogs like ChildProcess::WaitForDebugger() | 34 // effect is that we can't pop dialogs like ChildProcess::WaitForDebugger() |
36 // does. | 35 // does. |
37 if (command_line.HasSwitch(switches::kPpapiStartupDialog)) { | 36 if (command_line.HasSwitch(switches::kPpapiStartupDialog)) { |
38 if (g_target_services) | 37 if (g_target_services) |
39 base::debug::WaitForDebugger(2*60, false); | 38 base::debug::WaitForDebugger(2*60, false); |
40 else | 39 else |
41 ChildProcess::WaitForDebugger("Ppapi"); | 40 ChildProcess::WaitForDebugger("Ppapi"); |
42 } | 41 } |
43 | 42 |
44 MessageLoop main_message_loop(MessageLoop::TYPE_IO); | 43 MessageLoop main_message_loop("CrPPAPIMain", MessageLoop::TYPE_IO); |
45 base::PlatformThread::SetName("CrPPAPIMain"); | |
46 | 44 |
47 ChildProcess ppapi_process; | 45 ChildProcess ppapi_process; |
48 ppapi_process.set_main_thread(new PpapiThread(false)); // Not a broker. | 46 ppapi_process.set_main_thread(new PpapiThread(false)); // Not a broker. |
49 | 47 |
50 pp::proxy::ProxyModule::GetInstance()->SetFlashCommandLineArgs( | 48 pp::proxy::ProxyModule::GetInstance()->SetFlashCommandLineArgs( |
51 command_line.GetSwitchValueASCII(switches::kPpapiFlashArgs)); | 49 command_line.GetSwitchValueASCII(switches::kPpapiFlashArgs)); |
52 | 50 |
53 main_message_loop.Run(); | 51 main_message_loop.Run(); |
54 return 0; | 52 return 0; |
55 } | 53 } |
OLD | NEW |