Title: [205723] releases/WebKitGTK/webkit-2.14/Source/WebKit2
Revision
205723
Author
[email protected]
Date
2016-09-09 02:26:15 -0700 (Fri, 09 Sep 2016)

Log Message

Merge r205485 - [GTK][Wayland] evince-browser-plugin prevents viewing PDFs
https://bugs.webkit.org/show_bug.cgi?id=158697

Reviewed by Michael Catanzaro.

Use a different cache file for plugins depending on the current platform display. Plugins can claim to work on
X11 but not on Wayland, for example, if they need XEmebed to work. That's the case of the evince browser plugin.

* UIProcess/Plugins/gtk/PluginInfoCache.cpp:
(WebKit::cacheFilenameForCurrentDisplay):
(WebKit::PluginInfoCache::PluginInfoCache):

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.14/Source/WebKit2/ChangeLog (205722 => 205723)


--- releases/WebKitGTK/webkit-2.14/Source/WebKit2/ChangeLog	2016-09-09 09:24:51 UTC (rev 205722)
+++ releases/WebKitGTK/webkit-2.14/Source/WebKit2/ChangeLog	2016-09-09 09:26:15 UTC (rev 205723)
@@ -1,5 +1,19 @@
 2016-09-06  Carlos Garcia Campos  <[email protected]>
 
+        [GTK][Wayland] evince-browser-plugin prevents viewing PDFs
+        https://bugs.webkit.org/show_bug.cgi?id=158697
+
+        Reviewed by Michael Catanzaro.
+
+        Use a different cache file for plugins depending on the current platform display. Plugins can claim to work on
+        X11 but not on Wayland, for example, if they need XEmebed to work. That's the case of the evince browser plugin.
+
+        * UIProcess/Plugins/gtk/PluginInfoCache.cpp:
+        (WebKit::cacheFilenameForCurrentDisplay):
+        (WebKit::PluginInfoCache::PluginInfoCache):
+
+2016-09-06  Carlos Garcia Campos  <[email protected]>
+
         [Threaded Compositor] Update timer should have lower priority than tasks scheduled in compositing thread
         https://bugs.webkit.org/show_bug.cgi?id=161625
 

Modified: releases/WebKitGTK/webkit-2.14/Source/WebKit2/UIProcess/Plugins/gtk/PluginInfoCache.cpp (205722 => 205723)


--- releases/WebKitGTK/webkit-2.14/Source/WebKit2/UIProcess/Plugins/gtk/PluginInfoCache.cpp	2016-09-09 09:24:51 UTC (rev 205722)
+++ releases/WebKitGTK/webkit-2.14/Source/WebKit2/UIProcess/Plugins/gtk/PluginInfoCache.cpp	2016-09-09 09:26:15 UTC (rev 205723)
@@ -30,6 +30,7 @@
 
 #include "NetscapePluginModule.h"
 #include <WebCore/FileSystem.h>
+#include <WebCore/PlatformDisplay.h>
 #include <wtf/text/CString.h>
 
 namespace WebKit {
@@ -42,6 +43,21 @@
     return pluginInfoCache;
 }
 
+static inline const char* cacheFilenameForCurrentDisplay()
+{
+#if PLATFORM(X11)
+    if (WebCore::PlatformDisplay::sharedDisplay().type() == WebCore::PlatformDisplay::Type::X11)
+        return "plugins-x11";
+#endif
+#if PLATFORM(WAYLAND)
+    if (WebCore::PlatformDisplay::sharedDisplay().type() == WebCore::PlatformDisplay::Type::Wayland)
+        return "plugins-wayland";
+#endif
+
+    ASSERT_NOT_REACHED();
+    return "plugins";
+}
+
 PluginInfoCache::PluginInfoCache()
     : m_cacheFile(g_key_file_new())
     , m_saveToFileIdle(RunLoop::main(), this, &PluginInfoCache::saveToFile)
@@ -51,7 +67,11 @@
 
     GUniquePtr<char> cacheDirectory(g_build_filename(g_get_user_cache_dir(), "webkitgtk", nullptr));
     if (WebCore::makeAllDirectories(cacheDirectory.get())) {
-        m_cachePath.reset(g_build_filename(cacheDirectory.get(), "plugins", nullptr));
+        // Delete old cache file.
+        GUniquePtr<char> oldCachePath(g_build_filename(cacheDirectory.get(), "plugins", nullptr));
+        WebCore::deleteFile(WebCore::filenameToString(oldCachePath.get()));
+
+        m_cachePath.reset(g_build_filename(cacheDirectory.get(), cacheFilenameForCurrentDisplay(), nullptr));
         g_key_file_load_from_file(m_cacheFile.get(), m_cachePath.get(), G_KEY_FILE_NONE, nullptr);
     }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to