[WK2][GTK][EFL] Share WebKit2-GTK plugin process implementation with EFL port
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 29 Sep 2012 06:31:08 +0000 (06:31 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 29 Sep 2012 06:31:08 +0000 (06:31 +0000)
https://bugs.webkit.org/show_bug.cgi?id=91844

Patch by Mariusz Grzegorczyk <mariusz.g@samsung.com> on 2012-09-28
Reviewed by Simon Hausmann.

.:

Turn on Netscape Plugin API by default  for WebKit2-Efl.

* Source/cmake/OptionsEfl.cmake:

Source/WebKit2:

Implement windowless plugin and functions needed to launch PluginProcess.

* GNUmakefile.am: Change files and folders related to plugin process from gtk to unix.
* GNUmakefile.list.am: Change files and folders related to plugin process from gtk to unix.
* Platform/Logging.cpp: Add Plugins channel for LOG.
(WebKit):
(WebKit::getChannelFromName):
(WebKit::initializeLogChannelsIfNecessary):
* Platform/Logging.h:
(WebKit):
* PlatformEfl.cmake: Add files needed by plugin process.
* PluginProcess/unix/PluginControllerProxyUnix.cpp: Renamed from Source/WebKit2/PluginProcess/gtk/PluginControllerProxyGtk.cpp.
(WebKit):
(WebKit::PluginControllerProxy::platformInitialize): Add macros for gtk/efl differents.
(WebKit::PluginControllerProxy::platformDestroy):
(WebKit::PluginControllerProxy::platformGeometryDidChange):
* PluginProcess/unix/PluginProcessMainUnix.cpp: Renamed from Source/WebKit2/PluginProcess/gtk/PluginProcessMainGtk.cpp.
(WebKit):
(WebKit::webkitXError):
(WebKit::PluginProcessMainUnix):
* PluginProcess/unix/PluginProcessMainUnix.h: Renamed from Source/WebKit2/PluginProcess/gtk/PluginProcessMainGtk.h.
(WebKit):
* PluginProcess/unix/PluginProcessUnix.cpp: Renamed from Source/WebKit2/PluginProcess/gtk/PluginProcessGtk.cpp.
(WebKit):
(WebKit::PluginProcess::platformInitialize):
* UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp: Renamed from Source/WebKit2/UIProcess/Plugins/gtk/PluginProcessProxyGtk.cpp.
(WebKit):
(WebKit::PluginProcessProxy::platformInitializePluginProcess):
(WebKit::PluginProcessProxy::scanPlugin):
* UIProcess/efl/WebPageProxyEfl.cpp: Add stubs.
(WebKit::WebPageProxy::createPluginContainer):
(WebKit):
(WebKit::WebPageProxy::windowedPluginGeometryDidChange):
* WebProcess/Plugins/Netscape/unix/PluginProxyUnix.cpp: Renamed from Source/WebKit2/WebProcess/Plugins/Netscape/gtk/PluginProxyGtk.cpp.
(WebKit):
(WebKit::PluginProxy::needsBackingStore):
* WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp: Plugin's windowless implementation.
(WebKit::getPluginDisplay):
(WebKit::x11Screen):
(WebKit::displayDepth):
(WebKit::rootWindowID):
(WebKit::NetscapePlugin::x11HostDisplay):
(WebKit::NetscapePlugin::platformPaint):
* config.h:
* unix/PluginMainUnix.cpp: Renamed from Source/WebKit2/gtk/PluginMainGtk.cpp.
(main):

Tools:

Turn on Netscape Plugin API option by default.

* Scripts/webkitperl/FeatureList.pm:

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

20 files changed:
ChangeLog
Source/WebKit2/ChangeLog
Source/WebKit2/GNUmakefile.am
Source/WebKit2/GNUmakefile.list.am
Source/WebKit2/Platform/Logging.cpp
Source/WebKit2/Platform/Logging.h
Source/WebKit2/PlatformEfl.cmake
Source/WebKit2/PluginProcess/unix/PluginControllerProxyUnix.cpp [moved from Source/WebKit2/PluginProcess/gtk/PluginControllerProxyGtk.cpp with 100% similarity]
Source/WebKit2/PluginProcess/unix/PluginProcessMainUnix.cpp [moved from Source/WebKit2/PluginProcess/gtk/PluginProcessMainGtk.cpp with 64% similarity]
Source/WebKit2/PluginProcess/unix/PluginProcessMainUnix.h [moved from Source/WebKit2/PluginProcess/gtk/PluginProcessMainGtk.h with 92% similarity]
Source/WebKit2/PluginProcess/unix/PluginProcessUnix.cpp [moved from Source/WebKit2/PluginProcess/gtk/PluginProcessGtk.cpp with 100% similarity]
Source/WebKit2/UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp [moved from Source/WebKit2/UIProcess/Plugins/gtk/PluginProcessProxyGtk.cpp with 81% similarity]
Source/WebKit2/UIProcess/efl/WebPageProxyEfl.cpp
Source/WebKit2/WebProcess/Plugins/Netscape/unix/PluginProxyUnix.cpp [moved from Source/WebKit2/WebProcess/Plugins/Netscape/gtk/PluginProxyGtk.cpp with 100% similarity]
Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp
Source/WebKit2/config.h
Source/WebKit2/unix/PluginMainUnix.cpp [moved from Source/WebKit2/gtk/PluginMainGtk.cpp with 94% similarity]
Source/cmake/OptionsEfl.cmake
Tools/ChangeLog
Tools/Scripts/webkitperl/FeatureList.pm

index 7ef0760..ab1a84f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2012-09-28  Mariusz Grzegorczyk  <mariusz.g@samsung.com>
+
+        [WK2][GTK][EFL] Share WebKit2-GTK plugin process implementation with EFL port
+        https://bugs.webkit.org/show_bug.cgi?id=91844
+
+        Reviewed by Simon Hausmann.
+
+        Turn on Netscape Plugin API by default  for WebKit2-Efl.
+
+        * Source/cmake/OptionsEfl.cmake:
+
 2012-09-28  Alpha Lam  <hclam@chromium.org>
 
         REGRESSION(r122215) - CachedImage::likelyToBeUsedSoon crashes on accessing a deleted CachedImageClient
index c2c5791..da202dd 100644 (file)
@@ -1,3 +1,57 @@
+2012-09-28  Mariusz Grzegorczyk  <mariusz.g@samsung.com>
+
+        [WK2][GTK][EFL] Share WebKit2-GTK plugin process implementation with EFL port
+        https://bugs.webkit.org/show_bug.cgi?id=91844
+
+        Reviewed by Simon Hausmann.
+
+        Implement windowless plugin and functions needed to launch PluginProcess.
+
+        * GNUmakefile.am: Change files and folders related to plugin process from gtk to unix.
+        * GNUmakefile.list.am: Change files and folders related to plugin process from gtk to unix.
+        * Platform/Logging.cpp: Add Plugins channel for LOG.
+        (WebKit):
+        (WebKit::getChannelFromName):
+        (WebKit::initializeLogChannelsIfNecessary):
+        * Platform/Logging.h:
+        (WebKit):
+        * PlatformEfl.cmake: Add files needed by plugin process.
+        * PluginProcess/unix/PluginControllerProxyUnix.cpp: Renamed from Source/WebKit2/PluginProcess/gtk/PluginControllerProxyGtk.cpp.
+        (WebKit):
+        (WebKit::PluginControllerProxy::platformInitialize): Add macros for gtk/efl differents.
+        (WebKit::PluginControllerProxy::platformDestroy):
+        (WebKit::PluginControllerProxy::platformGeometryDidChange):
+        * PluginProcess/unix/PluginProcessMainUnix.cpp: Renamed from Source/WebKit2/PluginProcess/gtk/PluginProcessMainGtk.cpp.
+        (WebKit):
+        (WebKit::webkitXError):
+        (WebKit::PluginProcessMainUnix):
+        * PluginProcess/unix/PluginProcessMainUnix.h: Renamed from Source/WebKit2/PluginProcess/gtk/PluginProcessMainGtk.h.
+        (WebKit):
+        * PluginProcess/unix/PluginProcessUnix.cpp: Renamed from Source/WebKit2/PluginProcess/gtk/PluginProcessGtk.cpp.
+        (WebKit):
+        (WebKit::PluginProcess::platformInitialize):
+        * UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp: Renamed from Source/WebKit2/UIProcess/Plugins/gtk/PluginProcessProxyGtk.cpp.
+        (WebKit):
+        (WebKit::PluginProcessProxy::platformInitializePluginProcess):
+        (WebKit::PluginProcessProxy::scanPlugin):
+        * UIProcess/efl/WebPageProxyEfl.cpp: Add stubs.
+        (WebKit::WebPageProxy::createPluginContainer):
+        (WebKit):
+        (WebKit::WebPageProxy::windowedPluginGeometryDidChange):
+        * WebProcess/Plugins/Netscape/unix/PluginProxyUnix.cpp: Renamed from Source/WebKit2/WebProcess/Plugins/Netscape/gtk/PluginProxyGtk.cpp.
+        (WebKit):
+        (WebKit::PluginProxy::needsBackingStore):
+        * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp: Plugin's windowless implementation.
+        (WebKit::getPluginDisplay):
+        (WebKit::x11Screen):
+        (WebKit::displayDepth):
+        (WebKit::rootWindowID):
+        (WebKit::NetscapePlugin::x11HostDisplay):
+        (WebKit::NetscapePlugin::platformPaint):
+        * config.h:
+        * unix/PluginMainUnix.cpp: Renamed from Source/WebKit2/gtk/PluginMainGtk.cpp.
+        (main):
+
 2012-09-28  Anders Carlsson  <andersca@apple.com>
 
         Remove Java bridge
index b072e0e..968f527 100644 (file)
@@ -55,7 +55,7 @@ libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_CPP
        -I$(srcdir)/Source/WebKit2/UIProcess/Launcher/gtk \
        -I$(srcdir)/Source/WebKit2/UIProcess/Notifications \
        -I$(srcdir)/Source/WebKit2/UIProcess/Plugins \
-       -I$(srcdir)/Source/WebKit2/UIProcess/Plugins/gtk \
+       -I$(srcdir)/Source/WebKit2/UIProcess/Plugins/unix \
        -I$(srcdir)/Source/WebKit2/UIProcess/soup \
        -I$(srcdir)/Source/WebKit2/WebProcess \
        -I$(srcdir)/Source/WebKit2/WebProcess/ApplicationCache \
@@ -82,7 +82,7 @@ libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_CPP
        -I$(srcdir)/Source/WebKit2/WebProcess/soup \
        -I$(srcdir)/Source/WebKit2/WebProcess/Plugins \
        -I$(srcdir)/Source/WebKit2/WebProcess/Plugins/Netscape \
-       -I$(srcdir)/Source/WebKit2/WebProcess/Plugins/Netscape/gtk \
+       -I$(srcdir)/Source/WebKit2/WebProcess/Plugins/Netscape/unix \
        -I$(srcdir)/Source/WebKit2/WebProcess/WebCoreSupport \
        -I$(srcdir)/Source/WebKit2/WebProcess/WebCoreSupport/gtk \
        -I$(srcdir)/Source/WebKit2/WebProcess/WebCoreSupport/soup \
@@ -429,7 +429,7 @@ Programs_WebKitPluginProcess_CPPFLAGS = \
        -I$(srcdir)/Source/WebKit2/Platform \
        -I$(srcdir)/Source/WebKit2/Platform/CoreIPC/ \
        -I$(srcdir)/Source/WebKit2/PluginProcess/ \
-       -I$(srcdir)/Source/WebKit2/PluginProcess/gtk \
+       -I$(srcdir)/Source/WebKit2/PluginProcess/unix \
        -I$(srcdir)/Source/WebKit2/Shared \
        -I$(srcdir)/Source/WebKit2/Shared/Plugins \
        -I$(srcdir)/Source/WebKit2/Shared/Plugins/Netscape/ \
index a842877..13c6fa7 100644 (file)
@@ -278,8 +278,8 @@ webkit2_sources += \
        Source/WebKit2/PluginProcess/PluginProcessMain.h \
        Source/WebKit2/PluginProcess/WebProcessConnection.cpp \
        Source/WebKit2/PluginProcess/WebProcessConnection.h \
-       Source/WebKit2/PluginProcess/gtk/PluginControllerProxyGtk.cpp \
-       Source/WebKit2/PluginProcess/gtk/PluginProcessGtk.cpp \
+       Source/WebKit2/PluginProcess/unix/PluginControllerProxyUnix.cpp \
+       Source/WebKit2/PluginProcess/unix/PluginProcessUnix.cpp \
        Source/WebKit2/Shared/DragControllerAction.h \
        Source/WebKit2/Shared/FontInfo.h \
        Source/WebKit2/Shared/HTTPCookieAcceptPolicy.h \
@@ -806,8 +806,8 @@ webkit2_sources += \
        Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.h \
        Source/WebKit2/UIProcess/Plugins/WebPluginSiteDataManager.h \
        Source/WebKit2/UIProcess/Plugins/WebPluginSiteDataManager.cpp \
-       Source/WebKit2/UIProcess/Plugins/gtk/PluginProcessProxyGtk.cpp \
        Source/WebKit2/UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp \
+       Source/WebKit2/UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp \
        Source/WebKit2/UIProcess/ProcessModel.h \
        Source/WebKit2/UIProcess/ResponsivenessTimer.cpp \
        Source/WebKit2/UIProcess/ResponsivenessTimer.h \
@@ -1066,7 +1066,7 @@ webkit2_sources += \
        Source/WebKit2/WebProcess/Plugins/Netscape/NPRuntimeObjectMap.h \
        Source/WebKit2/WebProcess/Plugins/Netscape/NPRuntimeUtilities.cpp \
        Source/WebKit2/WebProcess/Plugins/Netscape/NPRuntimeUtilities.h \
-       Source/WebKit2/WebProcess/Plugins/Netscape/gtk/PluginProxyGtk.cpp \
+       Source/WebKit2/WebProcess/Plugins/Netscape/unix/PluginProxyUnix.cpp \
        Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp \
        Source/WebKit2/WebProcess/Plugins/PluginController.h \
        Source/WebKit2/WebProcess/Plugins/Plugin.cpp \
@@ -1236,10 +1236,10 @@ webkit2_plugin_process_sources += \
        Source/WebKit2/PluginProcess/WebProcessConnection.h \
        Source/WebKit2/Shared/Plugins/PluginProcessCreationParameters.cpp \
        Source/WebKit2/Shared/Plugins/PluginProcessCreationParameters.h \
-       Source/WebKit2/PluginProcess/gtk/PluginControllerProxyGtk.cpp \
-       Source/WebKit2/PluginProcess/gtk/PluginProcessGtk.cpp \
-       Source/WebKit2/PluginProcess/gtk/PluginProcessMainGtk.h \
-       Source/WebKit2/PluginProcess/gtk/PluginProcessMainGtk.cpp \
+       Source/WebKit2/PluginProcess/unix/PluginControllerProxyUnix.cpp \
+       Source/WebKit2/PluginProcess/unix/PluginProcessMainUnix.h \
+       Source/WebKit2/PluginProcess/unix/PluginProcessMainUnix.cpp \
+       Source/WebKit2/PluginProcess/unix/PluginProcessUnix.cpp \
        Source/WebKit2/Shared/ChildProcess.cpp \
        Source/WebKit2/Shared/ChildProcess.h \
        Source/WebKit2/Shared/ProcessExecutablePath.h \
@@ -1272,7 +1272,7 @@ webkit2_plugin_process_sources += \
        Source/WebKit2/Shared/gtk/WebEventFactory.cpp \
        Source/WebKit2/Shared/cairo/ShareableBitmapCairo.cpp \
        Source/WebKit2/Shared/soup/WebCoreArgumentCodersSoup.cpp \
-       Source/WebKit2/UIProcess/Plugins/gtk/PluginProcessProxyGtk.cpp \
+       Source/WebKit2/UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp \
        Source/WebKit2/WebProcess/Plugins/Plugin.cpp \
        Source/WebKit2/WebProcess/Plugins/Plugin.h \
        Source/WebKit2/WebProcess/Plugins/Netscape/NPRuntimeUtilities.cpp \
@@ -1284,6 +1284,6 @@ webkit2_plugin_process_sources += \
        Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePluginStream.cpp \
        Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePluginStream.h \
        Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp \
-       Source/WebKit2/gtk/PluginMainGtk.cpp
+       Source/WebKit2/unix/PluginMainUnix.cpp
 
 endif # ENABLE_PLUGIN_PROCESS
index 17694c9..df98e72 100644 (file)
@@ -37,6 +37,7 @@ WTFLogChannel LogTextInput    = { 0x00000004, "WebKit2LogLevel", WTFLogChannelOf
 WTFLogChannel LogView         = { 0x00000008, "WebKit2LogLevel", WTFLogChannelOff };
 WTFLogChannel LogIconDatabase = { 0x00000010, "WebKit2LogLevel", WTFLogChannelOff };
 WTFLogChannel LogKeyHandling  = { 0x00000020, "WebKit2LogLevel", WTFLogChannelOff };
+WTFLogChannel LogPlugins      = { 0x00000040, "WebKit2LogLevel", WTFLogChannelOff };
 
 #if !PLATFORM(MAC) && !PLATFORM(GTK) && !PLATFORM(QT) && !PLATFORM(EFL)
 void initializeLogChannel(WTFLogChannel* channel)
@@ -69,6 +70,9 @@ WTFLogChannel* getChannelFromName(const String& channelName)
     if (equalIgnoringCase(channelName, String("KeyHandling")))
         return &LogKeyHandling;
 
+    if (equalIgnoringCase(channelName, String("Plugins")))
+        return &LogPlugins;
+
     return 0;
 }
 #endif
@@ -83,6 +87,7 @@ void initializeLogChannelsIfNecessary()
     initializeLogChannel(&LogContextMenu);
     initializeLogChannel(&LogIconDatabase);
     initializeLogChannel(&LogKeyHandling);
+    initializeLogChannel(&LogPlugins);
     initializeLogChannel(&LogSessionState);
     initializeLogChannel(&LogTextInput);
     initializeLogChannel(&LogView);
index 173d604..603686f 100644 (file)
@@ -40,6 +40,7 @@ namespace WebKit {
 extern WTFLogChannel LogContextMenu;
 extern WTFLogChannel LogIconDatabase;
 extern WTFLogChannel LogKeyHandling;
+extern WTFLogChannel LogPlugins;
 extern WTFLogChannel LogSessionState;
 extern WTFLogChannel LogTextInput;
 extern WTFLogChannel LogView;
index d3932b6..4eb4ffd 100644 (file)
@@ -7,6 +7,10 @@ LIST(APPEND WebKit2_SOURCES
     Platform/CoreIPC/unix/ConnectionUnix.cpp
     Platform/CoreIPC/unix/AttachmentUnix.cpp
 
+    PluginProcess/unix/PluginControllerProxyUnix.cpp
+    PluginProcess/unix/PluginProcessMainUnix.cpp
+    PluginProcess/unix/PluginProcessUnix.cpp
+
     Shared/API/c/cairo/WKImageCairo.cpp
 
     Shared/API/c/gtk/WKGraphicsContextGtk.cpp
@@ -28,6 +32,8 @@ LIST(APPEND WebKit2_SOURCES
 
     UIProcess/DefaultUndoController.cpp
 
+    Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp
+
     UIProcess/API/C/efl/WKView.cpp
     
     UIProcess/API/cpp/efl/WKEinaSharedString.cpp
@@ -85,6 +91,7 @@ LIST(APPEND WebKit2_SOURCES
     UIProcess/Launcher/efl/ProcessLauncherEfl.cpp
 
     UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp
+    UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp
 
     WebProcess/Cookies/soup/WebCookieManagerSoup.cpp
     WebProcess/Cookies/soup/WebKitSoupCookieJarSqlite.cpp
@@ -94,6 +101,10 @@ LIST(APPEND WebKit2_SOURCES
 
     WebProcess/InjectedBundle/efl/InjectedBundleEfl.cpp
 
+    WebProcess/Plugins/Netscape/unix/PluginProxyUnix.cpp
+
+    WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp
+
     WebProcess/WebCoreSupport/efl/WebContextMenuClientEfl.cpp
     WebProcess/WebCoreSupport/efl/WebEditorClientEfl.cpp
     WebProcess/WebCoreSupport/efl/WebErrorsEfl.cpp
@@ -236,6 +247,29 @@ SET (EWebKit2_HEADERS
 INSTALL(FILES ${CMAKE_BINARY_DIR}/WebKit2/efl/ewebkit2.pc DESTINATION lib/pkgconfig)
 INSTALL(FILES ${EWebKit2_HEADERS} DESTINATION include/${WebKit2_LIBRARY_NAME}-${PROJECT_VERSION_MAJOR})
 
+IF (ENABLE_PLUGIN_PROCESS)
+    ADD_DEFINITIONS(-DENABLE_PLUGIN_PROCESS=1)
+
+    SET (PluginProcess_EXECUTABLE_NAME PluginProcess)
+    LIST (APPEND PluginProcess_INCLUDE_DIRECTORIES
+        "${WEBKIT2_DIR}/PluginProcess/unix"
+    )
+
+    INCLUDE_DIRECTORIES(${PluginProcess_INCLUDE_DIRECTORIES})
+
+    LIST (APPEND PluginProcess_SOURCES
+        ${WEBKIT2_DIR}/unix/PluginMainUnix.cpp
+    )
+
+    SET(PluginProcess_LIBRARIES
+        ${WebKit2_LIBRARY_NAME}
+    )
+
+    ADD_EXECUTABLE(${PluginProcess_EXECUTABLE_NAME} ${PluginProcess_SOURCES})
+    TARGET_LINK_LIBRARIES(${PluginProcess_EXECUTABLE_NAME} ${PluginProcess_LIBRARIES})
+    INSTALL(TARGETS ${PluginProcess_EXECUTABLE_NAME} DESTINATION "${EXEC_INSTALL_DIR}")
+ENDIF () # ENABLE_PLUGIN_PROCESS
+
 INCLUDE_DIRECTORIES(${THIRDPARTY_DIR}/gtest/include)
 
 SET(EWK2UnitTests_LIBRARIES
@@ -1,5 +1,7 @@
 /*
  * Copyright (C) 2011 Igalia S.L.
+ * Copyright (C) 2011 Apple Inc.
+ * Copyright (C) 2012 Samsung Electronics
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
  *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  */
 
 #include "config.h"
-#include "PluginProcessMainGtk.h"
+#include "PluginProcessMainUnix.h"
 
+#include "Logging.h"
 #include "NetscapePlugin.h"
 #include "PluginProcess.h"
+#include "ScriptController.h"
 #include <WebCore/RunLoop.h>
+#if PLATFORM(GTK)
 #include <gdk/gdkx.h>
 #include <gtk/gtk.h>
-#include <runtime/InitializeThreading.h>
-#include <wtf/MainThread.h>
+#elif PLATFORM(EFL) && HAVE_ECORE_X
+#include <Ecore_X.h>
+#endif
 
 using namespace WebCore;
 
 namespace WebKit {
 
-static int webkitgtkXError(Display* xdisplay, XErrorEvent* error)
+#ifdef XP_UNIX
+static const char* xErrorString = "The program '%s' received an X Window System error.\n"
+    "This probably reflects a bug in a browser plugin.\n"
+    "The error was '%s'.\n"
+    "  (Details: serial %ld error_code %d request_code %d minor_code %d)\n";
+static char* programName = 0;
+
+static int webkitXError(Display* xdisplay, XErrorEvent* error)
 {
-    gchar errorMessage[64];
+    char errorMessage[64];
     XGetErrorText(xdisplay, error->error_code, errorMessage, 63);
-    g_warning("The program '%s' received an X Window System error.\n"
-              "This probably reflects a bug in a browser plugin.\n"
-              "The error was '%s'.\n"
-              "  (Details: serial %ld error_code %d request_code %d minor_code %d)\n",
-              g_get_prgname(), errorMessage,
-              error->serial, error->error_code,
-              error->request_code, error->minor_code);
+
+    LOG(Plugins, xErrorString,
+        programName, errorMessage,
+        error->serial, error->error_code,
+        error->request_code, error->minor_code);
+
     return 0;
 }
+#endif
 
-WK_EXPORT int PluginProcessMainGtk(int argc, char* argv[])
+WK_EXPORT int PluginProcessMainUnix(int argc, char* argv[])
 {
     ASSERT(argc == 2 || argc == 3);
     bool scanPlugin = !strcmp(argv[1], "-scanPlugin");
     ASSERT(argc == 2 || (argc == 3 && scanPlugin));
 
+#if PLATFORM(GTK)
     gtk_init(&argc, &argv);
+#elif PLATFORM(EFL)
+#ifdef HAVE_ECORE_X
+    if (!ecore_x_init(0))
+#endif
+        return 1;
+#endif
 
-    JSC::initializeThreading();
-    WTF::initializeMainThread();
+    ScriptController::initializeThreading();
 
     if (scanPlugin) {
         String pluginPath(argv[2]);
@@ -75,7 +94,10 @@ WK_EXPORT int PluginProcessMainGtk(int argc, char* argv[])
     // Plugins can produce X errors that are handled by the GDK X error handler, which
     // exits the process. Since we don't want to crash due to plugin bugs, we install a
     // custom error handler to show a warning when a X error happens without aborting.
-    XSetErrorHandler(webkitgtkXError);
+#if defined(XP_UNIX)
+    programName = basename(argv[0]);
+    XSetErrorHandler(webkitXError);
+#endif
 
     int socket = atoi(argv[1]);
     WebKit::PluginProcess::shared().initialize(socket, RunLoop::main());
@@ -85,5 +107,3 @@ WK_EXPORT int PluginProcessMainGtk(int argc, char* argv[])
 }
 
 } // namespace WebKit
-
-
@@ -24,8 +24,8 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef PluginProcessMainGtk_h
-#define PluginProcessMainGtk_h
+#ifndef PluginProcessMainUnix_h
+#define PluginProcessMainUnix_h
 
 #include <WebKit2/WKBase.h>
 
@@ -33,7 +33,7 @@ namespace WebKit {
 
 #ifdef __cplusplus
 extern "C" {
-WK_EXPORT int PluginProcessMainGtk(int argc, char* argv[]);
+WK_EXPORT int PluginProcessMainUnix(int argc, char* argv[]);
 } // extern "C"
 #endif // __cplusplus
 
@@ -1,5 +1,7 @@
 /*
  * Copyright (C) 2011 Igalia S.L.
+ * Copyright (C) 2011 Apple Inc.
+ * Copyright (C) 2012 Samsung Electronics
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
  *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 #include "PluginProcessCreationParameters.h"
 #include "ProcessExecutablePath.h"
 #include <WebCore/FileSystem.h>
-#include <WebCore/GOwnPtrGtk.h>
-#include <glib.h>
 #include <wtf/text/CString.h>
 #include <wtf/text/WTFString.h>
+#if PLATFORM(GTK) || (PLATFORM(EFL) && ENABLE(GLIB_SUPPORT))
+#include <glib.h>
+#endif
 
 using namespace WebCore;
 
@@ -46,6 +49,7 @@ void PluginProcessProxy::platformInitializePluginProcess(PluginProcessCreationPa
 
 bool PluginProcessProxy::scanPlugin(const String& pluginPath, RawPluginMetaData& result)
 {
+#if PLATFORM(GTK) || (PLATFORM(EFL) && ENABLE(GLIB_SUPPORT))
     CString binaryPath = fileSystemRepresentation(executablePathOfPluginProcess());
     CString pluginPathCString = fileSystemRepresentation(pluginPath);
     char* argv[4];
@@ -54,27 +58,37 @@ bool PluginProcessProxy::scanPlugin(const String& pluginPath, RawPluginMetaData&
     argv[2] = const_cast<char*>(pluginPathCString.data());
     argv[3] = 0;
 
-    gint status;
-    GOwnPtr<gchar> stdOut;
-    if (!g_spawn_sync(0, argv, 0, G_SPAWN_STDERR_TO_DEV_NULL, 0, 0, &stdOut.outPtr(), 0, &status, 0))
+    int status;
+    char* stdOut = 0;
+
+    if (!g_spawn_sync(0, argv, 0, G_SPAWN_STDERR_TO_DEV_NULL, 0, 0, &stdOut, 0, &status, 0))
         return false;
+
     if (!WIFEXITED(status) || WEXITSTATUS(status) != EXIT_SUCCESS)
         return false;
 
     const unsigned kNumLinesExpected = 3;
     String lines[kNumLinesExpected];
     unsigned lineIndex = 0;
-    const UChar* current = reinterpret_cast<const UChar*>(stdOut.get());
+
+    const UChar* current = reinterpret_cast<const UChar*>(stdOut);
+
     while (lineIndex < kNumLinesExpected) {
         const UChar* start = current;
         while (*current++ != UChar('\n')) { }
         lines[lineIndex++] = String(start, current - start - 1);
     }
 
+    if (stdOut)
+        free(stdOut);
+
     result.name.swap(lines[0]);
     result.description.swap(lines[1]);
     result.mimeDescription.swap(lines[2]);
     return !result.mimeDescription.isEmpty();
+#else // PLATFORM(GTK) || (PLATFORM(EFL) && ENABLE(GLIB_SUPPORT))
+    return false;
+#endif // PLATFORM(GTK) || (PLATFORM(EFL) && ENABLE(GLIB_SUPPORT))
 }
 
 } // namespace WebKit
index 2a3b307..8981cee 100644 (file)
@@ -83,4 +83,14 @@ void WebPageProxy::setThemePath(const String& themePath)
     process()->send(Messages::WebPage::SetThemePath(themePath), m_pageID, 0);
 }
 
+void WebPageProxy::createPluginContainer(uint64_t&)
+{
+    notImplemented();
+}
+
+void WebPageProxy::windowedPluginGeometryDidChange(const WebCore::IntRect&, const WebCore::IntRect&, uint64_t)
+{
+    notImplemented();
+}
+
 } // namespace WebKit
index 5c9e678..f216ff9 100644 (file)
 #if PLATFORM(QT)
 #include <WebCore/QtX11ImageConversion.h>
 #elif PLATFORM(GTK)
-#include "PlatformContextCairo.h"
-#include "RefPtrCairo.h"
-#include <cairo-xlib.h>
 #include <gtk/gtk.h>
 #ifndef GTK_API_VERSION_2
 #include <gtk/gtkx.h>
 #endif
 #include <gdk/gdkx.h>
 #include <WebCore/GtkVersioning.h>
+#elif PLATFORM(EFL) && defined(HAVE_ECORE_X)
+#include <Ecore_X.h>
+#endif
+
+#if USE(CAIRO) && !PLATFORM(WIN_CAIRO)
+#include "PlatformContextCairo.h"
+#include "RefPtrCairo.h"
+#include <cairo/cairo-xlib.h>
 #endif
 
 using namespace WebCore;
@@ -84,6 +89,8 @@ static Display* getPluginDisplay()
     // Since we're a gdk/gtk app, we'll (probably?) have the same X connection as any gdk-based
     // plugins, so we can return that. We might want to add other implementations here later.
     return GDK_DISPLAY_XDISPLAY(gdk_display_get_default());
+#elif PLATFORM(EFL) && defined(HAVE_ECORE_X)
+    return static_cast<Display*>(ecore_x_display_get());
 #else
     return 0;
 #endif
@@ -95,6 +102,8 @@ static inline int x11Screen()
     return XDefaultScreen(NetscapePlugin::x11HostDisplay());
 #elif PLATFORM(GTK)
     return gdk_screen_get_number(gdk_screen_get_default());
+#elif PLATFORM(EFL) && defined(HAVE_ECORE_X)
+    return ecore_x_screen_index_get(ecore_x_default_screen_get());
 #else
     return 0;
 #endif
@@ -106,6 +115,8 @@ static inline int displayDepth()
     return XDefaultDepth(NetscapePlugin::x11HostDisplay(), x11Screen());
 #elif PLATFORM(GTK)
     return gdk_visual_get_depth(gdk_screen_get_system_visual(gdk_screen_get_default()));
+#elif PLATFORM(EFL) && defined(HAVE_ECORE_X)
+    return ecore_x_default_depth_get(NetscapePlugin::x11HostDisplay(), ecore_x_default_screen_get());
 #else
     return 0;
 #endif
@@ -117,6 +128,8 @@ static inline unsigned long rootWindowID()
     return XDefaultRootWindow(NetscapePlugin::x11HostDisplay());
 #elif PLATFORM(GTK)
     return GDK_ROOT_WINDOW();
+#elif PLATFORM(EFL) && defined(HAVE_ECORE_X)
+    return ecore_x_window_root_first_get();
 #else
     return 0;
 #endif
@@ -144,6 +157,8 @@ Display* NetscapePlugin::x11HostDisplay()
     return dedicatedDisplay;
 #elif PLATFORM(GTK)
     return GDK_DISPLAY_XDISPLAY(gdk_display_get_default());
+#elif PLATFORM(EFL) && defined(HAVE_ECORE_X)
+    return static_cast<Display*>(ecore_x_display_get());
 #else
     return 0;
 #endif
@@ -357,7 +372,7 @@ void NetscapePlugin::platformPaint(GraphicsContext* context, const IntRect& dirt
     painter->drawImage(QPoint(exposedRect.x(), exposedRect.y()), qimageFromXImage(xImage), exposedRect);
 
     XDestroyImage(xImage);
-#elif PLATFORM(GTK)
+#elif PLATFORM(GTK) || (PLATFORM(EFL) && USE(CAIRO))
     RefPtr<cairo_surface_t> drawableSurface = adoptRef(cairo_xlib_surface_create(m_pluginDisplay,
                                                                                  m_drawable,
                                                                                  static_cast<NPSetWindowCallbackStruct*>(m_npWindow.ws_info)->visual,
index d6c4a5d..2885075 100644 (file)
@@ -108,7 +108,7 @@ static const type& name() \
 #define PLUGIN_ARCHITECTURE_MAC 1
 #elif PLATFORM(WIN)
 #define PLUGIN_ARCHITECTURE_WIN 1
-#elif PLATFORM(GTK) && (OS(UNIX) && !OS(MAC_OS_X))
+#elif (PLATFORM(GTK) || PLATFORM(EFL)) && (OS(UNIX) && !OS(MAC_OS_X))
 #define PLUGIN_ARCHITECTURE_X11 1
 #elif PLATFORM(QT)
 // Qt handles this features.prf
similarity index 94%
rename from Source/WebKit2/gtk/PluginMainGtk.cpp
rename to Source/WebKit2/unix/PluginMainUnix.cpp
index 63cf44c..07f9a0d 100644 (file)
@@ -24,9 +24,9 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include "PluginProcessMainGtk.h"
+#include "PluginProcessMainUnix.h"
 
 int main(int argc, char** argv)
 {
-    return WebKit::PluginProcessMainGtk(argc, argv);
+    return WebKit::PluginProcessMainUnix(argc, argv);
 }
index 0ae4ece..53937e5 100644 (file)
@@ -74,7 +74,7 @@ WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_MEDIA_CAPTURE ON)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_MEMORY_SAMPLER ON)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_MICRODATA ON)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_NAVIGATOR_CONTENT_UTILS ON)
-WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_NETSCAPE_PLUGIN_API OFF)
+WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_NETSCAPE_PLUGIN_API ON)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_NETWORK_INFO ON)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_PAGE_VISIBILITY_API ON)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_REGIONS ON)
@@ -119,6 +119,10 @@ SET(WTF_USE_HARFBUZZ_NG 1)
 ADD_DEFINITIONS(-DWTF_USE_FREETYPE=1)
 ADD_DEFINITIONS(-DWTF_USE_HARFBUZZ_NG=1)
 
+IF (ENABLE_WEBKIT2)
+    SET(ENABLE_PLUGIN_PROCESS 1)
+ENDIF ()
+
 IF (NOT ENABLE_SVG)
   SET(ENABLE_SVG_FONTS 0)
 ENDIF ()
index 8d74c29..a6018ef 100644 (file)
@@ -1,3 +1,14 @@
+2012-09-28  Mariusz Grzegorczyk  <mariusz.g@samsung.com>
+
+        [WK2][GTK][EFL] Share WebKit2-GTK plugin process implementation with EFL port
+        https://bugs.webkit.org/show_bug.cgi?id=91844
+
+        Reviewed by Simon Hausmann.
+
+        Turn on Netscape Plugin API option by default.
+
+        * Scripts/webkitperl/FeatureList.pm:
+
 2012-09-28  Dirk Pranke  <dpranke@chromium.org>
 
         webkit-patch rebaseline-expectations is broken
index 6857766..2e9a147 100644 (file)
@@ -329,7 +329,7 @@ my @features = (
       define => "ENABLE_NAVIGATOR_CONTENT_UTILS", default => (isBlackBerry() || isEfl()), value => \$registerProtocolHandlerSupport },
 
     { option => "netscape-plugin-api", desc => "Toggle Netscape Plugin API support",
-      define => "ENABLE_NETSCAPE_PLUGIN_API", default => !isEfl(), value => \$netscapePluginAPISupport },
+      define => "ENABLE_NETSCAPE_PLUGIN_API", default => 1, value => \$netscapePluginAPISupport },
 
     { option => "network-info", desc => "Toggle Network Info support",
       define => "ENABLE_NETWORK_INFO", default => isEfl(), value => \$networkInfoSupport },