[GTK] Rename PLUGIN_ARCHITECTURE(X11) as PLUGIN_ARCHITECTURE(UNIX)
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Sep 2017 07:39:44 +0000 (07:39 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Sep 2017 07:39:44 +0000 (07:39 +0000)
https://bugs.webkit.org/show_bug.cgi?id=176330

Reviewed by Michael Catanzaro.

It's no longer X11 specific since it's also used in Wayland when the X11 target is enabled. It should be renamed
as UNIX and make it available when building the wayland target even if the X11 on is disabled.

* PlatformGTK.cmake:
* PlatformWPE.cmake:
* PluginProcess/unix/PluginProcessMainUnix.cpp:
* Shared/Plugins/Netscape/NetscapePluginModule.cpp:
(WebKit::NetscapePluginModule::tryLoad):
* Shared/Plugins/Netscape/NetscapePluginModule.h:
* Shared/Plugins/Netscape/unix/NetscapePluginModuleUnix.cpp: Renamed from Source/WebKit/Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp.
* UIProcess/Plugins/PluginProcessProxy.h:
* UIProcess/Plugins/gtk/PluginInfoCache.cpp:
(WebKit::PluginInfoCache::getPluginInfo):
(WebKit::PluginInfoCache::updatePluginInfo):
* UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:
(WebKit::PluginProcessProxy::scanPlugin):
* WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
(WebKit::NPN_InvalidateRect):
* WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
(WebKit::NetscapePlugin::initialize):
(WebKit::NetscapePlugin::destroy):
(WebKit::NetscapePlugin::geometryDidChange):
* WebProcess/Plugins/Netscape/NetscapePlugin.h:
* WebProcess/Plugins/Netscape/unix/NetscapePluginUnix.cpp:
* WebProcess/Plugins/Netscape/unix/NetscapePluginUnix.h:
* config.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@221610 268f45cc-cd09-0410-ab3c-d52691b4dbfc

16 files changed:
Source/WebKit/ChangeLog
Source/WebKit/PlatformGTK.cmake
Source/WebKit/PlatformWPE.cmake
Source/WebKit/PluginProcess/unix/PluginProcessMainUnix.cpp
Source/WebKit/Shared/Plugins/Netscape/NetscapePluginModule.cpp
Source/WebKit/Shared/Plugins/Netscape/NetscapePluginModule.h
Source/WebKit/Shared/Plugins/Netscape/unix/NetscapePluginModuleUnix.cpp [moved from Source/WebKit/Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp with 98% similarity]
Source/WebKit/UIProcess/Plugins/PluginProcessProxy.h
Source/WebKit/UIProcess/Plugins/gtk/PluginInfoCache.cpp
Source/WebKit/UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp
Source/WebKit/WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp
Source/WebKit/WebProcess/Plugins/Netscape/NetscapePlugin.cpp
Source/WebKit/WebProcess/Plugins/Netscape/NetscapePlugin.h
Source/WebKit/WebProcess/Plugins/Netscape/unix/NetscapePluginUnix.cpp
Source/WebKit/WebProcess/Plugins/Netscape/unix/NetscapePluginUnix.h
Source/WebKit/config.h

index dd0cf95..53e873d 100644 (file)
@@ -1,5 +1,39 @@
 2017-09-05  Carlos Garcia Campos  <cgarcia@igalia.com>
 
+        [GTK] Rename PLUGIN_ARCHITECTURE(X11) as PLUGIN_ARCHITECTURE(UNIX)
+        https://bugs.webkit.org/show_bug.cgi?id=176330
+
+        Reviewed by Michael Catanzaro.
+
+        It's no longer X11 specific since it's also used in Wayland when the X11 target is enabled. It should be renamed
+        as UNIX and make it available when building the wayland target even if the X11 on is disabled.
+
+        * PlatformGTK.cmake:
+        * PlatformWPE.cmake:
+        * PluginProcess/unix/PluginProcessMainUnix.cpp:
+        * Shared/Plugins/Netscape/NetscapePluginModule.cpp:
+        (WebKit::NetscapePluginModule::tryLoad):
+        * Shared/Plugins/Netscape/NetscapePluginModule.h:
+        * Shared/Plugins/Netscape/unix/NetscapePluginModuleUnix.cpp: Renamed from Source/WebKit/Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp.
+        * UIProcess/Plugins/PluginProcessProxy.h:
+        * UIProcess/Plugins/gtk/PluginInfoCache.cpp:
+        (WebKit::PluginInfoCache::getPluginInfo):
+        (WebKit::PluginInfoCache::updatePluginInfo):
+        * UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:
+        (WebKit::PluginProcessProxy::scanPlugin):
+        * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
+        (WebKit::NPN_InvalidateRect):
+        * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
+        (WebKit::NetscapePlugin::initialize):
+        (WebKit::NetscapePlugin::destroy):
+        (WebKit::NetscapePlugin::geometryDidChange):
+        * WebProcess/Plugins/Netscape/NetscapePlugin.h:
+        * WebProcess/Plugins/Netscape/unix/NetscapePluginUnix.cpp:
+        * WebProcess/Plugins/Netscape/unix/NetscapePluginUnix.h:
+        * config.h:
+
+2017-09-05  Carlos Garcia Campos  <cgarcia@igalia.com>
+
         [GTK] Wrong use of PLUGIN_ARCHITECTURE(X11) in several places
         https://bugs.webkit.org/show_bug.cgi?id=176329
 
index 3fb58c6..681a98c 100644 (file)
@@ -72,7 +72,7 @@ list(APPEND WebKit2_SOURCES
     Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.cpp
     Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp
 
-    Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp
+    Shared/Plugins/Netscape/unix/NetscapePluginModuleUnix.cpp
 
     Shared/Plugins/unix/PluginSearchPath.cpp
 
@@ -997,7 +997,7 @@ if (ENABLE_PLUGIN_PROCESS_GTK2)
         Shared/Plugins/Netscape/NetscapePluginModule.cpp
         Shared/Plugins/Netscape/NetscapePluginModuleNone.cpp
 
-        Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp
+        Shared/Plugins/Netscape/unix/NetscapePluginModuleUnix.cpp
 
         Shared/cairo/ShareableBitmapCairo.cpp
 
index 211dd40..2586489 100644 (file)
@@ -99,7 +99,7 @@ list(APPEND WebKit2_SOURCES
     Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp
     Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.cpp
 
-    Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp
+    Shared/Plugins/Netscape/unix/NetscapePluginModuleUnix.cpp
 
     Shared/cairo/ShareableBitmapCairo.cpp
 
index e0ec73b..ddd40d3 100644 (file)
@@ -70,7 +70,7 @@ public:
             return false;
 
         if (!strcmp(argv[1], "-scanPlugin"))
-#if PLUGIN_ARCHITECTURE(X11)
+#if PLUGIN_ARCHITECTURE(UNIX)
             exit(NetscapePluginModule::scanPlugin(argv[2]) ? EXIT_SUCCESS : EXIT_FAILURE);
 #else
             exit(EXIT_FAILURE);
index d4dda2a..60f41eb 100644 (file)
@@ -223,7 +223,7 @@ bool NetscapePluginModule::tryLoad()
     if (!initializeFuncPtr)
         return false;
 
-#if !PLUGIN_ARCHITECTURE(X11)
+#if !PLUGIN_ARCHITECTURE(UNIX)
     NP_GetEntryPointsFuncPtr getEntryPointsFuncPtr = m_module->functionPointer<NP_GetEntryPointsFuncPtr>("NP_GetEntryPoints");
     if (!getEntryPointsFuncPtr)
         return false;
@@ -263,7 +263,7 @@ bool NetscapePluginModule::tryLoad()
 #endif
 
     return result;
-#elif PLUGIN_ARCHITECTURE(X11)
+#elif PLUGIN_ARCHITECTURE(UNIX)
     if (initializeFuncPtr(netscapeBrowserFuncs(), &m_pluginFuncs) != NPERR_NO_ERROR)
         return false;
 #endif
index 1d7a557..b82ada1 100644 (file)
@@ -65,7 +65,7 @@ public:
 
     Module* module() const { return m_module.get(); }
 
-#if PLUGIN_ARCHITECTURE(X11)
+#if PLUGIN_ARCHITECTURE(UNIX)
     static bool scanPlugin(const String& pluginPath);
     static void parseMIMEDescription(const String& mimeDescription, Vector<WebCore::MimeClassInfo>& result);
     static String buildMIMEDescription(const Vector<WebCore::MimeClassInfo>&);
@@ -76,7 +76,7 @@ private:
 
     void determineQuirks();
 
-#if PLUGIN_ARCHITECTURE(X11)
+#if PLUGIN_ARCHITECTURE(UNIX)
     bool getPluginInfoForLoadedPlugin(RawPluginMetaData&);
 #endif
 
  */
 
 #include "config.h"
-#if PLUGIN_ARCHITECTURE(X11) && ENABLE(NETSCAPE_PLUGIN_API)
-
 #include "NetscapePluginModule.h"
 
-#include "PluginProcessProxy.h"
+#if PLUGIN_ARCHITECTURE(UNIX) && ENABLE(NETSCAPE_PLUGIN_API)
+
 #include "NetscapeBrowserFuncs.h"
+#include "PluginProcessProxy.h"
 #include <WebCore/FileSystem.h>
 #include <errno.h>
 #include <fcntl.h>
@@ -249,4 +249,4 @@ bool NetscapePluginModule::scanPlugin(const String& pluginPath)
 
 } // namespace WebKit
 
-#endif // PLUGIN_ARCHITECTURE(X11) && ENABLE(NETSCAPE_PLUGIN_API)
+#endif // PLUGIN_ARCHITECTURE(UNIX) && ENABLE(NETSCAPE_PLUGIN_API)
index 01a52e3..8f5a1d1 100644 (file)
@@ -49,7 +49,7 @@ class PluginProcessManager;
 class WebProcessProxy;
 struct PluginProcessCreationParameters;
 
-#if PLUGIN_ARCHITECTURE(X11)
+#if PLUGIN_ARCHITECTURE(UNIX)
 struct RawPluginMetaData {
     String name;
     String description;
@@ -89,7 +89,7 @@ public:
 
 #endif
 
-#if PLUGIN_ARCHITECTURE(X11)
+#if PLUGIN_ARCHITECTURE(UNIX)
     static bool scanPlugin(const String& pluginPath, RawPluginMetaData& result);
 #endif
 
index d5fb1b2..1bd6507 100644 (file)
@@ -128,7 +128,7 @@ 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)
+#if PLUGIN_ARCHITECTURE(UNIX)
     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
@@ -149,7 +149,7 @@ 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)
+#if PLUGIN_ARCHITECTURE(UNIX)
     String mimeDescription = NetscapePluginModule::buildMIMEDescription(plugin.info.mimes);
     g_key_file_set_string(m_cacheFile.get(), pluginGroup.data(), "mime-description", mimeDescription.utf8().data());
 #endif
index 7601f43..276692b 100644 (file)
@@ -76,17 +76,18 @@ static bool pluginRequiresGtk2(const String& pluginPath)
 }
 #endif
 
