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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 exposed_files.value().c_str()); | 97 exposed_files.value().c_str()); |
98 return result == sandbox::SBOX_ALL_OK; | 98 return result == sandbox::SBOX_ALL_OK; |
99 } | 99 } |
100 | 100 |
101 #elif defined(OS_POSIX) | 101 #elif defined(OS_POSIX) |
102 | 102 |
103 #if !defined(OS_MACOSX) && !defined(OS_ANDROID) | 103 #if !defined(OS_MACOSX) && !defined(OS_ANDROID) |
104 ZygoteHandle* GetZygote() override { | 104 ZygoteHandle* GetZygote() override { |
105 if (no_sandbox_ || !exposed_dir_.empty()) | 105 if (no_sandbox_ || !exposed_dir_.empty()) |
106 return nullptr; | 106 return nullptr; |
107 return &g_utility_zygote; | 107 static ZygoteHandle zygote = GetGenericZygote(); |
| 108 return &zygote; |
108 } | 109 } |
109 #endif // !defined(OS_MACOSX) && !defined(OS_ANDROID) | 110 #endif // !defined(OS_MACOSX) && !defined(OS_ANDROID) |
110 base::EnvironmentMap GetEnvironment() override { return env_; } | 111 base::EnvironmentMap GetEnvironment() override { return env_; } |
111 base::ScopedFD TakeIpcFd() override { return std::move(ipc_fd_); } | 112 base::ScopedFD TakeIpcFd() override { return std::move(ipc_fd_); } |
112 #endif // OS_WIN | 113 #endif // OS_WIN |
113 | 114 |
114 SandboxType GetSandboxType() override { | 115 SandboxType GetSandboxType() override { |
115 return SANDBOX_TYPE_UTILITY; | 116 return SANDBOX_TYPE_UTILITY; |
116 } | 117 } |
117 | 118 |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 if (RenderProcessHost::run_renderer_in_process()) | 398 if (RenderProcessHost::run_renderer_in_process()) |
398 handle = base::GetCurrentProcessHandle(); | 399 handle = base::GetCurrentProcessHandle(); |
399 else | 400 else |
400 handle = process_->GetData().handle; | 401 handle = process_->GetData().handle; |
401 | 402 |
402 mojo_application_host_->Activate(this, handle); | 403 mojo_application_host_->Activate(this, handle); |
403 } | 404 } |
404 } | 405 } |
405 | 406 |
406 } // namespace content | 407 } // namespace content |
OLD | NEW |