[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
girish at forwardbias.in
girish at forwardbias.in
Wed Dec 22 12:34:27 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit ec53a6b2cc4c929c3043e89357ae320e0a3a3236
Author: girish at forwardbias.in <girish at forwardbias.in@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Aug 25 16:33:34 2010 +0000
2010-08-25 Dawit Alemayehu <adawit at kde.org>
Reviewed by Ariya Hidayat.
Proper workaround for missing Gtk initialization in Adobe's flash plugins.
https://bugs.webkit.org/show_bug.cgi?id=44405
* plugins/qt/PluginPackageQt.cpp:
(WebCore::initializeGtk):
(WebCore::PluginPackage::load):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@66017 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index eb5910e..7a157e9 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,14 @@
+2010-08-25 Dawit Alemayehu <adawit at kde.org>
+
+ Reviewed by Ariya Hidayat.
+
+ Proper workaround for missing Gtk initialization in Adobe's flash plugins.
+ https://bugs.webkit.org/show_bug.cgi?id=44405
+
+ * plugins/qt/PluginPackageQt.cpp:
+ (WebCore::initializeGtk):
+ (WebCore::PluginPackage::load):
+
2010-08-25 Ilya Tikhonovsky <loislo at chromium.org>
Reviewed by Yury Semikhatsky.
diff --git a/WebCore/plugins/qt/PluginPackageQt.cpp b/WebCore/plugins/qt/PluginPackageQt.cpp
index b421b1e..d92fffe 100644
--- a/WebCore/plugins/qt/PluginPackageQt.cpp
+++ b/WebCore/plugins/qt/PluginPackageQt.cpp
@@ -90,26 +90,37 @@ static NPError staticPluginQuirkRequiresGtkToolKit_NPN_GetValue(NPP instance, NP
return NPN_GetValue(instance, variable, value);
}
-static void initializeGdkIfPossible()
+static void initializeGtk(QLibrary* module = 0)
{
- static bool attemptMade = false;
-
- if (attemptMade)
- return;
-
- attemptMade = true;
-
- QLibrary library("libgdk-x11-2.0.so.0");
- if (!library.load())
- return;
-
- typedef void *(*gdk_init_check_ptr)(int*, char***);
- gdk_init_check_ptr gdk_init_check = (gdk_init_check_ptr)library.resolve("gdk_init_check");
- if (!gdk_init_check)
- return;
+ // Ensures missing Gtk initialization in some versions of Adobe's flash player
+ // plugin do not cause crashes. See BR# 40567, 44324, and 44405 for details.
+ if (module) {
+ typedef void *(*gtk_init_ptr)(int*, char***);
+ gtk_init_ptr gtkInit = (gtk_init_ptr)module->resolve("gtk_init");
+ if (gtkInit) {
+ // Prevent gtk_init() from replacing the X error handlers, since the Gtk
+ // handlers abort when they receive an X error, thus killing the viewer.
+#ifdef Q_WS_X11
+ int (*old_error_handler)(Display*, XErrorEvent*) = XSetErrorHandler(0);
+ int (*old_io_error_handler)(Display*) = XSetIOErrorHandler(0);
+#endif
+ gtkInit(0, 0);
+#ifdef Q_WS_X11
+ XSetErrorHandler(old_error_handler);
+ XSetIOErrorHandler(old_io_error_handler);
+#endif
+ return;
+ }
+ }
- // NOTE: We're using gdk_init_check() since gdk_init() may exit() on failure.
- (void) gdk_init_check(0, 0);
+ QLibrary library("libgtk-x11-2.0.so.0");
+ if (library.load()) {
+ typedef void *(*gtk_init_check_ptr)(int*, char***);
+ gtk_init_check_ptr gtkInitCheck = (gtk_init_check_ptr)library.resolve("gtk_init_check");
+ // NOTE: We're using gtk_init_check() since gtk_init() calls exit() on failure.
+ if (gtkInitCheck)
+ (void) gtkInitCheck(0, 0);
+ }
}
bool PluginPackage::load()
@@ -147,11 +158,15 @@ bool PluginPackage::load()
// nspluginwrapper relies on the toolkit value to know if glib is available
// It does so in NP_Initialize with a null instance, therefore it is done this way:
m_browserFuncs.getvalue = staticPluginQuirkRequiresGtkToolKit_NPN_GetValue;
+ // Workaround Adobe's failure to properly initialize Gtk in some versions
+ // of their flash player plugin.
+ initializeGtk();
+ } else if (m_path.contains("flashplayer")) {
+ // Workaround Adobe's failure to properly initialize Gtk in some versions
+ // of their flash player plugin.
+ initializeGtk(m_module);
}
- // Try to initialize GDK - some versions of the Flash plugin depend on this.
- initializeGdkIfPossible();
-
#if defined(XP_UNIX)
npErr = NP_Initialize(&m_browserFuncs, &m_pluginFuncs);
#else
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list