summaryrefslogtreecommitdiffstats
path: root/chrome/app
diff options
context:
space:
mode:
authordeanm@chromium.org <deanm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-17 16:10:25 +0000
committerdeanm@chromium.org <deanm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-17 16:10:25 +0000
commit0f55d5c67c4b80b85aa56313dc09fc1b99518692 (patch)
treeb1ea32ce59d2a3c06127e40f4de24e4f96b50c4a /chrome/app
parent7bea0ed3ca62aaf5e1bca275913e27d836d126eb (diff)
downloadchromium_src-0f55d5c67c4b80b85aa56313dc09fc1b99518692.zip
chromium_src-0f55d5c67c4b80b85aa56313dc09fc1b99518692.tar.gz
chromium_src-0f55d5c67c4b80b85aa56313dc09fc1b99518692.tar.bz2
Pipe fatal GTK messages through our logging system.
Review URL: http://codereview.chromium.org/48072 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11869 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/app')
-rw-r--r--chrome/app/chrome_dll_main.cc23
1 files changed, 23 insertions, 0 deletions
diff --git a/chrome/app/chrome_dll_main.cc b/chrome/app/chrome_dll_main.cc
index e54d207..b41e54e 100644
--- a/chrome/app/chrome_dll_main.cc
+++ b/chrome/app/chrome_dll_main.cc
@@ -155,6 +155,20 @@ bool IncorrectChromeHtmlArguments(const std::wstring& command_line) {
#endif // OS_WIN
+#if defined(OS_LINUX)
+static void GtkFatalLogHandler(const gchar* log_domain,
+ GLogLevelFlags log_level,
+ const gchar* message,
+ gpointer userdata) {
+ if (!log_domain)
+ log_domain = "<all>";
+ if (!message)
+ message = "<no message>";
+
+ NOTREACHED() << "GTK: (" << log_domain << "): " << message;
+}
+#endif
+
// Register the invalid param handler and pure call handler to be able to
// notify breakpad when it happens.
void RegisterInvalidParamHandler() {
@@ -381,6 +395,15 @@ int ChromeMain(int argc, const char** argv) {
#if defined(OS_LINUX)
// gtk_init() can change |argc| and |argv|, but nobody else uses them.
gtk_init(&argc, const_cast<char***>(&argv));
+ // Register GTK assertions to go through our logging system.
+ g_log_set_handler(NULL, // All logging domains.
+ static_cast<GLogLevelFlags>(G_LOG_FLAG_RECURSION |
+ G_LOG_FLAG_FATAL |
+ G_LOG_LEVEL_ERROR |
+ G_LOG_LEVEL_CRITICAL |
+ G_LOG_LEVEL_WARNING),
+ GtkFatalLogHandler,
+ NULL);
#endif
ScopedOleInitializer ole_initializer;