summaryrefslogtreecommitdiffstats
path: root/chrome/common/sandbox_init_wrapper_win.cc
diff options
context:
space:
mode:
authorjeremy@chromium.org <jeremy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-05 12:50:34 +0000
committerjeremy@chromium.org <jeremy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-05 12:50:34 +0000
commit824083c52c5689198290e24938793ce4ccc6e683 (patch)
treea9a8145fff77340dc6c88ee787fa9653c421e35a /chrome/common/sandbox_init_wrapper_win.cc
parent498fd8ed8d91dd428dab8b7d40029a62aa42734e (diff)
downloadchromium_src-824083c52c5689198290e24938793ce4ccc6e683.zip
chromium_src-824083c52c5689198290e24938793ce4ccc6e683.tar.gz
chromium_src-824083c52c5689198290e24938793ce4ccc6e683.tar.bz2
Sandbox Worker process on the Mac.
* Add plumbing to allow multiple Sandbox profiles on OS X. * Separate sandbox_init_wrapper into platform specific files. * Sandbox Worker process & add plumbing to Sandbox utility process when we bring that up. * Remove mention of stale bugs in utility process on Mac. BUG=23582 TEST=Worker process should work. Review URL: http://codereview.chromium.org/341033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31089 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/sandbox_init_wrapper_win.cc')
-rw-r--r--chrome/common/sandbox_init_wrapper_win.cc32
1 files changed, 32 insertions, 0 deletions
diff --git a/chrome/common/sandbox_init_wrapper_win.cc b/chrome/common/sandbox_init_wrapper_win.cc
new file mode 100644
index 0000000..fe5c6df
--- /dev/null
+++ b/chrome/common/sandbox_init_wrapper_win.cc
@@ -0,0 +1,32 @@
+// Copyright (c) 2009 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 "chrome/common/chrome_switches.h"
+
+void SandboxInitWrapper::SetServices(sandbox::SandboxInterfaceInfo* info) {
+ if (info) {
+ broker_services_ = info->broker_services;
+ target_services_ = info->target_services;
+ }
+}
+
+bool SandboxInitWrapper::InitializeSandbox(const CommandLine& command_line,
+ const std::string& process_type) {
+ if (command_line.HasSwitch(switches::kNoSandbox))
+ return true;
+ if ((process_type == switches::kRendererProcess) ||
+ (process_type == switches::kWorkerProcess) ||
+ (process_type == switches::kNaClProcess) ||
+ (process_type == switches::kUtilityProcess) ||
+ (process_type == switches::kPluginProcess &&
+ command_line.HasSwitch(switches::kSafePlugins))) {
+ if (!target_services_)
+ return false;
+ target_services_->Init();
+ }
+ return true;
+}