Skip to content

Commit

Permalink
Merge r166158 - [GTK][WK2] Guard NetscapePluginModule methods used in…
Browse files Browse the repository at this point in the history
… PluginInfoCache that are specific to X11 architecture

https://bugs.webkit.org/show_bug.cgi?id=130663

Reviewed by Carlos Garcia Campos.

The two used methods are specific to the X11 plugin architecture and are not declared when building for a
Wayland-only configuration. Guarding them prevents build failures, but does not ensure proper functionality
which isn't a problem anyway since there's no support yet for Netscape plugins on Wayland.

* UIProcess/Plugins/gtk/PluginInfoCache.cpp:
(WebKit::PluginInfoCache::getPluginInfo): Guard NetscapePluginModule::parseMIMEDescription with PLUGIN_ARCHITECTURE(X11).
(WebKit::PluginInfoCache::updatePluginInfo): Ditto for NetscapePluginModule::buildMIMEDescription.
  • Loading branch information
zdobersek authored and carlosgcampos committed Mar 24, 2014
1 parent 6d17695 commit b176cc9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Source/WebKit2/ChangeLog
@@ -1,3 +1,18 @@
2014-03-24 Zan Dobersek <zdobersek@igalia.com>

[GTK][WK2] Guard NetscapePluginModule methods used in PluginInfoCache that are specific to X11 architecture
https://bugs.webkit.org/show_bug.cgi?id=130663

Reviewed by Carlos Garcia Campos.

The two used methods are specific to the X11 plugin architecture and are not declared when building for a
Wayland-only configuration. Guarding them prevents build failures, but does not ensure proper functionality
which isn't a problem anyway since there's no support yet for Netscape plugins on Wayland.

* UIProcess/Plugins/gtk/PluginInfoCache.cpp:
(WebKit::PluginInfoCache::getPluginInfo): Guard NetscapePluginModule::parseMIMEDescription with PLUGIN_ARCHITECTURE(X11).
(WebKit::PluginInfoCache::updatePluginInfo): Ditto for NetscapePluginModule::buildMIMEDescription.

2014-03-18 Carlos Garcia Campos <cgarcia@igalia.com>

[GTK] Race condition when the socket event source is cancelled
Expand Down
4 changes: 4 additions & 0 deletions Source/WebKit2/UIProcess/Plugins/gtk/PluginInfoCache.cpp
Expand Up @@ -110,8 +110,10 @@ bool PluginInfoCache::getPluginInfo(const String& pluginPath, PluginModuleInfo&
stringValue.reset(g_key_file_get_string(m_cacheFile.get(), pluginGroup.data(), "description", nullptr));
plugin.info.desc = String::fromUTF8(stringValue.get());

#if PLUGIN_ARCHITECTURE(X11)
stringValue.reset(g_key_file_get_string(m_cacheFile.get(), pluginGroup.data(), "mime-description", nullptr));
NetscapePluginModule::parseMIMEDescription(String::fromUTF8(stringValue.get()), plugin.info.mimes);
#endif

return true;
}
Expand All @@ -127,8 +129,10 @@ void PluginInfoCache::updatePluginInfo(const String& pluginPath, const PluginMod
g_key_file_set_string(m_cacheFile.get(), pluginGroup.data(), "name", plugin.info.name.utf8().data());
g_key_file_set_string(m_cacheFile.get(), pluginGroup.data(), "description", plugin.info.desc.utf8().data());

#if PLUGIN_ARCHITECTURE(X11)
String mimeDescription = NetscapePluginModule::buildMIMEDescription(plugin.info.mimes);
g_key_file_set_string(m_cacheFile.get(), pluginGroup.data(), "mime-description", mimeDescription.utf8().data());
#endif

// Save the cache file in an idle to make sure it happens in the main thread and
// it's done only once when this is called multiple times in a very short time.
Expand Down

0 comments on commit b176cc9

Please sign in to comment.