Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(27)

Unified Diff: chrome/app/chrome_main_delegate.cc

Issue 1352713002: Get logging to chrome_debug.log working again on Windows Vista+. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove stray comments Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/logging.cc ('k') | content/common/sandbox_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/app/chrome_main_delegate.cc
diff --git a/chrome/app/chrome_main_delegate.cc b/chrome/app/chrome_main_delegate.cc
index 465bf29e599edbe4ef115628e92a9210362c28c8..a947109742a07f5d0d2d638d87872e8cdc8957d3 100644
--- a/chrome/app/chrome_main_delegate.cc
+++ b/chrome/app/chrome_main_delegate.cc
@@ -388,6 +388,19 @@ void InitializeUserDataDir() {
command_line->AppendSwitchPath(switches::kUserDataDir, user_data_dir);
}
+#if !defined(OS_ANDROID)
+void InitLogging(const std::string& process_type) {
+ logging::OldFileDeletionState file_state =
+ logging::APPEND_TO_OLD_LOG_FILE;
+ if (process_type.empty()) {
+ file_state = logging::DELETE_OLD_LOG_FILE;
+ }
+ const base::CommandLine& command_line =
+ *base::CommandLine::ForCurrentProcess();
+ logging::InitChromeLogging(command_line, file_state);
+}
+#endif
+
} // namespace
ChromeMainDelegate::ChromeMainDelegate() {
@@ -662,14 +675,10 @@ void ChromeMainDelegate::PreSandboxStartup() {
if (command_line.HasSwitch(switches::kMessageLoopHistogrammer))
base::MessageLoop::EnableHistogrammer(true);
-#if !defined(OS_ANDROID)
+#if !defined(OS_ANDROID) && !defined(OS_WIN)
// Android does InitLogging when library is loaded. Skip here.
- logging::OldFileDeletionState file_state =
- logging::APPEND_TO_OLD_LOG_FILE;
- if (process_type.empty()) {
- file_state = logging::DELETE_OLD_LOG_FILE;
- }
- logging::InitChromeLogging(command_line, file_state);
+ // For windows we call InitLogging when the sandbox is initialized.
+ InitLogging(process_type);
#endif
#if defined(OS_WIN)
@@ -780,6 +789,7 @@ void ChromeMainDelegate::SandboxInitialized(const std::string& process_type) {
AdjustLinuxOOMScore(process_type);
#endif
#if defined(OS_WIN)
+ InitLogging(process_type);
SuppressWindowsErrorDialogs();
#endif
« no previous file with comments | « base/logging.cc ('k') | content/common/sandbox_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698