summaryrefslogtreecommitdiffstats
path: root/base/logging.cc
diff options
context:
space:
mode:
authorKristian Monsen <kristianm@google.com>2011-05-20 08:38:30 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-05-20 08:38:30 -0700
commit653c44a719415c79343bcd3d792b2af49158bef9 (patch)
tree0ccaee049be307952e1da0927d958987d4d7c649 /base/logging.cc
parentc62186ce85deb387aa803a87d9bb4d28bcf3e41a (diff)
parent9a94cca4a85bd600fe953b6819d573daeac3a4fc (diff)
downloadexternal_chromium-653c44a719415c79343bcd3d792b2af49158bef9.zip
external_chromium-653c44a719415c79343bcd3d792b2af49158bef9.tar.gz
external_chromium-653c44a719415c79343bcd3d792b2af49158bef9.tar.bz2
Merge changes Id3099d71,If8df058e,Ib1652546,I45be184a,I0debd2e0,Ide8a562a,I7bc23c57,I62bea1d4,Ia5e76f84,I3a810578,I74a450af,Id3f7909f,I9f4e1030,I6f0821ed,Ib7995412,Ibbde495d,Ia38e2ff7,I80ff3ede,Ic28f1515,I8fdd7adb,I46034835,I176dbe5b,I3b4e81dd,I070cc91c
* changes: Merge Chromium at 10.0.621.0: Update Chromium merge revision Merge Chromium at 10.0.621.0: Fix linker error Merge Chromium at 10.0.621.0: profile.h moved upstream Merge Chromium at 10.0.621.0: Compile fix for profile_android.h Merge Chromium at 10.0.621.0: Compile fix, CreateUserPrefService removed upstream. Merge Chromium at 10.0.621.0: Fix Makefiles Merge Chromium at 10.0.621.0: Fix conflicts in pref_service.* Merge Chromium at 10.0.621.0: Fix conflicts in pref_value_store.* Merge Chromium at 10.0.621.0: Fix conflicts in autofill Merge Chromium at 10.0.621.0: Fix conflict in autofill_download.h Merge Chromium at 10.0.621.0: Fix conflict in pref_service.h Merge Chromium at 10.0.621.0: Fix conflict in url_request_http_job.cc Merge Chromium at 10.0.621.0: Fix conflict in ssl_client_socket_pool.cc Merge Chromium at 10.0.621.0: Fix conflict in ssl_host_info.cc Merge Chromium at 10.0.621.0: Fix conflict in ssl_client_socket_openssl.* Merge Chromium at 10.0.621.0: Fix conflict in http_proxy_client_socket.cc Merge Chromium at 10.0.621.0: Fix conflict in des.cc Merge Chromium at 10.0.621.0: Fix conflict in sqlite_persistent_cookie_store.* Merge Chromium at 10.0.621.0: Fix conflict in cookie_monster.* Merge Chromium at 10.0.621.0: Fix conflict in prcpucfg.h Merge Chromium at 10.0.621.0: Fix conflict in message_loop.cc Merge Chromium at 10.0.621.0: Fix conflict in logging.cc Merge Chromium at 10.0.621.0: Fix conflict in hash_tables.h Merge Chromium at 10.0.621.0: Initial merge by git.
Diffstat (limited to 'base/logging.cc')
-rw-r--r--base/logging.cc37
1 files changed, 20 insertions, 17 deletions
diff --git a/base/logging.cc b/base/logging.cc
index a202e05..8a957c9 100644
--- a/base/logging.cc
+++ b/base/logging.cc
@@ -51,16 +51,20 @@ typedef pthread_mutex_t* MutexHandle;
#include "base/debug/stack_trace.h"
#include "base/eintr_wrapper.h"
#include "base/lock_impl.h"
-#if defined(OS_POSIX)
-#include "base/safe_strerror_posix.h"
-#endif
-#include "base/process_util.h"
#include "base/string_piece.h"
#include "base/utf_string_conversions.h"
#ifndef ANDROID
#include "base/vlog.h"
#endif
+#if defined(OS_POSIX)
+#include "base/safe_strerror_posix.h"
+#endif
+#if defined(OS_MACOSX)
+#include "base/mac/scoped_cftyperef.h"
+#include "base/sys_string_conversions.h"
+#endif
+
namespace logging {
bool g_enable_dcheck = false;
@@ -469,6 +473,9 @@ template std::string* MakeCheckOpString<std::string, std::string>(
// Displays a message box to the user with the error message in it.
// Used for fatal messages, where we close the app simultaneously.
+// This is for developers only; we don't use this in circumstances
+// (like release builds) where users could see it, since users don't
+// understand these messages anyway.
void DisplayDebugMessageInDialog(const std::string& str) {
if (str.empty())
return;
@@ -509,19 +516,15 @@ void DisplayDebugMessageInDialog(const std::string& str) {
MessageBoxW(NULL, &cmdline[0], L"Fatal error",
MB_OK | MB_ICONHAND | MB_TOPMOST);
}
-#elif defined(USE_X11) && !defined(OS_CHROMEOS)
- // Shell out to xmessage, which behaves like debug_message.exe, but is
- // way more retro. We could use zenity/kdialog but then we're starting
- // to get into needing to check the desktop env and this dialog should
- // only be coming up in Very Bad situations.
- std::vector<std::string> argv;
- argv.push_back("xmessage");
- argv.push_back(str);
- base::LaunchApp(argv, base::file_handle_mapping_vector(), true /* wait */,
- NULL);
+#elif defined(OS_MACOSX)
+ base::mac::ScopedCFTypeRef<CFStringRef> message(
+ base::SysUTF8ToCFStringRef(str));
+ CFUserNotificationDisplayNotice(0, kCFUserNotificationStopAlertLevel,
+ NULL, NULL, NULL, CFSTR("Fatal Error"),
+ message, NULL);
#else
- // http://code.google.com/p/chromium/issues/detail?id=37026
- NOTIMPLEMENTED();
+ // We intentionally don't implement a dialog on other platforms.
+ // You can just look at stderr.
#endif
}
@@ -602,7 +605,7 @@ void LogMessage::Init(const char* file, int line) {
else
stream_ << "VERBOSE" << -severity_;
- stream_ << ":" << file << "(" << line << ")] ";
+ stream_ << ":" << filename << "(" << line << ")] ";
message_start_ = stream_.tellp();
}