Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(764)

Side by Side Diff: content/ppapi_plugin/ppapi_plugin_main.cc

Issue 6930059: Make Pepper work out-of-process in the windows sandbox (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/browser/ppapi_plugin_process_host.cc ('k') | content/ppapi_plugin/ppapi_thread.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/message_loop.h" 7 #include "base/message_loop.h"
7 #include "base/threading/platform_thread.h" 8 #include "base/threading/platform_thread.h"
8 #include "build/build_config.h" 9 #include "build/build_config.h"
9 #include "content/common/child_process.h" 10 #include "content/common/child_process.h"
10 #include "content/common/content_switches.h" 11 #include "content/common/content_switches.h"
11 #include "content/common/main_function_params.h" 12 #include "content/common/main_function_params.h"
12 #include "content/ppapi_plugin/ppapi_thread.h" 13 #include "content/ppapi_plugin/ppapi_thread.h"
13 #include "ppapi/proxy/proxy_module.h" 14 #include "ppapi/proxy/proxy_module.h"
14 15
16 #if defined(OS_WIN)
17 #include "sandbox/src/sandbox.h"
18 #endif
19
20 #if defined(OS_WIN)
21 sandbox::TargetServices* g_target_services = NULL;
22 #else
23 void* g_target_services = 0;
24 #endif
25
15 // Main function for starting the PPAPI plugin process. 26 // Main function for starting the PPAPI plugin process.
16 int PpapiPluginMain(const MainFunctionParams& parameters) { 27 int PpapiPluginMain(const MainFunctionParams& parameters) {
17 const CommandLine& command_line = parameters.command_line_; 28 const CommandLine& command_line = parameters.command_line_;
29
30 #if defined(OS_WIN)
31 g_target_services = parameters.sandbox_info_.TargetServices();
32 #endif
33
34 // 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()
36 // does.
18 if (command_line.HasSwitch(switches::kPpapiStartupDialog)) { 37 if (command_line.HasSwitch(switches::kPpapiStartupDialog)) {
19 ChildProcess::WaitForDebugger("Ppapi"); 38 if (g_target_services)
39 base::debug::WaitForDebugger(2*60, false);
40 else
41 ChildProcess::WaitForDebugger("Ppapi");
20 } 42 }
21 43
22 MessageLoop main_message_loop(MessageLoop::TYPE_UI); 44 MessageLoop main_message_loop(MessageLoop::TYPE_UI);
23 base::PlatformThread::SetName("CrPPAPIMain"); 45 base::PlatformThread::SetName("CrPPAPIMain");
24 46
25 ChildProcess ppapi_process; 47 ChildProcess ppapi_process;
26 ppapi_process.set_main_thread(new PpapiThread(false)); // Not a broker. 48 ppapi_process.set_main_thread(new PpapiThread(false)); // Not a broker.
27 49
28 pp::proxy::ProxyModule::GetInstance()->SetFlashCommandLineArgs( 50 pp::proxy::ProxyModule::GetInstance()->SetFlashCommandLineArgs(
29 command_line.GetSwitchValueASCII(switches::kPpapiFlashArgs)); 51 command_line.GetSwitchValueASCII(switches::kPpapiFlashArgs));
30 52
31 main_message_loop.Run(); 53 main_message_loop.Run();
32 return 0; 54 return 0;
33 } 55 }
OLDNEW
« no previous file with comments | « content/browser/ppapi_plugin_process_host.cc ('k') | content/ppapi_plugin/ppapi_thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698