Bug 62200

Summary: [GTK] Move moduleMixesGtkSymbols() from PluginPackage to PluginView
Product: WebKit Reporter: Carlos Garcia Campos <cgarcia>
Component: WebKitGTKAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: gustavo, mrobinson
Priority: P2 Keywords: Gtk
Version: 528+ (Nightly build)   
Hardware: PC   
OS: Linux   
Bug Depends on:    
Bug Blocks: 60546    
Attachments:
Description Flags
Patch
none
Updated patch to apply to curent git master mrobinson: review+

Carlos Garcia Campos
Reported 2011-06-07 03:01:01 PDT
In WebKit2, PluginPackage is used by the UI process to load the plugin in order to get the plugin information, but it doesn't do any rendering, so it's safe to mix gtk+ symbols in this case because gtk is not used at all.
Attachments
Patch (7.58 KB, patch)
2011-06-07 03:09 PDT, Carlos Garcia Campos
no flags
Updated patch to apply to curent git master (7.44 KB, patch)
2011-06-07 03:28 PDT, Carlos Garcia Campos
mrobinson: review+
Carlos Garcia Campos
Comment 1 2011-06-07 03:09:15 PDT
Created attachment 96224 [details] Patch Gustavo, I changed my mind about making moduleMixesGtkSymbols() public, because the implementation is not exactly the same for wk1 and wk2, so I added PluginPackage::module() instead.
Carlos Garcia Campos
Comment 2 2011-06-07 03:14:38 PDT
Comment on attachment 96224 [details] Patch Removing flags, sorry, I made the patch from uncommitted changes.
Carlos Garcia Campos
Comment 3 2011-06-07 03:28:45 PDT
Created attachment 96225 [details] Updated patch to apply to curent git master
Martin Robinson
Comment 4 2011-06-07 08:49:18 PDT
Comment on attachment 96225 [details] Updated patch to apply to curent git master View in context: https://bugs.webkit.org/attachment.cgi?id=96225&action=review The bits in WebKit2 look good, but it seems we don't really need to move any WebKit1 code around for this change. Do you mind undoing that bit of the patch? > Source/WebCore/plugins/gtk/PluginPackageGtk.cpp:-169 > - if (moduleMixesGtkSymbols(m_module)) { > - LOG(Plugins, "Module '%s' mixes GTK+ 2 and GTK+ 3 symbols, ignoring plugin.\n", m_path.utf8().data()); > - g_module_close(m_module); > - return false; > - } > - I think it still makes sense to do this check here instead of creating a dead plugin. Why not just make the moduleMixesGtkSymbols a static method on PluginView and call it here? > Source/WebCore/plugins/gtk/PluginViewGtk.cpp:813 > + gpointer symbol; It's probably better to use void* here. > Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:138 > + return module->functionPointer<gpointer>("gtk_application_get_type"); Again probably better to use void* here directly.
Carlos Garcia Campos
Comment 5 2011-06-07 09:07:33 PDT
(In reply to comment #4) > (From update of attachment 96225 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=96225&action=review > > The bits in WebKit2 look good, but it seems we don't really need to move any WebKit1 code around for this change. Do you mind undoing that bit of the patch? We need to be able to load the plugin even if it mixes gtk symbols in webkit2. To load the plugin and get the info the ui process uses PluginPackage. The problem of mixing symbols is in the view, that uses gtk. If we leave the check in PlugionPackage the ui process won't be able to load the plugin and the plugin process will never be launched. > > Source/WebCore/plugins/gtk/PluginPackageGtk.cpp:-169 > > - if (moduleMixesGtkSymbols(m_module)) { > > - LOG(Plugins, "Module '%s' mixes GTK+ 2 and GTK+ 3 symbols, ignoring plugin.\n", m_path.utf8().data()); > > - g_module_close(m_module); > > - return false; > > - } > > - > > I think it still makes sense to do this check here instead of creating a dead plugin. Why not just make the moduleMixesGtkSymbols a static method on PluginView and call it here? Because the implementations are not exactly the same, in webkit2 we don't have access to the platform module, but we have a method in Module to get a symbol from the module. > > Source/WebCore/plugins/gtk/PluginViewGtk.cpp:813 > > + gpointer symbol; > > It's probably better to use void* here. That's existing code, not mine, I'll change it anyway, gpointer is indeed void * > > Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:138 > > + return module->functionPointer<gpointer>("gtk_application_get_type"); > > Again probably better to use void* here directly. Ok.
Martin Robinson
Comment 6 2011-06-07 09:19:57 PDT
(In reply to comment #5) > (In reply to comment #4) > > (From update of attachment 96225 [details] [details]) > > View in context: https://bugs.webkit.org/attachment.cgi?id=96225&action=review > > > > The bits in WebKit2 look good, but it seems we don't really need to move any WebKit1 code around for this change. Do you mind undoing that bit of the patch? > > We need to be able to load the plugin even if it mixes gtk symbols in webkit2. To load the plugin and get the info the ui process uses PluginPackage. The problem of mixing symbols is in the view, that uses gtk. If we leave the check in PlugionPackage the ui process won't be able to load the plugin and the plugin process will never be launched. Okay. Do you mind expanding the ChangeLog to mention that PluginPackage::load is used by both WebKit1 and WebKit2, so this necessitates moving the check?
Martin Robinson
Comment 7 2011-06-07 09:20:15 PDT
Comment on attachment 96225 [details] Updated patch to apply to curent git master r=me with the aforementioned changes!
Carlos Garcia Campos
Comment 8 2011-06-07 09:25:06 PDT
(In reply to comment #6) > Okay. Do you mind expanding the ChangeLog to mention that PluginPackage::load is used by both WebKit1 and WebKit2, so this necessitates moving the check? Sure, thanks for reviewing!
Carlos Garcia Campos
Comment 9 2011-06-07 09:35:23 PDT
Note You need to log in before you can comment on or make changes to this bug.