| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 30 matching lines...) Expand all Loading... |
| 41 #include "base/file_version_info.h" | 41 #include "base/file_version_info.h" |
| 42 #include "base/i18n/icu_util.h" | 42 #include "base/i18n/icu_util.h" |
| 43 #include "base/message_loop.h" | 43 #include "base/message_loop.h" |
| 44 #include "base/path_service.h" | 44 #include "base/path_service.h" |
| 45 #include "base/process_util.h" | 45 #include "base/process_util.h" |
| 46 #include "base/scoped_nsautorelease_pool.h" | 46 #include "base/scoped_nsautorelease_pool.h" |
| 47 #include "base/stats_counters.h" | 47 #include "base/stats_counters.h" |
| 48 #include "base/stats_table.h" | 48 #include "base/stats_table.h" |
| 49 #include "base/string_util.h" | 49 #include "base/string_util.h" |
| 50 #include "base/utf_string_conversions.h" | 50 #include "base/utf_string_conversions.h" |
| 51 #include "chrome/app/chrome_version_info.h" | |
| 52 #include "chrome/browser/diagnostics/diagnostics_main.h" | 51 #include "chrome/browser/diagnostics/diagnostics_main.h" |
| 53 #include "chrome/browser/renderer_host/render_process_host.h" | 52 #include "chrome/browser/renderer_host/render_process_host.h" |
| 54 #include "chrome/browser/platform_util.h" | 53 #include "chrome/browser/platform_util.h" |
| 55 #include "chrome/common/chrome_constants.h" | 54 #include "chrome/common/chrome_constants.h" |
| 56 #include "chrome/common/chrome_counters.h" | 55 #include "chrome/common/chrome_counters.h" |
| 57 #include "chrome/common/chrome_descriptors.h" | 56 #include "chrome/common/chrome_descriptors.h" |
| 58 #include "chrome/common/chrome_paths.h" | 57 #include "chrome/common/chrome_paths.h" |
| 59 #include "chrome/common/chrome_switches.h" | 58 #include "chrome/common/chrome_switches.h" |
| 59 #include "chrome/common/chrome_version_info.h" |
| 60 #include "chrome/common/logging_chrome.h" | 60 #include "chrome/common/logging_chrome.h" |
| 61 #include "chrome/common/main_function_params.h" | 61 #include "chrome/common/main_function_params.h" |
| 62 #include "chrome/common/sandbox_init_wrapper.h" | 62 #include "chrome/common/sandbox_init_wrapper.h" |
| 63 #include "chrome/common/url_constants.h" | 63 #include "chrome/common/url_constants.h" |
| 64 #include "ipc/ipc_switches.h" | 64 #include "ipc/ipc_switches.h" |
| 65 | 65 |
| 66 #if defined(USE_NSS) | 66 #if defined(USE_NSS) |
| 67 #include "base/nss_util.h" | 67 #include "base/nss_util.h" |
| 68 #endif | 68 #endif |
| 69 | 69 |
| (...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 502 #if defined(OS_WIN) | 502 #if defined(OS_WIN) |
| 503 CommandLine::Init(0, NULL); | 503 CommandLine::Init(0, NULL); |
| 504 #else | 504 #else |
| 505 CommandLine::Init(argc, argv); | 505 CommandLine::Init(argc, argv); |
| 506 #endif | 506 #endif |
| 507 | 507 |
| 508 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); | 508 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); |
| 509 | 509 |
| 510 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 510 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
| 511 if (parsed_command_line.HasSwitch(switches::kProductVersion)) { | 511 if (parsed_command_line.HasSwitch(switches::kProductVersion)) { |
| 512 scoped_ptr<FileVersionInfo> version(chrome_app::GetChromeVersionInfo()); | 512 scoped_ptr<FileVersionInfo> version(chrome::GetChromeVersionInfo()); |
| 513 printf("%s\n", WideToASCII(version->product_version()).c_str()); | 513 printf("%s\n", WideToASCII(version->product_version()).c_str()); |
| 514 return 0; | 514 return 0; |
| 515 } | 515 } |
| 516 #endif | 516 #endif |
| 517 | 517 |
| 518 #if defined(OS_POSIX) | 518 #if defined(OS_POSIX) |
| 519 if (parsed_command_line.HasSwitch(switches::kVersion)) { | 519 if (parsed_command_line.HasSwitch(switches::kVersion)) { |
| 520 scoped_ptr<FileVersionInfo> version(chrome_app::GetChromeVersionInfo()); | 520 scoped_ptr<FileVersionInfo> version(chrome::GetChromeVersionInfo()); |
| 521 printf("%s %s %s\n", | 521 printf("%s %s %s\n", |
| 522 WideToUTF8(version->product_name()).c_str(), | 522 WideToUTF8(version->product_name()).c_str(), |
| 523 WideToASCII(version->product_version()).c_str(), | 523 WideToASCII(version->product_version()).c_str(), |
| 524 UTF16ToUTF8(platform_util::GetVersionStringModifier()).c_str()); | 524 UTF16ToUTF8(platform_util::GetVersionStringModifier()).c_str()); |
| 525 return 0; | 525 return 0; |
| 526 } | 526 } |
| 527 #endif | 527 #endif |
| 528 | 528 |
| 529 std::string process_type = | 529 std::string process_type = |
| 530 parsed_command_line.GetSwitchValueASCII(switches::kProcessType); | 530 parsed_command_line.GetSwitchValueASCII(switches::kProcessType); |
| (...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 904 | 904 |
| 905 logging::CleanupChromeLogging(); | 905 logging::CleanupChromeLogging(); |
| 906 | 906 |
| 907 #if defined(OS_MACOSX) && defined(GOOGLE_CHROME_BUILD) | 907 #if defined(OS_MACOSX) && defined(GOOGLE_CHROME_BUILD) |
| 908 // TODO(mark): See the TODO(mark) above at InitCrashReporter. | 908 // TODO(mark): See the TODO(mark) above at InitCrashReporter. |
| 909 DestructCrashReporter(); | 909 DestructCrashReporter(); |
| 910 #endif // OS_MACOSX && GOOGLE_CHROME_BUILD | 910 #endif // OS_MACOSX && GOOGLE_CHROME_BUILD |
| 911 | 911 |
| 912 return rv; | 912 return rv; |
| 913 } | 913 } |
| OLD | NEW |