Chromium Code Reviews| 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/browser_main_loop.h" | 5 #include "content/browser/browser_main_loop.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 169 #elif defined(OS_LINUX) && defined(USE_UDEV) | 169 #elif defined(OS_LINUX) && defined(USE_UDEV) |
| 170 #include "media/device_monitors/device_monitor_udev.h" | 170 #include "media/device_monitors/device_monitor_udev.h" |
| 171 #elif defined(OS_MACOSX) | 171 #elif defined(OS_MACOSX) |
| 172 #include "media/device_monitors/device_monitor_mac.h" | 172 #include "media/device_monitors/device_monitor_mac.h" |
| 173 #endif | 173 #endif |
| 174 | 174 |
| 175 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 175 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
| 176 #include "content/browser/renderer_host/render_sandbox_host_linux.h" | 176 #include "content/browser/renderer_host/render_sandbox_host_linux.h" |
| 177 #include "content/browser/zygote_host/zygote_host_impl_linux.h" | 177 #include "content/browser/zygote_host/zygote_host_impl_linux.h" |
| 178 | 178 |
| 179 #if !defined(OS_ANDROID) | 179 #if !defined(OS_ANDROID) |
|
Lei Zhang
2017/04/27 23:02:52
I was wondering about how Linux-y the Zygote code
| |
| 180 #include "content/browser/zygote_host/zygote_communication_linux.h" | |
| 180 #include "content/public/browser/zygote_handle_linux.h" | 181 #include "content/public/browser/zygote_handle_linux.h" |
| 181 #endif // !defined(OS_ANDROID) | 182 #endif // !defined(OS_ANDROID) |
| 182 #endif // defined(OS_POSIX) && !defined(OS_MACOSX) | 183 #endif // defined(OS_POSIX) && !defined(OS_MACOSX) |
| 183 | 184 |
| 184 | 185 |
| 185 #if BUILDFLAG(ENABLE_PLUGINS) | 186 #if BUILDFLAG(ENABLE_PLUGINS) |
| 186 #include "content/browser/plugin_service_impl.h" | 187 #include "content/browser/plugin_service_impl.h" |
| 187 #endif | 188 #endif |
| 188 | 189 |
| 189 #if defined(ENABLE_MOJO_CDM) && BUILDFLAG(ENABLE_PEPPER_CDMS) | 190 #if defined(ENABLE_MOJO_CDM) && BUILDFLAG(ENABLE_PEPPER_CDMS) |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 222 | 223 |
| 223 if (parsed_command_line.HasSwitch(switches::kNoZygote)) { | 224 if (parsed_command_line.HasSwitch(switches::kNoZygote)) { |
| 224 CHECK(parsed_command_line.HasSwitch(switches::kNoSandbox)) | 225 CHECK(parsed_command_line.HasSwitch(switches::kNoSandbox)) |
| 225 << "--no-sandbox should be used together with --no--zygote"; | 226 << "--no-sandbox should be used together with --no--zygote"; |
| 226 return; | 227 return; |
| 227 } | 228 } |
| 228 | 229 |
| 229 // Tickle the zygote host so it forks now. | 230 // Tickle the zygote host so it forks now. |
| 230 ZygoteHostImpl::GetInstance()->Init(parsed_command_line); | 231 ZygoteHostImpl::GetInstance()->Init(parsed_command_line); |
| 231 *GetGenericZygote() = CreateZygote(); | 232 *GetGenericZygote() = CreateZygote(); |
| 232 RenderProcessHostImpl::EarlyZygoteLaunch(); | 233 // TODO(kerrnel): Investigate doing this without the ZygoteHostImpl as a |
| 234 // proxy. It is currently done this way due to concerns about race | |
| 235 // conditions. | |
| 236 ZygoteHostImpl::GetInstance()->SetRendererSandboxStatus( | |
| 237 (*GetGenericZygote())->GetSandboxStatus()); | |
| 233 } | 238 } |
| 234 #endif | 239 #endif |
| 235 | 240 |
| 236 #if defined(USE_GLIB) | 241 #if defined(USE_GLIB) |
| 237 static void GLibLogHandler(const gchar* log_domain, | 242 static void GLibLogHandler(const gchar* log_domain, |
| 238 GLogLevelFlags log_level, | 243 GLogLevelFlags log_level, |
| 239 const gchar* message, | 244 const gchar* message, |
| 240 gpointer userdata) { | 245 gpointer userdata) { |
| 241 if (!log_domain) | 246 if (!log_domain) |
| 242 log_domain = "<unknown>"; | 247 log_domain = "<unknown>"; |
| (...skipping 1513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1756 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE), | 1761 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE), |
| 1757 MediaInternals::GetInstance()); | 1762 MediaInternals::GetInstance()); |
| 1758 } | 1763 } |
| 1759 CHECK(audio_manager_); | 1764 CHECK(audio_manager_); |
| 1760 | 1765 |
| 1761 audio_system_ = media::AudioSystemImpl::Create(audio_manager_.get()); | 1766 audio_system_ = media::AudioSystemImpl::Create(audio_manager_.get()); |
| 1762 CHECK(audio_system_); | 1767 CHECK(audio_system_); |
| 1763 } | 1768 } |
| 1764 | 1769 |
| 1765 } // namespace content | 1770 } // namespace content |
| OLD | NEW |