diff options
Diffstat (limited to 'chrome/app')
-rw-r--r-- | chrome/app/breakpad_linux.cc | 4 | ||||
-rw-r--r-- | chrome/app/chrome_dll_main.cc | 15 |
2 files changed, 17 insertions, 2 deletions
diff --git a/chrome/app/breakpad_linux.cc b/chrome/app/breakpad_linux.cc index 0712241..0ee0bed 100644 --- a/chrome/app/breakpad_linux.cc +++ b/chrome/app/breakpad_linux.cc @@ -14,6 +14,7 @@ #include "base/file_version_info_linux.h" #include "base/path_service.h" #include "base/rand_util.h" +#include "base/reserved_file_descriptors.h" #include "breakpad/linux/directory_reader.h" #include "breakpad/linux/exception_handler.h" #include "breakpad/linux/linux_libc_support.h" @@ -501,8 +502,7 @@ RendererCrashHandler(const void* crash_context, size_t crash_context_size, void EnableRendererCrashDumping() { // When the browser forks off our process, it installs the crash signal file - // descriptor in this slot: - static const int kMagicCrashSignalFd = 4; + // descriptor in slot kMagicCrashSignalFd. // We deliberately leak this object. google_breakpad::ExceptionHandler* handler = diff --git a/chrome/app/chrome_dll_main.cc b/chrome/app/chrome_dll_main.cc index 006d923..b6ba22f 100644 --- a/chrome/app/chrome_dll_main.cc +++ b/chrome/app/chrome_dll_main.cc @@ -45,6 +45,9 @@ #if defined(OS_WIN) #include "base/win_util.h" #endif +#if defined(OS_LINUX) +#include "base/zygote_manager.h" +#endif #if defined(OS_MACOSX) #include "chrome/app/breakpad_mac.h" #elif defined(OS_LINUX) @@ -292,6 +295,18 @@ int ChromeMain(int argc, const char** argv) { // Initialize the command line. #if defined(OS_WIN) CommandLine::Init(0, NULL); +#elif defined(OS_LINUX) + base::ZygoteManager* zm = base::ZygoteManager::Get(); + std::vector<std::string>* zargv = NULL; + if (zm) + zargv = zm->Start(); + if (zargv) { + // Forked child. + CommandLine::Init(*zargv); + } else { + // Original process. + CommandLine::Init(argc, argv); + } #else CommandLine::Init(argc, argv); #endif |