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/zygote/zygote_main.h" | 5 #include "content/zygote/zygote_main.h" |
6 | 6 |
7 #include <dlfcn.h> | 7 #include <dlfcn.h> |
8 #include <fcntl.h> | 8 #include <fcntl.h> |
9 #include <pthread.h> | 9 #include <pthread.h> |
10 #include <stdio.h> | 10 #include <stdio.h> |
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 static bool EnterSandbox(sandbox::SetuidSandboxClient* setuid_sandbox, | 434 static bool EnterSandbox(sandbox::SetuidSandboxClient* setuid_sandbox, |
435 bool* using_suid_sandbox, bool* has_started_new_init) { | 435 bool* using_suid_sandbox, bool* has_started_new_init) { |
436 *using_suid_sandbox = false; | 436 *using_suid_sandbox = false; |
437 *has_started_new_init = false; | 437 *has_started_new_init = false; |
438 | 438 |
439 if (!setuid_sandbox) | 439 if (!setuid_sandbox) |
440 return false; | 440 return false; |
441 | 441 |
442 PreSandboxInit(); | 442 PreSandboxInit(); |
443 SkFontConfigInterface::SetGlobal( | 443 SkFontConfigInterface::SetGlobal( |
444 new FontConfigIPC(Zygote::kMagicSandboxIPCDescriptor)))->unref(); | 444 new FontConfigIPC(Zygote::kMagicSandboxIPCDescriptor))->unref(); |
445 return true; | 445 return true; |
446 } | 446 } |
447 | 447 |
448 #endif // CHROMIUM_SELINUX | 448 #endif // CHROMIUM_SELINUX |
449 | 449 |
450 bool ZygoteMain(const MainFunctionParams& params, | 450 bool ZygoteMain(const MainFunctionParams& params, |
451 ZygoteForkDelegate* forkdelegate) { | 451 ZygoteForkDelegate* forkdelegate) { |
452 #if !defined(CHROMIUM_SELINUX) | 452 #if !defined(CHROMIUM_SELINUX) |
453 g_am_zygote_or_renderer = true; | 453 g_am_zygote_or_renderer = true; |
454 sandbox::InitLibcUrandomOverrides(); | 454 sandbox::InitLibcUrandomOverrides(); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
490 } | 490 } |
491 | 491 |
492 int sandbox_flags = linux_sandbox->GetStatus(); | 492 int sandbox_flags = linux_sandbox->GetStatus(); |
493 | 493 |
494 Zygote zygote(sandbox_flags, forkdelegate); | 494 Zygote zygote(sandbox_flags, forkdelegate); |
495 // This function call can return multiple times, once per fork(). | 495 // This function call can return multiple times, once per fork(). |
496 return zygote.ProcessRequests(); | 496 return zygote.ProcessRequests(); |
497 } | 497 } |
498 | 498 |
499 } // namespace content | 499 } // namespace content |
OLD | NEW |