-#if PLUGIN_ARCHITECTURE(X11)
+#if PLUGIN_ARCHITECTURE(UNIX)
 bool PluginProcessProxy::scanPlugin(const String& pluginPath, RawPluginMetaData& result)
 {
-#if PLATFORM(GTK)
     String pluginProcessPath = executablePathOfPluginProcess();
 
 #if PLATFORM(GTK)
     bool requiresGtk2 = pluginRequiresGtk2(pluginPath);
     if (requiresGtk2) {
-        if (PlatformDisplay::sharedDisplay().type() != PlatformDisplay::Type::X11)
+#if PLATFORM(WAYLAND)
+        if (PlatformDisplay::sharedDisplay().type() == PlatformDisplay::Type::Wayland)
             return false;
+#endif
 #if ENABLE(PLUGIN_PROCESS_GTK2)
         pluginProcessPath.append('2');
         if (!fileExists(pluginProcessPath))
@@ -152,11 +153,8 @@ bool PluginProcessProxy::scanPlugin(const String& pluginPath, RawPluginMetaData&
     result.requiresGtk2 = requiresGtk2;
 #endif
     return !result.mimeDescription.isEmpty();
-#else // PLATFORM(GTK)
-    return false;
-#endif // PLATFORM(GTK)
 }
-#endif // PLUGIN_ARCHITECTURE(X11)
+#endif // PLUGIN_ARCHITECTURE(UNIX)
 
 } // namespace WebKit
 
index 06f9d36..6a4dab0 100644 (file)
@@ -586,7 +586,7 @@ static NPError NPN_SetValue(NPP npp, NPPVariable variable, void *value)
 
 static void NPN_InvalidateRect(NPP npp, NPRect* invalidRect)
 {
-#if PLUGIN_ARCHITECTURE(X11)
+#if PLUGIN_ARCHITECTURE(UNIX)
     // NSPluginWrapper, a plugin wrapper binary that allows running 32-bit plugins
     // on 64-bit architectures typically used in X11, will sometimes give us a null NPP here.
     if (!npp)
index 270d5c1..ba3ff45 100644 (file)
@@ -42,7 +42,7 @@
 #include <utility>
 #include <wtf/text/CString.h>
 
-#if PLUGIN_ARCHITECTURE(X11)
+#if PLUGIN_ARCHITECTURE(UNIX)
 #include "NetscapePluginUnix.h"
 #endif
 
@@ -656,11 +656,13 @@ bool NetscapePlugin::initialize(const Parameters& parameters)
             paramNames.append("wmode");
             paramValues.append("opaque");
         }
-    } else if (equalLettersIgnoringASCIICase(parameters.mimeType, "application/x-webkit-test-netscape")) {
+    }
+#endif
+
+    if (equalLettersIgnoringASCIICase(parameters.mimeType, "application/x-webkit-test-netscape")) {
         paramNames.append("windowedPlugin");
         paramValues.append("false");
     }
-#endif
 
     // The strings that these pointers point to are kept alive by paramNames and paramValues.
     Vector<const char*> names;
@@ -723,7 +725,7 @@ void NetscapePlugin::destroy()
     // Stop all streams.
     stopAllStreams();
 
-#if !PLUGIN_ARCHITECTURE(MAC) && !PLUGIN_ARCHITECTURE(X11)
+#if !PLUGIN_ARCHITECTURE(MAC) && !PLUGIN_ARCHITECTURE(UNIX)
     m_npWindow.window = 0;
     callSetWindow();
 #endif
@@ -795,7 +797,7 @@ void NetscapePlugin::geometryDidChange(const IntSize& pluginSize, const IntRect&
     m_clipRect = clipRect;
     m_pluginToRootViewTransform = pluginToRootViewTransform;
 
-#if PLUGIN_ARCHITECTURE(X11)
+#if PLUGIN_ARCHITECTURE(UNIX)
     IntPoint frameRectLocationInWindowCoordinates = m_pluginToRootViewTransform.mapPoint(IntPoint());
     m_frameRectInWindowCoordinates = IntRect(frameRectLocationInWindowCoordinates, m_pluginSize);
 #endif
index 07c8b08..6004cc1 100644 (file)
@@ -87,7 +87,7 @@ public:
 
 #endif
 
-#if PLUGIN_ARCHITECTURE(X11)
+#if PLUGIN_ARCHITECTURE(UNIX)
     const WebCore::IntRect& frameRectInWindowCoordinates() const { return m_frameRectInWindowCoordinates; }
 #endif
     const WebCore::IntRect& clipRect() const { return m_clipRect; }
@@ -298,7 +298,7 @@ private:
     // A transform that can be used to convert from root view coordinates to plug-in coordinates.
     WebCore::AffineTransform m_pluginToRootViewTransform;
 
-#if PLUGIN_ARCHITECTURE(X11)
+#if PLUGIN_ARCHITECTURE(UNIX)
     WebCore::IntRect m_frameRectInWindowCoordinates;
 #endif
 
@@ -386,7 +386,7 @@ private:
     RunLoop::Timer<NetscapePlugin> m_nullEventTimer;
     NP_CGContext m_npCGContext;
 #endif
-#elif PLUGIN_ARCHITECTURE(X11)
+#elif PLUGIN_ARCHITECTURE(UNIX)
     std::unique_ptr<NetscapePluginUnix> m_impl;
 #endif
 };
