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

Side by Side Diff: content/browser/browser_main_loop.cc

Issue 2827783003: Initialize RenderSandboxHostLinux in --no-zygote mode to not crash. (Closed)
Patch Set: Disable the test under TSan. Created 3 years, 8 months 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 | « no previous file | content/zygote/zygote_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 #ifdef DestroyAll 210 #ifdef DestroyAll
211 #undef DestroyAll 211 #undef DestroyAll
212 #endif 212 #endif
213 213
214 namespace content { 214 namespace content {
215 namespace { 215 namespace {
216 216
217 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID) 217 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID)
218 void SetupSandbox(const base::CommandLine& parsed_command_line) { 218 void SetupSandbox(const base::CommandLine& parsed_command_line) {
219 TRACE_EVENT0("startup", "SetupSandbox"); 219 TRACE_EVENT0("startup", "SetupSandbox");
220 // RenderSandboxHostLinux needs to be initialized even if the sandbox and
221 // zygote are both disabled. It initializes the renderer socket.
222 RenderSandboxHostLinux::GetInstance()->Init();
223
220 if (parsed_command_line.HasSwitch(switches::kNoZygote)) { 224 if (parsed_command_line.HasSwitch(switches::kNoZygote)) {
221 CHECK(parsed_command_line.HasSwitch(switches::kNoSandbox)) 225 CHECK(parsed_command_line.HasSwitch(switches::kNoSandbox))
222 << "--no-sandbox should be used together with --no--zygote"; 226 << "--no-sandbox should be used together with --no--zygote";
223 return; 227 return;
224 } 228 }
225 229
226 // Tickle the sandbox host and zygote host so they fork now. 230 // Tickle the zygote host so it forks now.
227 RenderSandboxHostLinux::GetInstance()->Init();
228 ZygoteHostImpl::GetInstance()->Init(parsed_command_line); 231 ZygoteHostImpl::GetInstance()->Init(parsed_command_line);
229 *GetGenericZygote() = CreateZygote(); 232 *GetGenericZygote() = CreateZygote();
230 RenderProcessHostImpl::EarlyZygoteLaunch(); 233 RenderProcessHostImpl::EarlyZygoteLaunch();
231 } 234 }
232 #endif 235 #endif
233 236
234 #if defined(USE_GLIB) 237 #if defined(USE_GLIB)
235 static void GLibLogHandler(const gchar* log_domain, 238 static void GLibLogHandler(const gchar* log_domain,
236 GLogLevelFlags log_level, 239 GLogLevelFlags log_level,
237 const gchar* message, 240 const gchar* message,
(...skipping 1511 matching lines...) Expand 10 before | Expand all | Expand 10 after
1749 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE), 1752 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE),
1750 MediaInternals::GetInstance()); 1753 MediaInternals::GetInstance());
1751 } 1754 }
1752 CHECK(audio_manager_); 1755 CHECK(audio_manager_);
1753 1756
1754 audio_system_ = media::AudioSystemImpl::Create(audio_manager_.get()); 1757 audio_system_ = media::AudioSystemImpl::Create(audio_manager_.get());
1755 CHECK(audio_system_); 1758 CHECK(audio_system_);
1756 } 1759 }
1757 1760
1758 } // namespace content 1761 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/zygote/zygote_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698