| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 #include "content/common/sandbox_init_wrapper.h" | 42 #include "content/common/sandbox_init_wrapper.h" |
| 43 #include "content/common/set_process_title.h" | 43 #include "content/common/set_process_title.h" |
| 44 #include "ipc/ipc_switches.h" | 44 #include "ipc/ipc_switches.h" |
| 45 #include "media/base/media.h" | 45 #include "media/base/media.h" |
| 46 #include "ui/base/resource/resource_bundle.h" | 46 #include "ui/base/resource/resource_bundle.h" |
| 47 #include "ui/base/ui_base_paths.h" | 47 #include "ui/base/ui_base_paths.h" |
| 48 #include "ui/base/ui_base_switches.h" | 48 #include "ui/base/ui_base_switches.h" |
| 49 | 49 |
| 50 #if defined(OS_WIN) | 50 #if defined(OS_WIN) |
| 51 #include <algorithm> | 51 #include <algorithm> |
| 52 #include <atlbase.h> |
| 52 #include <malloc.h> | 53 #include <malloc.h> |
| 53 #include "base/string_util.h" | 54 #include "base/string_util.h" |
| 54 #include "base/win/registry.h" | 55 #include "base/win/registry.h" |
| 55 #include "sandbox/src/sandbox.h" | 56 #include "sandbox/src/sandbox.h" |
| 56 #include "tools/memory_watcher/memory_watcher.h" | 57 #include "tools/memory_watcher/memory_watcher.h" |
| 57 #endif | 58 #endif |
| 58 | 59 |
| 59 #if defined(OS_MACOSX) | 60 #if defined(OS_MACOSX) |
| 60 #include "base/mac/mac_util.h" | 61 #include "base/mac/mac_util.h" |
| 61 #include "base/mac/os_crash_dumps.h" | 62 #include "base/mac/os_crash_dumps.h" |
| (...skipping 704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 766 if (process_type.empty()) { | 767 if (process_type.empty()) { |
| 767 file_state = logging::DELETE_OLD_LOG_FILE; | 768 file_state = logging::DELETE_OLD_LOG_FILE; |
| 768 } | 769 } |
| 769 logging::InitChromeLogging(command_line, file_state); | 770 logging::InitChromeLogging(command_line, file_state); |
| 770 | 771 |
| 771 // Register internal Chrome schemes so they'll be parsed correctly. This must | 772 // Register internal Chrome schemes so they'll be parsed correctly. This must |
| 772 // happen before we process any URLs with the affected schemes, and must be | 773 // happen before we process any URLs with the affected schemes, and must be |
| 773 // done in all processes that work with these URLs (i.e. including renderers). | 774 // done in all processes that work with these URLs (i.e. including renderers). |
| 774 chrome::RegisterChromeSchemes(); | 775 chrome::RegisterChromeSchemes(); |
| 775 | 776 |
| 777 #if defined(OS_WIN) |
| 778 // TODO(darin): Kill this once http://crbug.com/52609 is fixed. |
| 779 ResourceBundle::SetResourcesDataDLL(_AtlBaseModule.GetResourceInstance()); |
| 780 #endif |
| 781 |
| 776 if (SubprocessNeedsResourceBundle(process_type)) { | 782 if (SubprocessNeedsResourceBundle(process_type)) { |
| 777 // Initialize ResourceBundle which handles files loaded from external | 783 // Initialize ResourceBundle which handles files loaded from external |
| 778 // sources. The language should have been passed in to us from the | 784 // sources. The language should have been passed in to us from the |
| 779 // browser process as a command line flag. | 785 // browser process as a command line flag. |
| 780 DCHECK(command_line.HasSwitch(switches::kLang) || | 786 DCHECK(command_line.HasSwitch(switches::kLang) || |
| 781 process_type == switches::kZygoteProcess); | 787 process_type == switches::kZygoteProcess); |
| 782 | 788 |
| 783 // TODO(markusheintz): The command line flag --lang is actually processed | 789 // TODO(markusheintz): The command line flag --lang is actually processed |
| 784 // by the CommandLinePrefStore, and made available through the PrefService | 790 // by the CommandLinePrefStore, and made available through the PrefService |
| 785 // via the preference prefs::kApplicationLocale. The browser process uses | 791 // via the preference prefs::kApplicationLocale. The browser process uses |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 859 | 865 |
| 860 if (SubprocessNeedsResourceBundle(process_type)) | 866 if (SubprocessNeedsResourceBundle(process_type)) |
| 861 ResourceBundle::CleanupSharedInstance(); | 867 ResourceBundle::CleanupSharedInstance(); |
| 862 | 868 |
| 863 logging::CleanupChromeLogging(); | 869 logging::CleanupChromeLogging(); |
| 864 | 870 |
| 865 chrome_main::LowLevelShutdown(); | 871 chrome_main::LowLevelShutdown(); |
| 866 | 872 |
| 867 return exit_code; | 873 return exit_code; |
| 868 } | 874 } |
| OLD | NEW |