From 88b6288d7f18abb79775f1632911135b13aa2187 Mon Sep 17 00:00:00 2001 From: "abodenha@google.com" Date: Sat, 21 Jul 2012 23:26:09 +0000 Subject: Merge 145335 - Restored missing broker initialization. BUG=134574 TEST=none Review URL: https://chromiumcodereview.appspot.com/10690070 TBR=vitalybuka@chromium.org Review URL: https://chromiumcodereview.appspot.com/10790114 git-svn-id: svn://svn.chromium.org/chrome/branches/1180/src@147807 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/service/service_main.cc | 4 ---- content/common/sandbox_init_win.cc | 11 ++++++++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/chrome/service/service_main.cc b/chrome/service/service_main.cc index c17ded3..d73aabc 100644 --- a/chrome/service/service_main.cc +++ b/chrome/service/service_main.cc @@ -43,10 +43,6 @@ int ServiceProcessMain(const content::MainFunctionParams& parameters) { if (!state->Initialize()) return 0; -#if defined(OS_WIN) - content::InitializeSandbox(parameters.sandbox_info); -#endif // defined(OS_WIN) - ServiceProcess service_process; if (service_process.Initialize(&main_message_loop, parameters.command_line, diff --git a/content/common/sandbox_init_win.cc b/content/common/sandbox_init_win.cc index a5d8baa..e2fe0b2 100644 --- a/content/common/sandbox_init_win.cc +++ b/content/common/sandbox_init_win.cc @@ -18,15 +18,20 @@ bool InitializeSandbox( const CommandLine& command_line = *CommandLine::ForCurrentProcess(); std::string process_type = command_line.GetSwitchValueASCII(switches::kProcessType); + sandbox::BrokerServices* broker_services = sandbox_info->broker_services; + if (broker_services && (process_type.empty() || + process_type == switches::kNaClBrokerProcess || + process_type == switches::kServiceProcess)) { + if (!sandbox::InitBrokerServices(broker_services)) + return false; + } + if (process_type.empty() || process_type == switches::kNaClBrokerProcess) { // IMPORTANT: This piece of code needs to run as early as possible in the // process because it will initialize the sandbox broker, which requires the // process to swap its window station. During this time all the UI will be // broken. This has to run before threads and windows are created. - sandbox::BrokerServices* broker_services = sandbox_info->broker_services; if (broker_services) { - if (!sandbox::InitBrokerServices(broker_services)) - return false; if (!command_line.HasSwitch(switches::kNoSandbox)) { bool use_winsta = !command_line.HasSwitch( switches::kDisableAltWinstation); -- cgit v1.1