OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/utility_process_host_impl.h" | 5 #include "content/browser/utility_process_host_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/base_switches.h" | 9 #include "base/base_switches.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 base::FilePath exposed_files = exposed_dir_.AppendASCII("*"); | 93 base::FilePath exposed_files = exposed_dir_.AppendASCII("*"); |
94 result = policy->AddRule(sandbox::TargetPolicy::SUBSYS_FILES, | 94 result = policy->AddRule(sandbox::TargetPolicy::SUBSYS_FILES, |
95 sandbox::TargetPolicy::FILES_ALLOW_ANY, | 95 sandbox::TargetPolicy::FILES_ALLOW_ANY, |
96 exposed_files.value().c_str()); | 96 exposed_files.value().c_str()); |
97 return result == sandbox::SBOX_ALL_OK; | 97 return result == sandbox::SBOX_ALL_OK; |
98 } | 98 } |
99 | 99 |
100 #elif defined(OS_POSIX) | 100 #elif defined(OS_POSIX) |
101 | 101 |
102 #if !defined(OS_MACOSX) && !defined(OS_ANDROID) | 102 #if !defined(OS_MACOSX) && !defined(OS_ANDROID) |
103 ZygoteHandle* GetZygote() override { | 103 ZygoteHandle GetZygote() override { |
104 if (no_sandbox_ || !exposed_dir_.empty()) | 104 if (no_sandbox_ || !exposed_dir_.empty()) |
105 return nullptr; | 105 return nullptr; |
106 return GetGenericZygote(); | 106 return GetGenericZygote(); |
107 } | 107 } |
108 #endif // !defined(OS_MACOSX) && !defined(OS_ANDROID) | 108 #endif // !defined(OS_MACOSX) && !defined(OS_ANDROID) |
109 base::EnvironmentMap GetEnvironment() override { return env_; } | 109 base::EnvironmentMap GetEnvironment() override { return env_; } |
110 #endif // OS_WIN | 110 #endif // OS_WIN |
111 | 111 |
112 SandboxType GetSandboxType() override { | 112 SandboxType GetSandboxType() override { |
113 return SANDBOX_TYPE_UTILITY; | 113 return SANDBOX_TYPE_UTILITY; |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 base::WeakPtr<UtilityProcessHostImpl> host, | 389 base::WeakPtr<UtilityProcessHostImpl> host, |
390 int error_code) { | 390 int error_code) { |
391 if (!host) | 391 if (!host) |
392 return; | 392 return; |
393 | 393 |
394 host->OnProcessLaunchFailed(error_code); | 394 host->OnProcessLaunchFailed(error_code); |
395 delete host.get(); | 395 delete host.get(); |
396 } | 396 } |
397 | 397 |
398 } // namespace content | 398 } // namespace content |
OLD | NEW |