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" | 8 #include "base/threading/platform_thread.h" |
9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
10 #include "content/common/child_process.h" | 10 #include "content/common/child_process.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 #endif | 22 #endif |
23 | 23 |
24 #if defined(OS_WIN) | 24 #if defined(OS_WIN) |
25 sandbox::TargetServices* g_target_services = NULL; | 25 sandbox::TargetServices* g_target_services = NULL; |
26 #else | 26 #else |
27 void* g_target_services = 0; | 27 void* g_target_services = 0; |
28 #endif | 28 #endif |
29 | 29 |
30 // Main function for starting the PPAPI plugin process. | 30 // Main function for starting the PPAPI plugin process. |
31 int PpapiPluginMain(const MainFunctionParams& parameters) { | 31 int PpapiPluginMain(const MainFunctionParams& parameters) { |
32 const CommandLine& command_line = parameters.command_line_; | 32 const CommandLine& command_line = parameters.command_line; |
33 | 33 |
34 #if defined(OS_WIN) | 34 #if defined(OS_WIN) |
35 g_target_services = parameters.sandbox_info_.TargetServices(); | 35 g_target_services = parameters.sandbox_info->target_services; |
36 #endif | 36 #endif |
37 | 37 |
38 // If |g_target_services| is not null this process is sandboxed. One side | 38 // If |g_target_services| is not null this process is sandboxed. One side |
39 // effect is that we can't pop dialogs like ChildProcess::WaitForDebugger() | 39 // effect is that we can't pop dialogs like ChildProcess::WaitForDebugger() |
40 // does. | 40 // does. |
41 if (command_line.HasSwitch(switches::kPpapiStartupDialog)) { | 41 if (command_line.HasSwitch(switches::kPpapiStartupDialog)) { |
42 if (g_target_services) | 42 if (g_target_services) |
43 base::debug::WaitForDebugger(2*60, false); | 43 base::debug::WaitForDebugger(2*60, false); |
44 else | 44 else |
45 ChildProcess::WaitForDebugger("Ppapi"); | 45 ChildProcess::WaitForDebugger("Ppapi"); |
(...skipping 10 matching lines...) Expand all Loading... |
56 | 56 |
57 ChildProcess ppapi_process; | 57 ChildProcess ppapi_process; |
58 ppapi_process.set_main_thread(new PpapiThread(false)); // Not a broker. | 58 ppapi_process.set_main_thread(new PpapiThread(false)); // Not a broker. |
59 | 59 |
60 ppapi::proxy::ProxyModule::GetInstance()->SetFlashCommandLineArgs( | 60 ppapi::proxy::ProxyModule::GetInstance()->SetFlashCommandLineArgs( |
61 command_line.GetSwitchValueASCII(switches::kPpapiFlashArgs)); | 61 command_line.GetSwitchValueASCII(switches::kPpapiFlashArgs)); |
62 | 62 |
63 main_message_loop.Run(); | 63 main_message_loop.Run(); |
64 return 0; | 64 return 0; |
65 } | 65 } |
OLD | NEW |