Changeset 118949 in webkit


Ignore:
Timestamp:
May 30, 2012 12:08:22 PM (12 years ago)
Author:
Martin Robinson
Message:

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

Patch by Daniel Drake <dsd@laptop.org> 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):

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r118947 r118949  
     12012-05-30  Daniel Drake  <dsd@laptop.org>
     2
     3        Check for GTK2/GTK3 symbol mismatch earlier
     4        https://bugs.webkit.org/show_bug.cgi?id=87687
     5
     6        Reviewed by Martin Robinson.
     7
     8        No new tests. Regressions in core behavior are covered by existing
     9        plugin tests and the fix deals with particular aspects of the system
     10        environment that are difficult to test.
     11
     12        Detect plugins that would mix GTK+ symbols earlier, so that the
     13        WebKit can skip them and choose a more appropriate plugin module.
     14
     15        * plugins/gtk/PluginPackageGtk.cpp: Move this code from PluginViewGtk.
     16        (WebCore::moduleMixesGtkSymbols):
     17        (WebCore::PluginPackage::load):
     18        * plugins/gtk/PluginViewGtk.cpp: Move this code to PluginPackageGtk.
     19        (WebCore::PluginView::platformStart):
     20
    1212012-05-30  Allan Sandfeld Jensen  <allan.jensen@nokia.com>
    222
  • trunk/Source/WebCore/plugins/gtk/PluginPackageGtk.cpp

    r108281 r118949  
    120120#endif
    121121
     122static bool moduleMixesGtkSymbols(GModule* module)
     123{
     124    void* symbol;
     125#ifdef GTK_API_VERSION_2
     126    return g_module_symbol(module, "gtk_application_get_type", &symbol);
     127#else
     128    return g_module_symbol(module, "gtk_object_get_type", &symbol);
     129#endif
     130}
     131
    122132bool PluginPackage::load()
    123133{
     
    151161    }
    152162
     163    if (moduleMixesGtkSymbols(m_module)) {
     164        LOG(Plugins, "Ignoring module '%s' to avoid mixing GTK+ 2 and GTK+ 3 symbols.\n", m_path.utf8().data());
     165        return false;
     166    }
     167
    153168    m_isLoaded = true;
    154169
  • trunk/Source/WebCore/plugins/gtk/PluginViewGtk.cpp

    r113990 r118949  
    835835}
    836836
    837 static bool moduleMixesGtkSymbols(GModule* module)
    838 {
    839     gpointer symbol;
    840 #ifdef GTK_API_VERSION_2
    841     return g_module_symbol(module, "gtk_application_get_type", &symbol);
    842 #else
    843     return g_module_symbol(module, "gtk_object_get_type", &symbol);
    844 #endif
    845 }
    846 
    847837bool PluginView::platformStart()
    848838{
    849839    ASSERT(m_isStarted);
    850840    ASSERT(m_status == PluginStatusLoadedSuccessfully);
    851 
    852     if (moduleMixesGtkSymbols(m_plugin->module())) {
    853         LOG(Plugins, "Module '%s' mixes GTK+ 2 and GTK+ 3 symbols, ignoring plugin.\n", m_plugin->path().utf8().data());
    854         return false;
    855     }
    856841
    857842#if defined(XP_UNIX)
Note: See TracChangeset for help on using the changeset viewer.