| Index: chrome/app/chrome_dll_main.cc
|
| diff --git a/chrome/app/chrome_dll_main.cc b/chrome/app/chrome_dll_main.cc
|
| index 6ef4c20e3d4561b761ba0af2cfa91ae9bc363c4e..46bd0ff9e29084ab757930c716a38303f78ae446 100644
|
| --- a/chrome/app/chrome_dll_main.cc
|
| +++ b/chrome/app/chrome_dll_main.cc
|
| @@ -159,18 +159,33 @@ 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) {
|
| +static void GLibFatalLogHandler(const gchar* log_domain,
|
| + GLogLevelFlags log_level,
|
| + const gchar* message,
|
| + gpointer userdata) {
|
| if (!log_domain)
|
| - log_domain = "<all>";
|
| + log_domain = "<unknown>";
|
| if (!message)
|
| message = "<no message>";
|
|
|
| - NOTREACHED() << "GTK: (" << log_domain << "): " << message;
|
| + LOG(FATAL) << log_domain << ": " << message;
|
| }
|
| -#endif
|
| +
|
| +static void SetUpGLibLogHandler() {
|
| + // Register GLib-handled assertions to go through our logging system.
|
| + const char* kLogDomains[] = { NULL, "Gtk", "Gdk", "GLib" };
|
| + for (size_t i = 0; i < arraysize(kLogDomains); i++) {
|
| + g_log_set_handler(kLogDomains[i],
|
| + static_cast<GLogLevelFlags>(G_LOG_FLAG_RECURSION |
|
| + G_LOG_FLAG_FATAL |
|
| + G_LOG_LEVEL_ERROR |
|
| + G_LOG_LEVEL_CRITICAL |
|
| + G_LOG_LEVEL_WARNING),
|
| + GLibFatalLogHandler,
|
| + NULL);
|
| + }
|
| +}
|
| +#endif // defined(OS_LINUX)
|
|
|
| // Register the invalid param handler and pure call handler to be able to
|
| // notify breakpad when it happens.
|
| @@ -404,15 +419,7 @@ 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);
|
| + SetUpGLibLogHandler();
|
| #endif
|
|
|
| ScopedOleInitializer ole_initializer;
|
|
|