| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/app/chrome_main.h" | 5 #include "chrome/app/chrome_main.h" |
| 6 | 6 |
| 7 #include "base/at_exit.h" | 7 #include "base/at_exit.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/debug/debugger.h" | 9 #include "base/debug/debugger.h" |
| 10 #include "base/i18n/icu_util.h" | 10 #include "base/i18n/icu_util.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 #include "third_party/WebKit/Source/WebKit/mac/WebCoreSupport/WebSystemInterface
.h" | 70 #include "third_party/WebKit/Source/WebKit/mac/WebCoreSupport/WebSystemInterface
.h" |
| 71 #include "ui/base/l10n/l10n_util_mac.h" | 71 #include "ui/base/l10n/l10n_util_mac.h" |
| 72 #endif | 72 #endif |
| 73 | 73 |
| 74 #if defined(OS_POSIX) | 74 #if defined(OS_POSIX) |
| 75 #include <locale.h> | 75 #include <locale.h> |
| 76 #include <signal.h> | 76 #include <signal.h> |
| 77 #endif | 77 #endif |
| 78 | 78 |
| 79 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 79 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
| 80 #include "chrome/common/nacl_fork_delegate_linux.h" |
| 80 #include "content/common/zygote_fork_delegate_linux.h" | 81 #include "content/common/zygote_fork_delegate_linux.h" |
| 81 #endif | 82 #endif |
| 82 | 83 |
| 83 #if defined(OS_CHROMEOS) | 84 #if defined(OS_CHROMEOS) |
| 84 #include "base/sys_info.h" | 85 #include "base/sys_info.h" |
| 85 #include "chrome/browser/chromeos/boot_times_loader.h" | 86 #include "chrome/browser/chromeos/boot_times_loader.h" |
| 86 #endif | 87 #endif |
| 87 | 88 |
| 88 #if defined(USE_X11) | 89 #if defined(USE_X11) |
| 89 #include <gdk/gdk.h> | 90 #include <gdk/gdk.h> |
| (...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 452 }; | 453 }; |
| 453 | 454 |
| 454 // Each Renderer we spawn will re-attempt initialization of the media | 455 // Each Renderer we spawn will re-attempt initialization of the media |
| 455 // libraries, at which point failure will be detected and handled, so | 456 // libraries, at which point failure will be detected and handled, so |
| 456 // we do not need to cope with initialization failures here. | 457 // we do not need to cope with initialization failures here. |
| 457 FilePath media_path; | 458 FilePath media_path; |
| 458 if (PathService::Get(chrome::DIR_MEDIA_LIBS, &media_path)) | 459 if (PathService::Get(chrome::DIR_MEDIA_LIBS, &media_path)) |
| 459 media::InitializeMediaLibrary(media_path); | 460 media::InitializeMediaLibrary(media_path); |
| 460 | 461 |
| 461 // This function call can return multiple times, once per fork(). | 462 // This function call can return multiple times, once per fork(). |
| 462 if (!ZygoteMain(main_function_params, NULL)) | 463 NaClForkDelegate* nacl_delegate = new NaClForkDelegate(); |
| 464 int rval = ZygoteMain(main_function_params, nacl_delegate); |
| 465 if (nacl_delegate) |
| 466 delete nacl_delegate; |
| 467 if (!rval) |
| 463 return 1; | 468 return 1; |
| 464 | 469 |
| 465 // Zygote::HandleForkRequest may have reallocated the command | 470 // Zygote::HandleForkRequest may have reallocated the command |
| 466 // line so update it here with the new version. | 471 // line so update it here with the new version. |
| 467 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 472 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 468 | 473 |
| 469 // The StatsTable must be initialized in each process; we already | 474 // The StatsTable must be initialized in each process; we already |
| 470 // initialized for the browser process, now we need to initialize | 475 // initialized for the browser process, now we need to initialize |
| 471 // within the new processes as well. | 476 // within the new processes as well. |
| 472 pid_t browser_pid = base::GetParentProcessId( | 477 pid_t browser_pid = base::GetParentProcessId( |
| (...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 872 | 877 |
| 873 if (SubprocessNeedsResourceBundle(process_type)) | 878 if (SubprocessNeedsResourceBundle(process_type)) |
| 874 ResourceBundle::CleanupSharedInstance(); | 879 ResourceBundle::CleanupSharedInstance(); |
| 875 | 880 |
| 876 logging::CleanupChromeLogging(); | 881 logging::CleanupChromeLogging(); |
| 877 | 882 |
| 878 chrome_main::LowLevelShutdown(); | 883 chrome_main::LowLevelShutdown(); |
| 879 | 884 |
| 880 return exit_code; | 885 return exit_code; |
| 881 } | 886 } |
| OLD | NEW |