diff options
author | Steve Block <steveblock@google.com> | 2011-05-18 13:36:51 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2011-05-24 15:38:28 +0100 |
commit | 2fc2651226baac27029e38c9d6ef883fa32084db (patch) | |
tree | e396d4bf89dcce6ed02071be66212495b1df1dec /Source/WebCore/plugins/gtk | |
parent | b3725cedeb43722b3b175aaeff70552e562d2c94 (diff) | |
download | external_webkit-2fc2651226baac27029e38c9d6ef883fa32084db.zip external_webkit-2fc2651226baac27029e38c9d6ef883fa32084db.tar.gz external_webkit-2fc2651226baac27029e38c9d6ef883fa32084db.tar.bz2 |
Merge WebKit at r78450: Initial merge by git.
Change-Id: I6d3e5f1f868ec266a0aafdef66182ddc3f265dc1
Diffstat (limited to 'Source/WebCore/plugins/gtk')
-rw-r--r-- | Source/WebCore/plugins/gtk/PluginPackageGtk.cpp | 25 | ||||
-rw-r--r-- | Source/WebCore/plugins/gtk/gtk2xtbin.c | 2 | ||||
-rw-r--r-- | Source/WebCore/plugins/gtk/gtk2xtbin.h | 3 |
3 files changed, 30 insertions, 0 deletions
diff --git a/Source/WebCore/plugins/gtk/PluginPackageGtk.cpp b/Source/WebCore/plugins/gtk/PluginPackageGtk.cpp index a702296..26409a7 100644 --- a/Source/WebCore/plugins/gtk/PluginPackageGtk.cpp +++ b/Source/WebCore/plugins/gtk/PluginPackageGtk.cpp @@ -104,6 +104,22 @@ bool PluginPackage::fetchInfo() #endif } +#if defined(XP_UNIX) +static int webkitgtkXError(Display* xdisplay, XErrorEvent* error) +{ + gchar errorMessage[64]; + XGetErrorText(xdisplay, error->error_code, errorMessage, 63); + g_warning("The program '%s' received an X Window System error.\n" + "This probably reflects a bug in the Adobe Flash plugin.\n" + "The error was '%s'.\n" + " (Details: serial %ld error_code %d request_code %d minor_code %d)\n", + g_get_prgname(), errorMessage, + error->serial, error->error_code, + error->request_code, error->minor_code); + return 0; +} +#endif + bool PluginPackage::load() { if (m_isLoaded) { @@ -137,6 +153,15 @@ bool PluginPackage::load() m_isLoaded = true; +#if defined(XP_UNIX) + if (!g_strcmp0(baseName.get(), "libflashplayer.so")) { + // Flash plugin can produce X errors that are handled by the GDK X error handler, which + // exits the process. Since we don't want to crash due to flash bugs, we install a + // custom error handler to show a warning when a X error happens without aborting. + XSetErrorHandler(webkitgtkXError); + } +#endif + NP_InitializeFuncPtr NP_Initialize = 0; m_NPP_Shutdown = 0; diff --git a/Source/WebCore/plugins/gtk/gtk2xtbin.c b/Source/WebCore/plugins/gtk/gtk2xtbin.c index e03fad3..605e42c 100644 --- a/Source/WebCore/plugins/gtk/gtk2xtbin.c +++ b/Source/WebCore/plugins/gtk/gtk2xtbin.c @@ -46,7 +46,9 @@ #include "xembed.h" #include "gtk2xtbin.h" #include <gtk/gtk.h> +#ifdef GTK_API_VERSION_2 #include <gdk/gdkx.h> +#endif #include <glib.h> #include <assert.h> #include <sys/time.h> diff --git a/Source/WebCore/plugins/gtk/gtk2xtbin.h b/Source/WebCore/plugins/gtk/gtk2xtbin.h index 11f6e06..937cd77 100644 --- a/Source/WebCore/plugins/gtk/gtk2xtbin.h +++ b/Source/WebCore/plugins/gtk/gtk2xtbin.h @@ -41,6 +41,9 @@ #define __GTK_XTBIN_H__ #include <gtk/gtk.h> +#ifndef GTK_API_VERSION_2 +#include <gtk/gtkx.h> +#endif #include <X11/Intrinsic.h> #include <X11/Xutil.h> #include <X11/Xlib.h> |