Changeset 205485 in webkit


Ignore:
Timestamp:
Sep 6, 2016 9:28:03 AM (8 years ago)
Author:
Carlos Garcia Campos
Message:

[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):

Location:
trunk/Source/WebKit2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r205484 r205485  
     12016-09-06  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [GTK][Wayland] evince-browser-plugin prevents viewing PDFs
     4        https://bugs.webkit.org/show_bug.cgi?id=158697
     5
     6        Reviewed by Michael Catanzaro.
     7
     8        Use a different cache file for plugins depending on the current platform display. Plugins can claim to work on
     9        X11 but not on Wayland, for example, if they need XEmebed to work. That's the case of the evince browser plugin.
     10
     11        * UIProcess/Plugins/gtk/PluginInfoCache.cpp:
     12        (WebKit::cacheFilenameForCurrentDisplay):
     13        (WebKit::PluginInfoCache::PluginInfoCache):
     14
    1152016-09-06  Carlos Garcia Campos  <cgarcia@igalia.com>
    216
  • trunk/Source/WebKit2/UIProcess/Plugins/gtk/PluginInfoCache.cpp

    r202611 r205485  
    3131#include "NetscapePluginModule.h"
    3232#include <WebCore/FileSystem.h>
     33#include <WebCore/PlatformDisplay.h>
    3334#include <wtf/text/CString.h>
    3435
     
    4344}
    4445
     46static inline const char* cacheFilenameForCurrentDisplay()
     47{
     48#if PLATFORM(X11)
     49    if (WebCore::PlatformDisplay::sharedDisplay().type() == WebCore::PlatformDisplay::Type::X11)
     50        return "plugins-x11";
     51#endif
     52#if PLATFORM(WAYLAND)
     53    if (WebCore::PlatformDisplay::sharedDisplay().type() == WebCore::PlatformDisplay::Type::Wayland)
     54        return "plugins-wayland";
     55#endif
     56
     57    ASSERT_NOT_REACHED();
     58    return "plugins";
     59}
     60
    4561PluginInfoCache::PluginInfoCache()
    4662    : m_cacheFile(g_key_file_new())
     
    5268    GUniquePtr<char> cacheDirectory(g_build_filename(g_get_user_cache_dir(), "webkitgtk", nullptr));
    5369    if (WebCore::makeAllDirectories(cacheDirectory.get())) {
    54         m_cachePath.reset(g_build_filename(cacheDirectory.get(), "plugins", nullptr));
     70        // Delete old cache file.
     71        GUniquePtr<char> oldCachePath(g_build_filename(cacheDirectory.get(), "plugins", nullptr));
     72        WebCore::deleteFile(WebCore::filenameToString(oldCachePath.get()));
     73
     74        m_cachePath.reset(g_build_filename(cacheDirectory.get(), cacheFilenameForCurrentDisplay(), nullptr));
    5575        g_key_file_load_from_file(m_cacheFile.get(), m_cachePath.get(), G_KEY_FILE_NONE, nullptr);
    5676    }
Note: See TracChangeset for help on using the changeset viewer.