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 "chrome/app/chrome_main_delegate.h" | 5 #include "chrome/app/chrome_main_delegate.h" |
6 | 6 |
7 #include "base/base_paths.h" | 7 #include "base/base_paths.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/cpu.h" | 9 #include "base/cpu.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 #include "components/component_updater/component_updater_paths.h" | 37 #include "components/component_updater/component_updater_paths.h" |
38 #include "components/startup_metric_utils/startup_metric_utils.h" | 38 #include "components/startup_metric_utils/startup_metric_utils.h" |
39 #include "content/public/common/content_client.h" | 39 #include "content/public/common/content_client.h" |
40 #include "content/public/common/content_paths.h" | 40 #include "content/public/common/content_paths.h" |
41 #include "ui/base/ui_base_switches.h" | 41 #include "ui/base/ui_base_switches.h" |
42 | 42 |
43 #if defined(OS_WIN) | 43 #if defined(OS_WIN) |
44 #include <atlbase.h> | 44 #include <atlbase.h> |
45 #include <malloc.h> | 45 #include <malloc.h> |
46 #include <algorithm> | 46 #include <algorithm> |
| 47 #include "chrome/app/close_handle_hook_win.h" |
47 #include "chrome/common/child_process_logging.h" | 48 #include "chrome/common/child_process_logging.h" |
48 #include "chrome/common/terminate_on_heap_corruption_experiment_win.h" | 49 #include "chrome/common/terminate_on_heap_corruption_experiment_win.h" |
49 #include "sandbox/win/src/sandbox.h" | 50 #include "sandbox/win/src/sandbox.h" |
50 #include "ui/base/resource/resource_bundle_win.h" | 51 #include "ui/base/resource/resource_bundle_win.h" |
51 #endif | 52 #endif |
52 | 53 |
53 #if defined(OS_MACOSX) | 54 #if defined(OS_MACOSX) |
54 #include "base/mac/mac_util.h" | 55 #include "base/mac/mac_util.h" |
55 #include "base/mac/os_crash_dumps.h" | 56 #include "base/mac/os_crash_dumps.h" |
56 #include "chrome/app/chrome_main_mac.h" | 57 #include "chrome/app/chrome_main_mac.h" |
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
409 HandleHelpSwitches(command_line); | 410 HandleHelpSwitches(command_line); |
410 #endif | 411 #endif |
411 #endif // OS_POSIX | 412 #endif // OS_POSIX |
412 | 413 |
413 #if defined(OS_WIN) | 414 #if defined(OS_WIN) |
414 // Must do this before any other usage of command line! | 415 // Must do this before any other usage of command line! |
415 if (HasDeprecatedArguments(command_line.GetCommandLineString())) { | 416 if (HasDeprecatedArguments(command_line.GetCommandLineString())) { |
416 *exit_code = 1; | 417 *exit_code = 1; |
417 return true; | 418 return true; |
418 } | 419 } |
| 420 |
| 421 InstallCloseHandleHooks(); |
419 #endif | 422 #endif |
420 | 423 |
421 chrome::RegisterPathProvider(); | 424 chrome::RegisterPathProvider(); |
422 #if defined(OS_CHROMEOS) | 425 #if defined(OS_CHROMEOS) |
423 chromeos::RegisterPathProvider(); | 426 chromeos::RegisterPathProvider(); |
424 #endif | 427 #endif |
425 #if !defined(DISABLE_NACL) && defined(OS_LINUX) | 428 #if !defined(DISABLE_NACL) && defined(OS_LINUX) |
426 nacl::RegisterPathProvider(); | 429 nacl::RegisterPathProvider(); |
427 #endif | 430 #endif |
428 | 431 |
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
827 | 830 |
828 void ChromeMainDelegate::ProcessExiting(const std::string& process_type) { | 831 void ChromeMainDelegate::ProcessExiting(const std::string& process_type) { |
829 if (SubprocessNeedsResourceBundle(process_type)) | 832 if (SubprocessNeedsResourceBundle(process_type)) |
830 ResourceBundle::CleanupSharedInstance(); | 833 ResourceBundle::CleanupSharedInstance(); |
831 #if !defined(OS_ANDROID) | 834 #if !defined(OS_ANDROID) |
832 logging::CleanupChromeLogging(); | 835 logging::CleanupChromeLogging(); |
833 #else | 836 #else |
834 // Android doesn't use InitChromeLogging, so we close the log file manually. | 837 // Android doesn't use InitChromeLogging, so we close the log file manually. |
835 logging::CloseLogFile(); | 838 logging::CloseLogFile(); |
836 #endif // !defined(OS_ANDROID) | 839 #endif // !defined(OS_ANDROID) |
| 840 |
| 841 #if defined(OS_WIN) |
| 842 RemoveCloseHandleHooks(); |
| 843 #endif |
837 } | 844 } |
838 | 845 |
839 #if defined(OS_MACOSX) | 846 #if defined(OS_MACOSX) |
840 bool ChromeMainDelegate::ProcessRegistersWithSystemProcess( | 847 bool ChromeMainDelegate::ProcessRegistersWithSystemProcess( |
841 const std::string& process_type) { | 848 const std::string& process_type) { |
842 #if defined(DISABLE_NACL) | 849 #if defined(DISABLE_NACL) |
843 return false; | 850 return false; |
844 #else | 851 #else |
845 return process_type == switches::kNaClLoaderProcess; | 852 return process_type == switches::kNaClLoaderProcess; |
846 #endif | 853 #endif |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
922 } | 929 } |
923 | 930 |
924 content::ContentUtilityClient* | 931 content::ContentUtilityClient* |
925 ChromeMainDelegate::CreateContentUtilityClient() { | 932 ChromeMainDelegate::CreateContentUtilityClient() { |
926 #if defined(CHROME_MULTIPLE_DLL_BROWSER) | 933 #if defined(CHROME_MULTIPLE_DLL_BROWSER) |
927 return NULL; | 934 return NULL; |
928 #else | 935 #else |
929 return g_chrome_content_utility_client.Pointer(); | 936 return g_chrome_content_utility_client.Pointer(); |
930 #endif | 937 #endif |
931 } | 938 } |
OLD | NEW |