| 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 27 matching lines...) Expand all Loading... |
| 38 #include "base/command_line.h" | 38 #include "base/command_line.h" |
| 39 #include "base/debug_util.h" | 39 #include "base/debug_util.h" |
| 40 #include "base/i18n/icu_util.h" | 40 #include "base/i18n/icu_util.h" |
| 41 #include "base/message_loop.h" | 41 #include "base/message_loop.h" |
| 42 #include "base/path_service.h" | 42 #include "base/path_service.h" |
| 43 #include "base/process_util.h" | 43 #include "base/process_util.h" |
| 44 #include "base/scoped_nsautorelease_pool.h" | 44 #include "base/scoped_nsautorelease_pool.h" |
| 45 #include "base/stats_counters.h" | 45 #include "base/stats_counters.h" |
| 46 #include "base/stats_table.h" | 46 #include "base/stats_table.h" |
| 47 #include "base/string_util.h" | 47 #include "base/string_util.h" |
| 48 #include "chrome/app/scoped_ole_initializer.h" | |
| 49 #include "chrome/browser/diagnostics/diagnostics_main.h" | 48 #include "chrome/browser/diagnostics/diagnostics_main.h" |
| 50 #include "chrome/browser/renderer_host/render_process_host.h" | 49 #include "chrome/browser/renderer_host/render_process_host.h" |
| 51 #include "chrome/common/chrome_constants.h" | 50 #include "chrome/common/chrome_constants.h" |
| 52 #include "chrome/common/chrome_counters.h" | 51 #include "chrome/common/chrome_counters.h" |
| 53 #include "chrome/common/chrome_descriptors.h" | 52 #include "chrome/common/chrome_descriptors.h" |
| 54 #include "chrome/common/chrome_paths.h" | 53 #include "chrome/common/chrome_paths.h" |
| 55 #include "chrome/common/chrome_switches.h" | 54 #include "chrome/common/chrome_switches.h" |
| 56 #include "chrome/common/logging_chrome.h" | 55 #include "chrome/common/logging_chrome.h" |
| 57 #include "chrome/common/main_function_params.h" | 56 #include "chrome/common/main_function_params.h" |
| 58 #include "chrome/common/sandbox_init_wrapper.h" | 57 #include "chrome/common/sandbox_init_wrapper.h" |
| (...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 735 // used in net/proxy/proxy_config_service_linux.cc. Most likely | 734 // used in net/proxy/proxy_config_service_linux.cc. Most likely |
| 736 // this is superfluous as gtk_init() ought to do this. It's | 735 // this is superfluous as gtk_init() ought to do this. It's |
| 737 // definitely harmless, so retained as a reminder of this | 736 // definitely harmless, so retained as a reminder of this |
| 738 // requirement for gconf. | 737 // requirement for gconf. |
| 739 g_type_init(); | 738 g_type_init(); |
| 740 // gtk_init() can change |argc| and |argv|. | 739 // gtk_init() can change |argc| and |argv|. |
| 741 gtk_init(&argc, &argv); | 740 gtk_init(&argc, &argv); |
| 742 SetUpGLibLogHandler(); | 741 SetUpGLibLogHandler(); |
| 743 #endif // defined(OS_LINUX) | 742 #endif // defined(OS_LINUX) |
| 744 | 743 |
| 745 ScopedOleInitializer ole_initializer; | |
| 746 rv = BrowserMain(main_params); | 744 rv = BrowserMain(main_params); |
| 747 } else { | 745 } else { |
| 748 NOTREACHED() << "Unknown process type"; | 746 NOTREACHED() << "Unknown process type"; |
| 749 } | 747 } |
| 750 | 748 |
| 751 if (SubprocessNeedsResourceBundle(process_type)) | 749 if (SubprocessNeedsResourceBundle(process_type)) |
| 752 ResourceBundle::CleanupSharedInstance(); | 750 ResourceBundle::CleanupSharedInstance(); |
| 753 | 751 |
| 754 #if defined(OS_WIN) | 752 #if defined(OS_WIN) |
| 755 #ifdef _CRTDBG_MAP_ALLOC | 753 #ifdef _CRTDBG_MAP_ALLOC |
| 756 _CrtDumpMemoryLeaks(); | 754 _CrtDumpMemoryLeaks(); |
| 757 #endif // _CRTDBG_MAP_ALLOC | 755 #endif // _CRTDBG_MAP_ALLOC |
| 758 | 756 |
| 759 _Module.Term(); | 757 _Module.Term(); |
| 760 #endif | 758 #endif |
| 761 | 759 |
| 762 logging::CleanupChromeLogging(); | 760 logging::CleanupChromeLogging(); |
| 763 | 761 |
| 764 #if defined(OS_MACOSX) && defined(GOOGLE_CHROME_BUILD) | 762 #if defined(OS_MACOSX) && defined(GOOGLE_CHROME_BUILD) |
| 765 // TODO(mark): See the TODO(mark) above at InitCrashReporter. | 763 // TODO(mark): See the TODO(mark) above at InitCrashReporter. |
| 766 DestructCrashReporter(); | 764 DestructCrashReporter(); |
| 767 #endif // OS_MACOSX && GOOGLE_CHROME_BUILD | 765 #endif // OS_MACOSX && GOOGLE_CHROME_BUILD |
| 768 | 766 |
| 769 return rv; | 767 return rv; |
| 770 } | 768 } |
| OLD | NEW |