Changeset 76578 in webkit


Ignore:
Timestamp:
Jan 25, 2011 12:43:48 AM (13 years ago)
Author:
Carlos Garcia Campos
Message:

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):
Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r76577 r76578  
     12011-01-25  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        Reviewed by Martin Robinson.
     4
     5        [GTK] Crash in some pages containing flash
     6        https://bugs.webkit.org/show_bug.cgi?id=53016
     7
     8        Flash plugin can produce X errors that are handled by the GDK X
     9        error handler, which exits the process. Since we don't want to
     10        crash due to flash bugs, we install a custom error handler to show
     11        a warning when a X error happens without aborting.
     12
     13        * plugins/gtk/PluginPackageGtk.cpp:
     14        (WebCore::webkitgtkXError):
     15        (WebCore::PluginPackage::load):
     16
    1172011-01-25  Carlos Garcia Campos  <cgarcia@igalia.com>
    218
  • trunk/Source/WebCore/plugins/gtk/PluginPackageGtk.cpp

    r71008 r76578  
    105105}
    106106
     107#if defined(XP_UNIX)
     108static int webkitgtkXError(Display* xdisplay, XErrorEvent* error)
     109{
     110    gchar errorMessage[64];
     111    XGetErrorText(xdisplay, error->error_code, errorMessage, 63);
     112    g_warning("The program '%s' received an X Window System error.\n"
     113              "This probably reflects a bug in the Adobe Flash plugin.\n"
     114              "The error was '%s'.\n"
     115              "  (Details: serial %ld error_code %d request_code %d minor_code %d)\n",
     116              g_get_prgname(), errorMessage,
     117              error->serial, error->error_code,
     118              error->request_code, error->minor_code);
     119    return 0;
     120}
     121#endif
     122
    107123bool PluginPackage::load()
    108124{
     
    138154    m_isLoaded = true;
    139155
     156#if defined(XP_UNIX)
     157    if (!g_strcmp0(baseName.get(), "libflashplayer.so")) {
     158        // Flash plugin can produce X errors that are handled by the GDK X error handler, which
     159        // exits the process. Since we don't want to crash due to flash bugs, we install a
     160        // custom error handler to show a warning when a X error happens without aborting.
     161        XSetErrorHandler(webkitgtkXError);
     162    }
     163#endif
     164
    140165    NP_InitializeFuncPtr NP_Initialize = 0;
    141166    m_NPP_Shutdown = 0;
Note: See TracChangeset for help on using the changeset viewer.