| 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 "app/app_paths.h" | 7 #include "app/app_paths.h" |
| 8 #include "app/app_switches.h" | 8 #include "app/app_switches.h" |
| 9 #include "base/at_exit.h" | 9 #include "base/at_exit.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 510 if (command_line.HasSwitch(switches::kDiagnostics)) { | 510 if (command_line.HasSwitch(switches::kDiagnostics)) { |
| 511 return DiagnosticsMain(command_line); | 511 return DiagnosticsMain(command_line); |
| 512 } | 512 } |
| 513 | 513 |
| 514 #if defined(OS_WIN) | 514 #if defined(OS_WIN) |
| 515 // Must do this before any other usage of command line! | 515 // Must do this before any other usage of command line! |
| 516 if (HasDeprecatedArguments(command_line.command_line_string())) | 516 if (HasDeprecatedArguments(command_line.command_line_string())) |
| 517 return 1; | 517 return 1; |
| 518 #endif | 518 #endif |
| 519 | 519 |
| 520 if (command_line.HasSwitch(switches::kEnableNaCl)) { |
| 521 // NaCl currently requires two flags to run |
| 522 CommandLine* singleton_command_line = CommandLine::ForCurrentProcess(); |
| 523 singleton_command_line->AppendSwitch(switches::kEnableGPUPlugin); |
| 524 } |
| 525 |
| 520 base::ProcessId browser_pid = base::GetCurrentProcId(); | 526 base::ProcessId browser_pid = base::GetCurrentProcId(); |
| 521 if (SubprocessIsBrowserChild(process_type)) { | 527 if (SubprocessIsBrowserChild(process_type)) { |
| 522 #if defined(OS_WIN) || defined(OS_MACOSX) | 528 #if defined(OS_WIN) || defined(OS_MACOSX) |
| 523 std::string channel_name = | 529 std::string channel_name = |
| 524 command_line.GetSwitchValueASCII(switches::kProcessChannelID); | 530 command_line.GetSwitchValueASCII(switches::kProcessChannelID); |
| 525 | 531 |
| 526 int browser_pid_int; | 532 int browser_pid_int; |
| 527 base::StringToInt(channel_name, &browser_pid_int); | 533 base::StringToInt(channel_name, &browser_pid_int); |
| 528 browser_pid = static_cast<base::ProcessId>(browser_pid_int); | 534 browser_pid = static_cast<base::ProcessId>(browser_pid_int); |
| 529 DCHECK_NE(browser_pid_int, 0); | 535 DCHECK_NE(browser_pid_int, 0); |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 750 | 756 |
| 751 if (SubprocessNeedsResourceBundle(process_type)) | 757 if (SubprocessNeedsResourceBundle(process_type)) |
| 752 ResourceBundle::CleanupSharedInstance(); | 758 ResourceBundle::CleanupSharedInstance(); |
| 753 | 759 |
| 754 logging::CleanupChromeLogging(); | 760 logging::CleanupChromeLogging(); |
| 755 | 761 |
| 756 chrome_main::LowLevelShutdown(); | 762 chrome_main::LowLevelShutdown(); |
| 757 | 763 |
| 758 return exit_code; | 764 return exit_code; |
| 759 } | 765 } |
| OLD | NEW |