Commit 96982e93 authored by carlosgc@webkit.org's avatar carlosgc@webkit.org
Browse files

2011-01-25 Carlos Garcia Campos <cgarcia@igalia.com>

        Reviewed by Martin Robinson.

        [GTK] Crash in some pages containing flash
        https://bugs.webkit.org/show_bug.cgi?id=53016

        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.

        * plugins/gtk/PluginPackageGtk.cpp:
        (WebCore::webkitgtkXError):
        (WebCore::PluginPackage::load):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76578 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent eec7e801
2011-01-25 Carlos Garcia Campos <cgarcia@igalia.com>
Reviewed by Martin Robinson.
[GTK] Crash in some pages containing flash
https://bugs.webkit.org/show_bug.cgi?id=53016
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.
* plugins/gtk/PluginPackageGtk.cpp:
(WebCore::webkitgtkXError):
(WebCore::PluginPackage::load):
2011-01-25 Carlos Garcia Campos <cgarcia@igalia.com>
 
Reviewed by Martin Robinson.
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment