Chromium Code Reviews| Index: chrome/common/sandbox_init_wrapper_win.cc |
| =================================================================== |
| --- chrome/common/sandbox_init_wrapper_win.cc (revision 74231) |
| +++ chrome/common/sandbox_init_wrapper_win.cc (working copy) |
| @@ -1,10 +1,12 @@ |
| -// Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| +// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| #include "chrome/common/sandbox_init_wrapper.h" |
| #include "base/command_line.h" |
| +#include "base/logging.h" |
| + |
| #include "chrome/common/chrome_switches.h" |
| void SandboxInitWrapper::SetServices(sandbox::SandboxInterfaceInfo* info) { |
| @@ -12,6 +14,9 @@ |
| broker_services_ = info->broker_services; |
| target_services_ = info->target_services; |
| } |
| + // Both interface pointers cannot be non-zero. A process can either |
| + // be a target or a broker both not both. |
| + DCHECK(!(target_services_ && broker_services_)); |
| } |
| bool SandboxInitWrapper::InitializeSandbox(const CommandLine& command_line, |
| @@ -23,11 +28,9 @@ |
| (process_type == switches::kWorkerProcess) || |
| (process_type == switches::kNaClLoaderProcess) || |
| (process_type == switches::kUtilityProcess) || |
| - (process_type == switches::kPluginProcess && |
| - command_line.HasSwitch(switches::kSafePlugins))) { |
| - if (!target_services_) |
| - return false; |
| - target_services_->Init(); |
| + (process_type == switches::kPluginProcess)) { |
| + if (target_services_) |
| + return (sandbox::SBOX_ALL_OK == target_services_->Init()); |
|
rvargas (doing something else)
2011/02/10 00:23:43
Are you counting on other parts of the code to pro
cpu_(ooo_6.6-7.5)
2011/02/10 18:50:51
InitializeSandbox() is called regardless of what p
|
| } |
| return true; |
| } |