index 60a38e4..7648760 100644 (file)
@@ -26,7 +26,7 @@
 #include "config.h"
 #include "NetscapePluginUnix.h"
 
-#if PLUGIN_ARCHITECTURE(X11) && ENABLE(NETSCAPE_PLUGIN_API)
+#if PLUGIN_ARCHITECTURE(UNIX) && ENABLE(NETSCAPE_PLUGIN_API)
 
 #include "NetscapePlugin.h"
 #include "WebEvent.h"
@@ -170,4 +170,4 @@ bool NetscapePlugin::platformHandleKeyboardEvent(const WebKeyboardEvent& event)
 
 } // namespace WebKit
 
-#endif // PLUGIN_ARCHITECTURE(X11) && ENABLE(NETSCAPE_PLUGIN_API)
+#endif // PLUGIN_ARCHITECTURE(UNIX) && ENABLE(NETSCAPE_PLUGIN_API)
index efa6cd0..c641c75 100644 (file)
@@ -26,7 +26,7 @@
 #ifndef NetscapePluginUnix_h
 #define NetscapePluginUnix_h
 
-#if PLUGIN_ARCHITECTURE(X11) && ENABLE(NETSCAPE_PLUGIN_API)
+#if PLUGIN_ARCHITECTURE(UNIX) && ENABLE(NETSCAPE_PLUGIN_API)
 
 #include <WebCore/npruntime_internal.h>
 
@@ -60,6 +60,6 @@ public:
 
 } // namespace WebKit
 
-#endif // PLUGIN_ARCHITECTURE(X11) && ENABLE(NETSCAPE_PLUGIN_API)
+#endif // PLUGIN_ARCHITECTURE(UNIX) && ENABLE(NETSCAPE_PLUGIN_API)
 
 #endif // NetscapePluginUnix_h
index 760635b..e867f48 100644 (file)
@@ -46,8 +46,8 @@
 #ifndef PLUGIN_ARCHITECTURE_UNSUPPORTED
 #if PLATFORM(MAC)
 #define PLUGIN_ARCHITECTURE_MAC 1
-#elif PLATFORM(GTK) && PLATFORM(X11) && OS(UNIX) && !OS(MAC_OS_X)
-#define PLUGIN_ARCHITECTURE_X11 1
+#elif PLATFORM(GTK) && OS(UNIX) && !OS(MAC_OS_X)
+#define PLUGIN_ARCHITECTURE_UNIX 1
 #else
 #define PLUGIN_ARCHITECTURE_UNSUPPORTED 1
 #endif