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

Side by Side Diff: chrome/common/sandbox_init_wrapper.cc

Issue 341033: Sandbox Worker process on the Mac. (Closed)
Patch Set: Fix latest round of comments Created 11 years, 1 month 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
« no previous file with comments | « chrome/common/sandbox_init_wrapper.h ('k') | chrome/common/sandbox_init_wrapper_linux.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/common/sandbox_init_wrapper.h"
6
7 #include "base/command_line.h"
8 #include "chrome/common/chrome_switches.h"
9
10 #if defined(OS_WIN)
11
12 void SandboxInitWrapper::SetServices(sandbox::SandboxInterfaceInfo* info) {
13 if (info) {
14 broker_services_ = info->broker_services;
15 target_services_ = info->target_services;
16 }
17 }
18
19 #endif
20
21 void SandboxInitWrapper::InitializeSandbox(const CommandLine& command_line,
22 const std::string& process_type) {
23 #if defined(OS_WIN)
24 if (!target_services_)
25 return;
26 #endif
27 if (!command_line.HasSwitch(switches::kNoSandbox)) {
28 if ((process_type == switches::kRendererProcess) ||
29 (process_type == switches::kWorkerProcess) ||
30 (process_type == switches::kNaClProcess) ||
31 (process_type == switches::kUtilityProcess) ||
32 (process_type == switches::kPluginProcess &&
33 command_line.HasSwitch(switches::kSafePlugins))) {
34 #if defined(OS_WIN)
35 target_services_->Init();
36 #elif defined(OS_MACOSX)
37 // We just cache the process type so we can configure the sandbox
38 // correctly, see renderer_main_platform_delegate_mac.cc for one of those
39 // places.
40 process_type_ = process_type;
41 #endif
42 }
43 }
44 }
OLDNEW
« no previous file with comments | « chrome/common/sandbox_init_wrapper.h ('k') | chrome/common/sandbox_init_wrapper_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698