Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / chrome / common / logging_chrome.cc
index 9311425..67569e2 100644 (file)
@@ -35,8 +35,8 @@
 #include "base/debug/debugger.h"
 #include "base/debug/dump_without_crashing.h"
 #include "base/environment.h"
-#include "base/file_util.h"
 #include "base/files/file_path.h"
+#include "base/files/file_util.h"
 #include "base/logging.h"
 #include "base/path_service.h"
 #include "base/strings/string_number_conversions.h"
@@ -90,15 +90,6 @@ MSVC_DISABLE_OPTIMIZE();
 void SilentRuntimeAssertHandler(const std::string& str) {
   base::debug::BreakDebugger();
 }
-void SilentRuntimeReportHandler(const std::string& str) {
-}
-#if defined(OS_WIN)
-// Handler to silently dump the current process when there is an assert in
-// chrome.
-void DumpProcessAssertHandler(const std::string& str) {
-  base::debug::DumpWithoutCrashing();
-}
-#endif  // OS_WIN
 MSVC_ENABLE_OPTIMIZE();
 
 // Suppresses error/assertion dialogs and enables the logging of
@@ -108,7 +99,6 @@ void SuppressDialogs() {
     return;
 
   logging::SetLogAssertHandler(SilentRuntimeAssertHandler);
-  logging::SetLogReportHandler(SilentRuntimeReportHandler);
 
 #if defined(OS_WIN)
   UINT new_flags = SEM_FAILCRITICALERRORS |
@@ -197,7 +187,7 @@ void RemoveSymlinkAndLog(const base::FilePath& link_path,
 
 }  // anonymous namespace
 
-base::FilePath GetSessionLogFile(const CommandLine& command_line) {
+base::FilePath GetSessionLogDir(const CommandLine& command_line) {
   base::FilePath log_dir;
   std::string log_dir_str;
   scoped_ptr<base::Environment> env(base::Environment::Create());
@@ -220,14 +210,17 @@ base::FilePath GetSessionLogFile(const CommandLine& command_line) {
     }
     log_dir = log_dir.Append(profile_dir);
   }
-  return log_dir.Append(GetLogFileName().BaseName());
+  return log_dir;
+}
+
+base::FilePath GetSessionLogFile(const CommandLine& command_line) {
+  return GetSessionLogDir(command_line).Append(GetLogFileName().BaseName());
 }
 
 void RedirectChromeLogging(const CommandLine& command_line) {
-  if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kMultiProfiles) &&
-      chrome_logging_redirected_) {
+  if (chrome_logging_redirected_) {
     // TODO(nkostylev): Support multiple active users. http://crbug.com/230345
-    LOG(ERROR) << "NOT redirecting logging for multi-profiles case.";
+    LOG(WARNING) << "NOT redirecting logging for multi-profiles case.";
     return;
   }
 
@@ -359,11 +352,6 @@ void InitChromeLogging(const CommandLine& command_line,
   logging::LogEventProvider::Initialize(kChromeTraceProviderName);
 #endif
 
-#if DCHECK_IS_ON && defined(NDEBUG) && defined(OS_WIN)
-  if (command_line.HasSwitch(switches::kSilentDumpOnDCHECK))
-    logging::SetLogReportHandler(DumpProcessAssertHandler);
-#endif
-
   chrome_logging_initialized_ = true;
 }