Chromium Code Reviews| Index: content/ppapi_plugin/ppapi_plugin_main.cc |
| =================================================================== |
| --- content/ppapi_plugin/ppapi_plugin_main.cc (revision 83426) |
| +++ content/ppapi_plugin/ppapi_plugin_main.cc (working copy) |
| @@ -2,6 +2,7 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| +#include "base/debug/debugger.h" |
| #include "base/message_loop.h" |
| #include "base/threading/platform_thread.h" |
| #include "build/build_config.h" |
| @@ -10,11 +11,32 @@ |
| #include "content/common/main_function_params.h" |
| #include "content/ppapi_plugin/ppapi_thread.h" |
| +#if defined(OS_WIN) |
| +#include "sandbox/src/sandbox.h" |
| +#endif |
| + |
| +#if defined(OS_WIN) |
| +sandbox::TargetServices* g_target_services; |
|
brettw
2011/05/06 04:30:52
It's weird you initialize the void* below and not
|
| +#else |
| +void* g_target_services = 0; |
| +#endif |
| + |
| // Main function for starting the PPAPI plugin process. |
| int PpapiPluginMain(const MainFunctionParams& parameters) { |
| const CommandLine& command_line = parameters.command_line_; |
| + |
| +#if defined(OS_WIN) |
| + g_target_services = parameters.sandbox_info_.TargetServices(); |
| +#endif |
| + |
| + // If |g_target_services| is not null this process is sandboxed. One side |
| + // effect is that we can't pop dialogs like ChildProcess::WaitForDebugger() |
| + // does. |
| if (command_line.HasSwitch(switches::kPpapiStartupDialog)) { |
| - ChildProcess::WaitForDebugger("Ppapi"); |
| + if (g_target_services) |
| + base::debug::WaitForDebugger(2*60, false); |
| + else |
| + ChildProcess::WaitForDebugger("Ppapi"); |
| } |
| MessageLoop main_message_loop(MessageLoop::TYPE_UI); |