Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <dlfcn.h> | 5 #include <dlfcn.h> |
| 6 #include <fcntl.h> | 6 #include <fcntl.h> |
| 7 #include <pthread.h> | 7 #include <pthread.h> |
| 8 #include <sys/epoll.h> | 8 #include <sys/epoll.h> |
| 9 #include <sys/prctl.h> | 9 #include <sys/prctl.h> |
| 10 #include <sys/signal.h> | 10 #include <sys/signal.h> |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 28 #include "base/linux_util.h" | 28 #include "base/linux_util.h" |
| 29 #include "base/path_service.h" | 29 #include "base/path_service.h" |
| 30 #include "base/pickle.h" | 30 #include "base/pickle.h" |
| 31 #include "base/process_util.h" | 31 #include "base/process_util.h" |
| 32 #include "base/rand_util.h" | 32 #include "base/rand_util.h" |
| 33 #include "base/scoped_ptr.h" | 33 #include "base/scoped_ptr.h" |
| 34 #include "base/sys_info.h" | 34 #include "base/sys_info.h" |
| 35 #include "build/build_config.h" | 35 #include "build/build_config.h" |
| 36 #include "chrome/browser/zygote_host_linux.h" | 36 #include "chrome/browser/zygote_host_linux.h" |
| 37 #include "chrome/common/chrome_descriptors.h" | 37 #include "chrome/common/chrome_descriptors.h" |
| 38 #include "chrome/common/chrome_paths.h" | |
| 38 #include "chrome/common/chrome_switches.h" | 39 #include "chrome/common/chrome_switches.h" |
| 39 #include "chrome/common/font_config_ipc_linux.h" | 40 #include "chrome/common/font_config_ipc_linux.h" |
| 40 #include "chrome/common/main_function_params.h" | 41 #include "chrome/common/main_function_params.h" |
| 41 #include "chrome/common/pepper_plugin_registry.h" | 42 #include "chrome/common/pepper_plugin_registry.h" |
| 42 #include "chrome/common/process_watcher.h" | 43 #include "chrome/common/process_watcher.h" |
| 43 #include "chrome/common/result_codes.h" | 44 #include "chrome/common/result_codes.h" |
| 44 #include "chrome/common/sandbox_methods_linux.h" | 45 #include "chrome/common/sandbox_methods_linux.h" |
| 45 #include "chrome/common/set_process_title.h" | 46 #include "chrome/common/set_process_title.h" |
| 46 #include "chrome/common/unix_domain_socket_posix.h" | 47 #include "chrome/common/unix_domain_socket_posix.h" |
| 47 #include "media/base/media.h" | 48 #include "media/base/media.h" |
| (...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 588 base::RandUint64(); | 589 base::RandUint64(); |
| 589 | 590 |
| 590 base::SysInfo::MaxSharedMemorySize(); | 591 base::SysInfo::MaxSharedMemorySize(); |
| 591 | 592 |
| 592 // ICU DateFormat class (used in base/time_format.cc) needs to get the | 593 // ICU DateFormat class (used in base/time_format.cc) needs to get the |
| 593 // Olson timezone ID by accessing the zoneinfo files on disk. After | 594 // Olson timezone ID by accessing the zoneinfo files on disk. After |
| 594 // TimeZone::createDefault is called once here, the timezone ID is | 595 // TimeZone::createDefault is called once here, the timezone ID is |
| 595 // cached and there's no more need to access the file system. | 596 // cached and there's no more need to access the file system. |
| 596 scoped_ptr<icu::TimeZone> zone(icu::TimeZone::createDefault()); | 597 scoped_ptr<icu::TimeZone> zone(icu::TimeZone::createDefault()); |
| 597 | 598 |
| 598 FilePath module_path; | 599 // TODO(wez): It doesn't seem right that we CHECK() if we can't load the |
| 599 if (PathService::Get(base::DIR_MODULE, &module_path)) | 600 // media libraries, but the alternative is to crash when something tries |
| 600 media::InitializeMediaLibrary(module_path); | 601 // to use them. Should we store a flag so code can check this? |
|
scherkus (not reviewing)
2011/02/17 17:57:10
we definitely shouldn't crash!
the renderer proce
| |
| 602 FilePath media_path; | |
| 603 CHECK(PathService::Get(chrome::DIR_MEDIA_LIBS, &media_path)); | |
| 604 CHECK(media::InitializeMediaLibrary(media_path)); | |
| 601 | 605 |
| 602 // Ensure access to the Pepper plugins before the sandbox is turned on. | 606 // Ensure access to the Pepper plugins before the sandbox is turned on. |
| 603 PepperPluginRegistry::PreloadModules(); | 607 PepperPluginRegistry::PreloadModules(); |
| 604 } | 608 } |
| 605 | 609 |
| 606 #if !defined(CHROMIUM_SELINUX) | 610 #if !defined(CHROMIUM_SELINUX) |
| 607 static bool EnterSandbox() { | 611 static bool EnterSandbox() { |
| 608 // The SUID sandbox sets this environment variable to a file descriptor | 612 // The SUID sandbox sets this environment variable to a file descriptor |
| 609 // over which we can signal that we have completed our startup and can be | 613 // over which we can signal that we have completed our startup and can be |
| 610 // chrooted. | 614 // chrooted. |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 743 VLOG(1) << "Enabling experimental Seccomp sandbox."; | 747 VLOG(1) << "Enabling experimental Seccomp sandbox."; |
| 744 sandbox_flags |= ZygoteHost::kSandboxSeccomp; | 748 sandbox_flags |= ZygoteHost::kSandboxSeccomp; |
| 745 } | 749 } |
| 746 } | 750 } |
| 747 #endif // SECCOMP_SANDBOX | 751 #endif // SECCOMP_SANDBOX |
| 748 | 752 |
| 749 Zygote zygote(sandbox_flags); | 753 Zygote zygote(sandbox_flags); |
| 750 // This function call can return multiple times, once per fork(). | 754 // This function call can return multiple times, once per fork(). |
| 751 return zygote.ProcessRequests(); | 755 return zygote.ProcessRequests(); |
| 752 } | 756 } |
| OLD | NEW |