summaryrefslogtreecommitdiffstats
path: root/chrome/app/chrome_dll_main.cc
diff options
context:
space:
mode:
authorthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-11 01:56:27 +0000
committerthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-11 01:56:27 +0000
commitf658af8bb836debbac7ca687634792d9dc6b9f87 (patch)
treef69027acb8331a93c3db63ee5017509f6b3aacd2 /chrome/app/chrome_dll_main.cc
parenta551ebd84a64c2723cae1b1c48eef602f9c3b44b (diff)
downloadchromium_src-f658af8bb836debbac7ca687634792d9dc6b9f87.zip
chromium_src-f658af8bb836debbac7ca687634792d9dc6b9f87.tar.gz
chromium_src-f658af8bb836debbac7ca687634792d9dc6b9f87.tar.bz2
Linux: Catch X errors and force a crash.
BUG=45020 TEST=See http://crosbug.com/3487 Review URL: http://codereview.chromium.org/2716007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49488 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/app/chrome_dll_main.cc')
-rw-r--r--chrome/app/chrome_dll_main.cc19
1 files changed, 13 insertions, 6 deletions
diff --git a/chrome/app/chrome_dll_main.cc b/chrome/app/chrome_dll_main.cc
index 530d185..d6eda18 100644
--- a/chrome/app/chrome_dll_main.cc
+++ b/chrome/app/chrome_dll_main.cc
@@ -23,7 +23,7 @@
#include <unistd.h>
#endif
-#if defined(OS_POSIX) && !defined(OS_MACOSX)
+#if defined(USE_X11)
#include <gdk/gdk.h>
#include <glib.h>
#include <gtk/gtk.h>
@@ -66,6 +66,10 @@
#include "base/nss_util.h"
#endif
+#if defined(USE_X11)
+#include "app/x11_util.h"
+#endif
+
#if defined(OS_LINUX)
#include "chrome/browser/renderer_host/render_sandbox_host_linux.h"
#include "chrome/browser/zygote_host_linux.h"
@@ -204,9 +208,9 @@ bool HasDeprecatedArguments(const std::wstring& command_line) {
return (pos != std::wstring::npos);
}
-#endif // OS_WIN
+#endif // defined(OS_WIN)
-#if defined(OS_POSIX) && !defined(OS_MACOSX)
+#if defined(USE_X11)
static void GLibLogHandler(const gchar* log_domain,
GLogLevelFlags log_level,
const gchar* message,
@@ -261,7 +265,9 @@ static void SetUpGLibLogHandler() {
NULL);
}
}
+#endif // defined(USE_X11)
+#if defined(OS_LINUX)
static void AdjustLinuxOOMScore(const std::string& process_type) {
const int kMiscScore = 7;
const int kPluginScore = 10;
@@ -295,7 +301,7 @@ static void AdjustLinuxOOMScore(const std::string& process_type) {
if (score > -1)
base::AdjustOOMScore(base::GetCurrentProcId(), score);
}
-#endif // defined(OS_POSIX) && !defined(OS_MACOSX)
+#endif // defined(OS_LINUX)
// Register the invalid param handler and pure call handler to be able to
// notify breakpad when it happens.
@@ -717,8 +723,7 @@ int ChromeMain(int argc, char** argv) {
// Update the process name (need resources to get the strings, so
// only do this when ResourcesBundle has been initialized).
SetMacProcessName(process_type);
-#endif // defined(OS_MACOSX)
-
+#endif // defined(OS_MACOSX)
}
if (!process_type.empty())
@@ -849,6 +854,8 @@ int ChromeMain(int argc, char** argv) {
// gtk_init() can change |argc| and |argv|.
gtk_init(&argc, &argv);
SetUpGLibLogHandler();
+
+ x11_util::SetX11ErrorHandlers();
#endif // defined(OS_LINUX)
rv = BrowserMain(main_params);