Title: [118949] trunk/Source/WebCore
Revision
118949
Author
[email protected]
Date
2012-05-30 12:08:22 -0700 (Wed, 30 May 2012)

Log Message

Check for GTK2/GTK3 symbol mismatch earlier
https://bugs.webkit.org/show_bug.cgi?id=87687

Patch by Daniel Drake <[email protected]> on 2012-05-30
Reviewed by Martin Robinson.

No new tests. Regressions in core behavior are covered by existing
plugin tests and the fix deals with particular aspects of the system
environment that are difficult to test.

Detect plugins that would mix GTK+ symbols earlier, so that the
WebKit can skip them and choose a more appropriate plugin module.

* plugins/gtk/PluginPackageGtk.cpp: Move this code from PluginViewGtk.
(WebCore::moduleMixesGtkSymbols):
(WebCore::PluginPackage::load):
* plugins/gtk/PluginViewGtk.cpp: Move this code to PluginPackageGtk.
(WebCore::PluginView::platformStart):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (118948 => 118949)


--- trunk/Source/WebCore/ChangeLog	2012-05-30 18:57:28 UTC (rev 118948)
+++ trunk/Source/WebCore/ChangeLog	2012-05-30 19:08:22 UTC (rev 118949)
@@ -1,3 +1,23 @@
+2012-05-30  Daniel Drake  <[email protected]>
+
+        Check for GTK2/GTK3 symbol mismatch earlier
+        https://bugs.webkit.org/show_bug.cgi?id=87687
+
+        Reviewed by Martin Robinson.
+
+        No new tests. Regressions in core behavior are covered by existing
+        plugin tests and the fix deals with particular aspects of the system
+        environment that are difficult to test.
+
+        Detect plugins that would mix GTK+ symbols earlier, so that the
+        WebKit can skip them and choose a more appropriate plugin module.
+
+        * plugins/gtk/PluginPackageGtk.cpp: Move this code from PluginViewGtk.
+        (WebCore::moduleMixesGtkSymbols):
+        (WebCore::PluginPackage::load):
+        * plugins/gtk/PluginViewGtk.cpp: Move this code to PluginPackageGtk.
+        (WebCore::PluginView::platformStart):
+
 2012-05-30  Allan Sandfeld Jensen  <[email protected]>
 
         [Qt] Support IMAGE_DECODER_DOWN_SAMPLING flag.

Modified: trunk/Source/WebCore/plugins/gtk/PluginPackageGtk.cpp (118948 => 118949)


--- trunk/Source/WebCore/plugins/gtk/PluginPackageGtk.cpp	2012-05-30 18:57:28 UTC (rev 118948)
+++ trunk/Source/WebCore/plugins/gtk/PluginPackageGtk.cpp	2012-05-30 19:08:22 UTC (rev 118949)
@@ -119,6 +119,16 @@
 }
 #endif
 
+static bool moduleMixesGtkSymbols(GModule* module)
+{
+    void* symbol;
+#ifdef GTK_API_VERSION_2
+    return g_module_symbol(module, "gtk_application_get_type", &symbol);
+#else
+    return g_module_symbol(module, "gtk_object_get_type", &symbol);
+#endif
+}
+
 bool PluginPackage::load()
 {
     if (m_isLoaded) {
@@ -150,6 +160,11 @@
         return false;
     }
 
+    if (moduleMixesGtkSymbols(m_module)) {
+        LOG(Plugins, "Ignoring module '%s' to avoid mixing GTK+ 2 and GTK+ 3 symbols.\n", m_path.utf8().data());
+        return false;
+    }
+
     m_isLoaded = true;
 
 #if defined(XP_UNIX)

Modified: trunk/Source/WebCore/plugins/gtk/PluginViewGtk.cpp (118948 => 118949)


--- trunk/Source/WebCore/plugins/gtk/PluginViewGtk.cpp	2012-05-30 18:57:28 UTC (rev 118948)
+++ trunk/Source/WebCore/plugins/gtk/PluginViewGtk.cpp	2012-05-30 19:08:22 UTC (rev 118949)
@@ -834,26 +834,11 @@
     view->updateWidgetAllocationAndClip();
 }
 
-static bool moduleMixesGtkSymbols(GModule* module)
-{
-    gpointer symbol;
-#ifdef GTK_API_VERSION_2
-    return g_module_symbol(module, "gtk_application_get_type", &symbol);
-#else
-    return g_module_symbol(module, "gtk_object_get_type", &symbol);
-#endif
-}
-
 bool PluginView::platformStart()
 {
     ASSERT(m_isStarted);
     ASSERT(m_status == PluginStatusLoadedSuccessfully);
 
-    if (moduleMixesGtkSymbols(m_plugin->module())) {
-        LOG(Plugins, "Module '%s' mixes GTK+ 2 and GTK+ 3 symbols, ignoring plugin.\n", m_plugin->path().utf8().data());
-        return false;
-    }
-
 #if defined(XP_UNIX)
     if (m_plugin->pluginFuncs()->getvalue) {
         PluginView::setCurrentPluginView(this);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to