Source/WebKit2/ChangeLog

 12011-06-23 Carlos Garcia Campos <cgarcia@igalia.com>
 2
 3 Reviewed by NOBODY (OOPS!).
 4
 5 [GTK] Install a custom X error handler in plugin process
 6 https://bugs.webkit.org/show_bug.cgi?id=63248
 7
 8 Some plugins, specially flash, can cause X errors that when
 9 handled by the default X error handler (or the GDK one) abort the
 10 process. Since we don't want to crash due to buggy plugins, we
 11 install a custom error handler to show a warning when a X error
 12 happens without aborting.
 13
 14 * PluginProcess/gtk/PluginProcessMainGtk.cpp:
 15 (WebKit::webkitgtkXError):
 16 (WebKit::PluginProcessMainGtk):
 17
1182011-06-22 Carlos Garcia Campos <cgarcia@igalia.com>
219
320 Reviewed by Martin Robinson.

Source/WebKit2/PluginProcess/gtk/PluginProcessMainGtk.cpp

2828
2929#include "PluginProcess.h"
3030#include <WebKit2/RunLoop.h>
 31#include <gdk/gdkx.h>
3132#include <gtk/gtk.h>
3233#include <runtime/InitializeThreading.h>
3334#include <wtf/Threading.h>
3435
3536namespace WebKit {
3637
 38static int webkitgtkXError(Display* xdisplay, XErrorEvent* error)
 39{
 40 gchar errorMessage[64];
 41 XGetErrorText(xdisplay, error->error_code, errorMessage, 63);
 42 g_warning("The program '%s' received an X Window System error.\n"
 43 "This probably reflects a bug in a browser plugin.\n"
 44 "The error was '%s'.\n"
 45 " (Details: serial %ld error_code %d request_code %d minor_code %d)\n",
 46 g_get_prgname(), errorMessage,
 47 error->serial, error->error_code,
 48 error->request_code, error->minor_code);
 49 return 0;
 50}
 51
3752WK_EXPORT int PluginProcessMainGtk(int argc, char* argv[])
3853{
3954 ASSERT(argc == 2);

@@WK_EXPORT int PluginProcessMainGtk(int argc, char* argv[])
4459 WTF::initializeMainThread();
4560 RunLoop::initializeMainRunLoop();
4661
 62 // Plugins can produce X errors that are handled by the GDK X error handler, which
 63 // exits the process. Since we don't want to crash due to plugin bugs, we install a
 64 // custom error handler to show a warning when a X error happens without aborting.
 65 XSetErrorHandler(webkitgtkXError);
 66
4767 int socket = atoi(argv[1]);
4868 WebKit::PluginProcess::shared().initialize(socket, RunLoop::main());
4969 RunLoop::run();