Changeset 212891 in webkit


Ignore:
Timestamp:
Feb 23, 2017 8:47:04 AM (7 years ago)
Author:
Carlos Garcia Campos
Message:

[GTK] Crash attempting to load Flash plugin in Wayland
https://bugs.webkit.org/show_bug.cgi?id=163159

Reviewed by Michael Catanzaro.

The problem is that we check if the current diplay is X11 or Wayland also in the plugin process, but with GTK2
plugins the display is always X11. We should early reject plugins requiring GTK2 in the UI process when the
current display is Wayland.

  • UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp:

(WebKit::PluginInfoStore::getPluginInfo):

  • UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:

(WebKit::PluginProcessProxy::scanPlugin):

  • UIProcess/gtk/WebPageProxyGtk.cpp:

(WebKit::WebPageProxy::createPluginContainer): Add an assert to ensure this message is never received on a
non-X11 display.

  • WebProcess/Plugins/PluginView.cpp:

(WebKit::PluginView::createPluginContainer): Never send CreatePluginContainer message to the UI process if the
display is not X11.

Location:
trunk/Source/WebKit2
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r212883 r212891  
     12017-02-23  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [GTK] Crash attempting to load Flash plugin in Wayland
     4        https://bugs.webkit.org/show_bug.cgi?id=163159
     5
     6        Reviewed by Michael Catanzaro.
     7
     8        The problem is that we check if the current diplay is X11 or Wayland also in the plugin process, but with GTK2
     9        plugins the display is always X11. We should early reject plugins requiring GTK2 in the UI process when the
     10        current display is Wayland.
     11
     12        * UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp:
     13        (WebKit::PluginInfoStore::getPluginInfo):
     14        * UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:
     15        (WebKit::PluginProcessProxy::scanPlugin):
     16        * UIProcess/gtk/WebPageProxyGtk.cpp:
     17        (WebKit::WebPageProxy::createPluginContainer): Add an assert to ensure this message is never received on a
     18        non-X11 display.
     19        * WebProcess/Plugins/PluginView.cpp:
     20        (WebKit::PluginView::createPluginContainer): Never send CreatePluginContainer message to the UI process if the
     21        display is not X11.
     22
    1232017-02-23  Eric Carlson  <eric.carlson@apple.com>
    224
  • trunk/Source/WebKit2/UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp

    r208273 r212891  
    3636#include "ProcessExecutablePath.h"
    3737#include <WebCore/FileSystem.h>
     38#include <WebCore/PlatformDisplay.h>
    3839#include <limits.h>
    3940#include <stdlib.h>
     
    7677#if ENABLE(PLUGIN_PROCESS_GTK2)
    7778        if (plugin.requiresGtk2) {
     79            if (PlatformDisplay::sharedDisplay().type() != PlatformDisplay::Type::X11)
     80                return false;
    7881            String pluginProcessPath = executablePathOfPluginProcess();
    7982            pluginProcessPath.append('2');
  • trunk/Source/WebKit2/UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp

    r212557 r212891  
    3434#include "ProcessExecutablePath.h"
    3535#include <WebCore/FileSystem.h>
     36#include <WebCore/PlatformDisplay.h>
    3637#include <sys/wait.h>
    3738#include <wtf/text/CString.h>
     
    8586    bool requiresGtk2 = pluginRequiresGtk2(pluginPath);
    8687    if (requiresGtk2) {
     88        if (PlatformDisplay::sharedDisplay().type() != PlatformDisplay::Type::X11)
     89            return false;
    8790#if ENABLE(PLUGIN_PROCESS_GTK2)
    8891        pluginProcessPath.append('2');
  • trunk/Source/WebKit2/UIProcess/gtk/WebPageProxyGtk.cpp

    r207406 r212891  
    3535#include "WebProcessProxy.h"
    3636#include "WebsiteDataStore.h"
     37#include <WebCore/PlatformDisplay.h>
    3738#include <WebCore/UserAgent.h>
    3839#include <gtk/gtkx.h>
     
    103104void WebPageProxy::createPluginContainer(uint64_t& windowID)
    104105{
     106    RELEASE_ASSERT(WebCore::PlatformDisplay::sharedDisplay().type() == WebCore::PlatformDisplay::Type::X11);
    105107    GtkWidget* socket = gtk_socket_new();
    106108    g_signal_connect(socket, "plug-removed", G_CALLBACK(pluginContainerPlugRemoved), 0);
  • trunk/Source/WebKit2/WebProcess/Plugins/PluginView.cpp

    r211946 r212891  
    7373#include <wtf/text/StringBuilder.h>
    7474
     75#if PLUGIN_ARCHITECTURE(X11)
     76#include <WebCore/PlatformDisplay.h>
     77#endif
     78
    7579using namespace JSC;
    7680using namespace WebCore;
     
    16781682{
    16791683    uint64_t windowID = 0;
    1680     m_webPage->sendSync(Messages::WebPageProxy::CreatePluginContainer(), Messages::WebPageProxy::CreatePluginContainer::Reply(windowID));
     1684    if (PlatformDisplay::sharedDisplay().type() == PlatformDisplay::Type::X11)
     1685        m_webPage->sendSync(Messages::WebPageProxy::CreatePluginContainer(), Messages::WebPageProxy::CreatePluginContainer::Reply(windowID));
    16811686    return windowID;
    16821687}
Note: See TracChangeset for help on using the changeset viewer.