OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 // TODO(port): the ifdefs in here are a first step towards trying to determine | 5 // TODO(port): the ifdefs in here are a first step towards trying to determine |
6 // the correct abstraction for all the OS functionality required at this | 6 // the correct abstraction for all the OS functionality required at this |
7 // stage of process initialization. It should not be taken as a final | 7 // stage of process initialization. It should not be taken as a final |
8 // abstraction. | 8 // abstraction. |
9 | 9 |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 #include "chrome/browser/diagnostics/diagnostics_main.h" | 48 #include "chrome/browser/diagnostics/diagnostics_main.h" |
49 #include "chrome/browser/renderer_host/render_process_host.h" | 49 #include "chrome/browser/renderer_host/render_process_host.h" |
50 #include "chrome/common/chrome_constants.h" | 50 #include "chrome/common/chrome_constants.h" |
51 #include "chrome/common/chrome_counters.h" | 51 #include "chrome/common/chrome_counters.h" |
52 #include "chrome/common/chrome_descriptors.h" | 52 #include "chrome/common/chrome_descriptors.h" |
53 #include "chrome/common/chrome_paths.h" | 53 #include "chrome/common/chrome_paths.h" |
54 #include "chrome/common/chrome_switches.h" | 54 #include "chrome/common/chrome_switches.h" |
55 #include "chrome/common/logging_chrome.h" | 55 #include "chrome/common/logging_chrome.h" |
56 #include "chrome/common/main_function_params.h" | 56 #include "chrome/common/main_function_params.h" |
57 #include "chrome/common/sandbox_init_wrapper.h" | 57 #include "chrome/common/sandbox_init_wrapper.h" |
| 58 #include "chrome/common/url_constants.h" |
58 #include "ipc/ipc_switches.h" | 59 #include "ipc/ipc_switches.h" |
59 | 60 |
60 #if defined(USE_NSS) | 61 #if defined(USE_NSS) |
61 #include "base/nss_util.h" | 62 #include "base/nss_util.h" |
62 #endif | 63 #endif |
63 | 64 |
64 #if defined(OS_LINUX) | 65 #if defined(OS_LINUX) |
65 #include "chrome/browser/renderer_host/render_sandbox_host_linux.h" | 66 #include "chrome/browser/renderer_host/render_sandbox_host_linux.h" |
66 #include "chrome/browser/zygote_host_linux.h" | 67 #include "chrome/browser/zygote_host_linux.h" |
67 #endif | 68 #endif |
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
637 bool icu_result = icu_util::Initialize(); | 638 bool icu_result = icu_util::Initialize(); |
638 CHECK(icu_result); | 639 CHECK(icu_result); |
639 | 640 |
640 logging::OldFileDeletionState file_state = | 641 logging::OldFileDeletionState file_state = |
641 logging::APPEND_TO_OLD_LOG_FILE; | 642 logging::APPEND_TO_OLD_LOG_FILE; |
642 if (process_type.empty()) { | 643 if (process_type.empty()) { |
643 file_state = logging::DELETE_OLD_LOG_FILE; | 644 file_state = logging::DELETE_OLD_LOG_FILE; |
644 } | 645 } |
645 logging::InitChromeLogging(parsed_command_line, file_state); | 646 logging::InitChromeLogging(parsed_command_line, file_state); |
646 | 647 |
| 648 // Register internal Chrome schemes so they'll be parsed correctly. This must |
| 649 // happen before we process any URLs with the affected schemes, and must be |
| 650 // done in all processes that work with these URLs (i.e. including renderers). |
| 651 chrome::RegisterChromeSchemes(); |
| 652 |
647 #ifdef NDEBUG | 653 #ifdef NDEBUG |
648 if (parsed_command_line.HasSwitch(switches::kSilentDumpOnDCHECK) && | 654 if (parsed_command_line.HasSwitch(switches::kSilentDumpOnDCHECK) && |
649 parsed_command_line.HasSwitch(switches::kEnableDCHECK)) { | 655 parsed_command_line.HasSwitch(switches::kEnableDCHECK)) { |
650 #if defined(OS_WIN) | 656 #if defined(OS_WIN) |
651 logging::SetLogReportHandler(ChromeAssert); | 657 logging::SetLogReportHandler(ChromeAssert); |
652 #endif | 658 #endif |
653 } | 659 } |
654 #endif // NDEBUG | 660 #endif // NDEBUG |
655 | 661 |
656 if (SubprocessNeedsResourceBundle(process_type)) { | 662 if (SubprocessNeedsResourceBundle(process_type)) { |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
803 | 809 |
804 logging::CleanupChromeLogging(); | 810 logging::CleanupChromeLogging(); |
805 | 811 |
806 #if defined(OS_MACOSX) && defined(GOOGLE_CHROME_BUILD) | 812 #if defined(OS_MACOSX) && defined(GOOGLE_CHROME_BUILD) |
807 // TODO(mark): See the TODO(mark) above at InitCrashReporter. | 813 // TODO(mark): See the TODO(mark) above at InitCrashReporter. |
808 DestructCrashReporter(); | 814 DestructCrashReporter(); |
809 #endif // OS_MACOSX && GOOGLE_CHROME_BUILD | 815 #endif // OS_MACOSX && GOOGLE_CHROME_BUILD |
810 | 816 |
811 return rv; | 817 return rv; |
812 } | 818 } |
OLD | NEW |