+2012-04-02 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r112868, r112879, and r112881.
+ http://trac.webkit.org/changeset/112868
+ http://trac.webkit.org/changeset/112879
+ http://trac.webkit.org/changeset/112881
+ https://bugs.webkit.org/show_bug.cgi?id=82901
+
+ "Build fail on bots." (Requested by kbalazs on #webkit).
+
+ * Source/QtWebKit.pro:
+
2012-04-02 Balazs Kelemen <kbalazs@webkit.org>
[Qt][WK2] Set up plugin process on Unix
# See 'Tools/qmake/README' for an overview of the build system
# -------------------------------------------------------------------
-load(features)
-
TEMPLATE = subdirs
CONFIG += ordered
!no_webkit2 {
webprocess.file = WebKit2/WebProcess.pro
SUBDIRS += webprocess
- contains(DEFINES, ENABLE_PLUGIN_PROCESS=1) {
- pluginprocess.file = WebKit2/PluginProcess.pro
- SUBDIRS += pluginprocess
- }
}
include(WebKit/qt/docs/docs.pri)
+2012-04-02 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r112868, r112879, and r112881.
+ http://trac.webkit.org/changeset/112868
+ http://trac.webkit.org/changeset/112879
+ http://trac.webkit.org/changeset/112881
+ https://bugs.webkit.org/show_bug.cgi?id=82901
+
+ "Build fail on bots." (Requested by kbalazs on #webkit).
+
+ * GNUmakefile.am:
+ * PluginProcess.pro: Removed.
+ * PluginProcess/gtk/PluginProcessMainGtk.cpp:
+ (WebKit::PluginProcessMainGtk):
+ * PluginProcess/qt/PluginProcessMainQt.cpp:
+ (WebKit::PluginProcessMain):
+ * Shared/Plugins/Netscape/NetscapePluginModule.cpp:
+ (WebKit::NetscapePluginModule::tryLoad):
+ * Shared/Plugins/Netscape/NetscapePluginModule.h:
+ (NetscapePluginModule):
+ * Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp:
+ (StdoutDevNullRedirector):
+ (WebKit):
+ (WebKit::StdoutDevNullRedirector::StdoutDevNullRedirector):
+ (WebKit::StdoutDevNullRedirector::~StdoutDevNullRedirector):
+ (WebKit::initializeGTK):
+ (WebKit::NetscapePluginModule::applyX11QuirksBeforeLoad):
+ (WebKit::NetscapePluginModule::setMIMEDescription):
+ (WebKit::NetscapePluginModule::getPluginInfoForLoadedPlugin):
+ (WebKit::NetscapePluginModule::getPluginInfo):
+ (WebKit::NetscapePluginModule::determineQuirks):
+ * Shared/ProcessExecutablePath.h: Removed.
+ * Shared/gtk/ProcessExecutablePathGtk.cpp: Removed.
+ * Shared/qt/ProcessExecutablePathQt.cpp: Removed.
+ * Shared/qt/ShareableBitmapQt.cpp:
+ (WebKit::ShareableBitmap::paint):
+ * Target.pri:
+ * UIProcess/Launcher/ProcessLauncher.h:
+ (ProcessLauncher):
+ * UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp:
+ (WebKit):
+ (WebKit::findWebKitProcess):
+ (WebKit::ProcessLauncher::launchProcess):
+ * UIProcess/Launcher/qt/ProcessLauncherQt.cpp:
+ (WebKit::ProcessLauncher::launchProcess):
+ * UIProcess/Plugins/PluginProcessProxy.h:
+ (WebKit):
+ (PluginProcessProxy):
+ * UIProcess/Plugins/gtk/PluginProcessProxyGtk.cpp:
+ (WebKit::PluginProcessProxy::platformInitializePluginProcess):
+ * UIProcess/Plugins/qt/PluginProcessProxyQt.cpp:
+ (WebKit::PluginProcessProxy::platformInitializePluginProcess):
+ * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
+ (WebKit::NPN_GetValue):
+ * qt/PluginMainQt.cpp: Removed.
+
2012-04-02 Balazs Kelemen <kbalazs@webkit.org>
One more try to fix Qt build after r112868.
Source/WebKit2/Shared/EditorState.cpp \
Source/WebKit2/Shared/EditorState.h \
Source/WebKit2/Shared/FontSmoothingLevel.h \
- Source/WebKit2/Shared/ProcessExecutablePath.h \
Source/WebKit2/Shared/cairo/LayerTreeContextCairo.cpp \
Source/WebKit2/Shared/cairo/ShareableBitmapCairo.cpp \
Source/WebKit2/Shared/gtk/ArgumentCodersGtk.h \
Source/WebKit2/Shared/gtk/NativeWebWheelEventGtk.cpp \
Source/WebKit2/Shared/gtk/PlatformCertificateInfo.h \
Source/WebKit2/Shared/gtk/PrintInfoGtk.cpp \
- Source/WebKit2/Shared/gtk/ProcessExecutablePathGtk.cpp \
Source/WebKit2/Shared/gtk/WebCoreArgumentCodersGtk.cpp \
Source/WebKit2/Shared/gtk/WebEventFactory.cpp \
Source/WebKit2/Shared/gtk/WebEventFactory.h \
-I$(srcdir)/Source/WebKit2/Shared/Plugins \
-I$(srcdir)/Source/WebKit2/Shared/Plugins/Netscape/ \
-I$(srcdir)/Source/WebKit2/UIProcess/Plugins/ \
- -I$(srcdir)/Source/WebKit2/UIProcess/Launcher \
-I$(srcdir)/Source/WebKit2/WebProcess/Plugins/ \
-I$(srcdir)/Source/WebKit2/WebProcess/Plugins/Netscape/ \
-I$(top_builddir)/DerivedSources/WebKit2 \
-DBUILDING_WEBKIT \
-DGTK_API_VERSION_2=1 \
-DENABLE_PLUGIN_PROCESS=1 \
- -DLIBEXECDIR=\""$(libexecdir)"\" \
$(global_cppflags) \
$(webcore_cppflags) \
$(webcoregtk_cppflags) \
Source/WebKit2/PluginProcess/gtk/PluginProcessMainGtk.cpp \
Source/WebKit2/Shared/ChildProcess.cpp \
Source/WebKit2/Shared/ChildProcess.h \
- Source/WebKit2/Shared/ProcessExecutablePath.h \
Source/WebKit2/Shared/Plugins/NPIdentifierData.cpp \
Source/WebKit2/Shared/Plugins/NPIdentifierData.h \
Source/WebKit2/Shared/Plugins/NPObjectMessageReceiver.cpp \
Source/WebKit2/Shared/gtk/NativeWebKeyboardEventGtk.cpp \
Source/WebKit2/Shared/gtk/NativeWebWheelEventGtk.cpp \
Source/WebKit2/Shared/gtk/NativeWebMouseEventGtk.cpp \
- Source/WebKit2/Shared/gtk/ProcessExecutablePathGtk.cpp \
Source/WebKit2/Shared/gtk/WebEventFactory.cpp \
Source/WebKit2/Shared/cairo/ShareableBitmapCairo.cpp \
- Source/WebKit2/UIProcess/Plugins/gtk/PluginProcessProxyGtk.cpp \
Source/WebKit2/WebProcess/Plugins/Plugin.cpp \
Source/WebKit2/WebProcess/Plugins/Plugin.h \
Source/WebKit2/WebProcess/Plugins/Netscape/NPRuntimeUtilities.cpp \
+++ /dev/null
-# -------------------------------------------------------------------
-# Project file for the WebKit2 plugin process binary
-#
-# See 'Tools/qmake/README' for an overview of the build system
-# -------------------------------------------------------------------
-
-TEMPLATE = app
-
-QT += webkit
-
-TARGET = QtWebPluginProcess
-DESTDIR = $${ROOT_BUILD_DIR}/bin
-
-SOURCES += qt/PluginMainQt.cpp
-
-INCLUDEPATH = $$PWD/../WTF \
- $$PWD/../JavaSciptCore \
- $$INCLUDEPATH
-
-INSTALLS += target
-
-isEmpty(INSTALL_BINS) {
- target.path = $$[QT_INSTALL_BINS]
-} else {
- target.path = $$INSTALL_BINS
-}
#include "config.h"
#include "PluginProcessMainGtk.h"
-#include "NetscapePlugin.h"
#include "PluginProcess.h"
#include <WebCore/RunLoop.h>
#include <gdk/gdkx.h>
WK_EXPORT int PluginProcessMainGtk(int argc, char* argv[])
{
- ASSERT(argc == 2 || argc == 3);
- bool scanPlugin = !strcmp(argv[1], "-scanPlugin");
- ASSERT(argc == 2 || (argc == 3 && scanPlugin));
+ ASSERT(argc == 2);
gtk_init(&argc, &argv);
JSC::initializeThreading();
WTF::initializeMainThread();
-
- if (scanPlugin) {
- String pluginPath(argv[2]);
- if (!NetscapePluginModule::scanPlugin(pluginPath))
- return EXIT_FAILURE;
- return EXIT_SUCCESS;
- }
-
RunLoop::initializeMainRunLoop();
// Plugins can produce X errors that are handled by the GDK X error handler, which
/*
* Copyright (C) 2010, 2011 Nokia Inc. All rights reserved.
- * Copyright (C) 2011 University of Szeged. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
*/
#include "config.h"
+#include "PluginProcessMain.h"
#if ENABLE(PLUGIN_PROCESS)
-#include "PluginProcessMain.h"
-#include "NetscapePluginModule.h"
+#include "CommandLine.h"
#include "PluginProcess.h"
-#include <QDebug>
-#include <QGuiApplication>
-#include <QStringList>
+#include <WebCore/NotImplemented.h>
#include <WebCore/RunLoop.h>
#include <runtime/InitializeThreading.h>
#include <wtf/MainThread.h>
-#include <wtf/Threading.h>
+#include <wtf/RetainPtr.h>
+#include <wtf/text/CString.h>
+#include <wtf/text/WTFString.h>
+
+#define SHOW_CRASH_REPORTER 1
using namespace WebCore;
namespace WebKit {
-static void messageHandler(QtMsgType type, const char* message)
-{
- if (type == QtCriticalMsg) {
- fprintf(stderr, "%s\n", message);
- return;
- }
-
- // Do nothing
-}
-
-static bool initializeGtk()
-{
- QLibrary gtkLibrary(QLatin1String("libgtk-x11-2.0"), 0);
- if (!gtkLibrary.load())
- return false;
- typedef void* (*gtk_init_ptr)(void*, void*);
- gtk_init_ptr gtkInit = reinterpret_cast<gtk_init_ptr>(gtkLibrary.resolve("gtk_init"));
- if (!gtkInit)
- return false;
- gtkInit(0, 0);
- return true;
-}
-
-int PluginProcessMain(int argc, char** argv)
+int PluginProcessMain(const CommandLine& commandLine)
{
- QByteArray suppressOutput = qgetenv("QT_WEBKIT_SUPPRESS_WEB_PROCESS_OUTPUT");
- if (!suppressOutput.isEmpty() && suppressOutput != "0")
- qInstallMsgHandler(messageHandler);
-
- QGuiApplication app(argc, argv);
-
- // Workaround the issue that some versions of flash does not initialize Gtk properly.
- if (!initializeGtk())
+ String serviceName = commandLine["servicename"];
+ if (serviceName.isEmpty())
return EXIT_FAILURE;
+#if !SHOW_CRASH_REPORTER
+ // Installs signal handlers that exit on a crash so that CrashReporter does not show up.
+ signal(SIGILL, _exit);
+ signal(SIGFPE, _exit);
+ signal(SIGBUS, _exit);
+ signal(SIGSEGV, _exit);
+#endif
+
JSC::initializeThreading();
WTF::initializeMainThread();
-
- if (argc <= 1)
- return EXIT_FAILURE;
-
- if (app.arguments().at(1) == QLatin1String("-scanPlugin")) {
- if (argc != 3)
- return EXIT_FAILURE;
- String pluginPath(app.arguments().at(2));
- if (!NetscapePluginModule::scanPlugin(pluginPath))
- return EXIT_FAILURE;
- return EXIT_SUCCESS;
- }
-
RunLoop::initializeMainRunLoop();
- // Create the connection.
- bool isNumber = false;
- int identifier = app.arguments().at(1).toInt(&isNumber, 10);
- if (!isNumber)
- return EXIT_FAILURE;
- WebKit::PluginProcess::shared().initialize(identifier, RunLoop::main());
-
RunLoop::run();
return 0;
bool NetscapePluginModule::tryLoad()
{
+#if PLUGIN_ARCHITECTURE(X11)
+ applyX11QuirksBeforeLoad();
+#endif
+
m_module = adoptPtr(new Module(m_pluginPath));
if (!m_module->load())
return false;
namespace WebKit {
-class RawPluginMetaData;
-
class NetscapePluginModule : public RefCounted<NetscapePluginModule> {
public:
static PassRefPtr<NetscapePluginModule> getOrCreate(const String& pluginPath);
static bool createPluginMIMETypesPreferences(const String& pluginPath);
#endif
-#if PLUGIN_ARCHITECTURE(X11)
- static bool scanPlugin(const String& pluginPath);
-#endif
-
private:
explicit NetscapePluginModule(const String& pluginPath);
void determineQuirks();
#if PLUGIN_ARCHITECTURE(X11)
- bool getPluginInfoForLoadedPlugin(RawPluginMetaData&);
+ void applyX11QuirksBeforeLoad();
+ static void setMIMEDescription(const String& mimeDescription, PluginModuleInfo&);
+ bool getPluginInfoForLoadedPlugin(PluginModuleInfo&);
#endif
bool tryGetSitesWithData(Vector<String>&);
#include "NetscapePluginModule.h"
-#include "PluginProcessProxy.h"
#include "NetscapeBrowserFuncs.h"
#include <WebCore/FileSystem.h>
-#include <errno.h>
+
+#if PLATFORM(QT)
+#include <QLibrary>
+#endif
+
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
namespace WebKit {
-static void parseMIMEDescription(const String& mimeDescription, Vector<MimeClassInfo>& result)
+class StdoutDevNullRedirector {
+public:
+ StdoutDevNullRedirector();
+ ~StdoutDevNullRedirector();
+
+private:
+ int m_savedStdout;
+};
+
+StdoutDevNullRedirector::StdoutDevNullRedirector()
+ : m_savedStdout(-1)
{
- ASSERT_ARG(result, result.isEmpty());
+ int newStdout = open("/dev/null", O_WRONLY);
+ if (newStdout == -1)
+ return;
+ m_savedStdout = dup(STDOUT_FILENO);
+ dup2(newStdout, STDOUT_FILENO);
+}
+
+StdoutDevNullRedirector::~StdoutDevNullRedirector()
+{
+ if (m_savedStdout != -1)
+ dup2(m_savedStdout, STDOUT_FILENO);
+}
+
+#if PLATFORM(QT)
+static void initializeGTK()
+{
+ QLibrary library(QLatin1String("libgtk-x11-2.0.so.0"));
+ if (library.load()) {
+ typedef void *(*gtk_init_check_ptr)(int*, char***);
+ gtk_init_check_ptr gtkInitCheck = reinterpret_cast<gtk_init_check_ptr>(library.resolve("gtk_init_check"));
+ // NOTE: We're using gtk_init_check() since gtk_init() calls exit() on failure.
+ if (gtkInitCheck)
+ (void) gtkInitCheck(0, 0);
+ }
+}
+#endif
+void NetscapePluginModule::applyX11QuirksBeforeLoad()
+{
+#if PLATFORM(QT)
+ if (m_pluginPath.contains("npwrapper") || m_pluginPath.contains("flashplayer")) {
+ initializeGTK();
+ m_pluginQuirks.add(PluginQuirks::RequiresGTKToolKit);
+ }
+#endif
+}
+
+void NetscapePluginModule::setMIMEDescription(const String& mimeDescription, PluginModuleInfo& plugin)
+{
Vector<String> types;
mimeDescription.lower().split(UChar(';'), false, types);
- result.reserveInitialCapacity(types.size());
+ plugin.info.mimes.reserveCapacity(types.size());
size_t mimeInfoCount = 0;
for (size_t i = 0; i < types.size(); ++i) {
if (mimeTypeParts.size() <= 0)
continue;
- result.uncheckedAppend(MimeClassInfo());
- MimeClassInfo& mimeInfo = result[mimeInfoCount++];
+ plugin.info.mimes.uncheckedAppend(MimeClassInfo());
+ MimeClassInfo& mimeInfo = plugin.info.mimes[mimeInfoCount++];
mimeInfo.type = mimeTypeParts[0];
if (mimeTypeParts.size() > 1)
}
}
-bool NetscapePluginModule::getPluginInfoForLoadedPlugin(RawPluginMetaData& metaData)
+bool NetscapePluginModule::getPluginInfoForLoadedPlugin(PluginModuleInfo& plugin)
{
ASSERT(m_isInitialized);
+ plugin.path = m_pluginPath;
+ plugin.info.file = pathGetFileName(m_pluginPath);
+
Module* module = m_module.get();
NPP_GetValueProcPtr NPP_GetValue = module->functionPointer<NPP_GetValueProcPtr>("NP_GetValue");
if (!NPP_GetValue)
char* buffer;
NPError error = NPP_GetValue(0, NPPVpluginNameString, &buffer);
if (error == NPERR_NO_ERROR)
- metaData.name = String::fromUTF8(buffer);
+ plugin.info.name = String::fromUTF8(buffer);
error = NPP_GetValue(0, NPPVpluginDescriptionString, &buffer);
if (error == NPERR_NO_ERROR)
- metaData.description = String::fromUTF8(buffer);
+ plugin.info.desc = String::fromUTF8(buffer);
String mimeDescription = String::fromUTF8(NP_GetMIMEDescription());
if (mimeDescription.isNull())
return false;
- metaData.mimeDescription = mimeDescription;
+ setMIMEDescription(mimeDescription, plugin);
return true;
}
-
bool NetscapePluginModule::getPluginInfo(const String& pluginPath, PluginModuleInfo& plugin)
{
- RawPluginMetaData metaData;
- if (!PluginProcessProxy::scanPlugin(pluginPath, metaData))
+ // Tempararily suppress stdout in this function as plugins will be loaded and shutdown and debug info
+ // is leaked to layout test output.
+ StdoutDevNullRedirector stdoutDevNullRedirector;
+
+ // We are loading the plugin here since it does not seem to be a standardized way to
+ // get the needed informations from a UNIX plugin without loading it.
+ RefPtr<NetscapePluginModule> pluginModule = NetscapePluginModule::getOrCreate(pluginPath);
+ if (!pluginModule)
return false;
- plugin.path = pluginPath;
- plugin.info.file = pathGetFileName(pluginPath);
- plugin.info.name = metaData.name;
- plugin.info.desc = metaData.description;
- parseMIMEDescription(metaData.mimeDescription, plugin.info.mimes);
+ pluginModule->incrementLoadCount();
+ bool returnValue = pluginModule->getPluginInfoForLoadedPlugin(plugin);
+ pluginModule->decrementLoadCount();
- return true;
+ return returnValue;
}
void NetscapePluginModule::determineQuirks()
{
#if CPU(X86_64)
- RawPluginMetaData metaData;
- if (!getPluginInfoForLoadedPlugin(metaData))
+ PluginModuleInfo plugin;
+ if (!getPluginInfoForLoadedPlugin(plugin))
return;
- Vector<MimeClassInfo> mimeTypes;
- parseMIMEDescription(metaData.mimeDescription, mimeTypes);
+ Vector<MimeClassInfo> mimeTypes = plugin.info.mimes;
for (size_t i = 0; i < mimeTypes.size(); ++i) {
if (mimeTypes[i].type == "application/x-shockwave-flash") {
m_pluginQuirks.add(PluginQuirks::IgnoreRightClickInWindowlessMode);
#endif
}
-static String truncateToSingleLine(const String& string)
-{
- ASSERT_ARG(string, !string.is8Bit());
-
- unsigned oldLength = string.length();
- UChar* buffer;
- String stringBuffer(StringImpl::createUninitialized(oldLength + 1, buffer));
-
- unsigned newLength = 0;
- for (const UChar* c = string.characters16(); c < string.characters16() + oldLength; ++c) {
- if (*c != UChar('\n'))
- buffer[newLength++] = *c;
- }
- buffer[newLength++] = UChar('\n');
-
- if (newLength == oldLength + 1)
- return stringBuffer;
- return String(stringBuffer.characters16(), newLength);
-}
-
-bool NetscapePluginModule::scanPlugin(const String& pluginPath)
-{
- // We are loading the plugin here since it does not seem to be a standardized way to
- // get the needed informations from a UNIX plugin without loading it.
- RefPtr<NetscapePluginModule> pluginModule = NetscapePluginModule::getOrCreate(pluginPath);
- if (!pluginModule)
- return false;
-
- pluginModule->incrementLoadCount();
- RawPluginMetaData metaData;
- bool success = pluginModule->getPluginInfoForLoadedPlugin(metaData);
- pluginModule->decrementLoadCount();
-
- if (!success)
- return false;
-
- // Write data to standard output for the UI process.
- String output[3] = {
- truncateToSingleLine(metaData.name),
- truncateToSingleLine(metaData.description),
- truncateToSingleLine(metaData.mimeDescription)
- };
- for (unsigned i = 0; i < 3; ++i) {
- const String& line = output[i];
- const char* current = reinterpret_cast<const char*>(line.characters16());
- const char* end = reinterpret_cast<const char*>(line.characters16()) + (line.length() * sizeof(UChar));
- while (current < end) {
- int result;
- while ((result = fputc(*current, stdout)) == EOF && errno == EINTR) { }
- ASSERT(result != EOF);
- ++current;
- }
- }
-
- fflush(stdout);
-
- return true;
-}
-
} // namespace WebKit
#endif // PLUGIN_ARCHITECTURE(X11)
+++ /dev/null
-/*
- * Copyright (C) 2012 University of Szeged. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * 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 UNIVERSITY OF SZEGED ``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 UNIVERSITY OF SZEGED 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 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <wtf/text/WTFString.h>
-
-#ifndef ProcessExecutablePath_h
-#define ProcessExecutablePath_h
-
-namespace WebKit {
-
-String executablePathOfWebProcess();
-String executablePathOfPluginProcess();
-
-}
-
-#endif
+++ /dev/null
-/*
- * Copyright (C) 2010 Apple Inc. All rights reserved.
- * Portions Copyright (c) 2010 Motorola Mobility, Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * 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 MOTOROLA INC. AND ITS 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 MOTOROLA INC. OR ITS 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
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "ProcessExecutablePath.h"
-
-#include <WebCore/FileSystem.h>
-#include <glib.h>
-#include <wtf/gobject/GlibUtilities.h>
-
-using namespace WebCore;
-
-namespace WebKit {
-
-const char* gWebKitWebProcessName = "WebKitWebProcess";
-const char* gWebKitPluginProcessName = "WebKitPluginProcess";
-
-static String findWebKitProcess(const char* processName)
-{
- const char* execDirectory = g_getenv("WEBKIT_EXEC_PATH");
- if (execDirectory) {
- String processPath = pathByAppendingComponent(filenameToString(execDirectory), processName);
- if (fileExists(processPath))
- return processPath;
- }
-
- static bool gotExecutablePath = false;
- static String executablePath;
- if (!gotExecutablePath) {
- gotExecutablePath = true;
-
- CString executableFile = getCurrentExecutablePath();
- if (!executableFile.isNull())
- executablePath = directoryName(filenameToString(executableFile.data()));
- }
-
- if (!executablePath.isNull()) {
- String processPath = pathByAppendingComponent(executablePath, processName);
- if (fileExists(processPath))
- return processPath;
- }
-
- return pathByAppendingComponent(filenameToString(LIBEXECDIR), processName);
-}
-
-String executablePathOfWebProcess()
-{
- return findWebKitProcess(gWebKitWebProcessName);
-}
-
-String executablePathOfPluginProcess()
-{
- return findWebKitProcess(gWebKitPluginProcessName);
-}
-
-} // namespace WebKit
+++ /dev/null
-/*
- * Copyright (C) 2010 Apple Inc. All rights reserved.
- * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * 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''
- * 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
- * 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
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "ProcessExecutablePath.h"
-
-#include <QCoreApplication>
-#include <QDir>
-#include <QFile>
-
-namespace WebKit {
-
-static String executablePath(QLatin1String baseName)
-{
- QString expectedPath = QCoreApplication::applicationDirPath() + QDir::separator() + baseName;
- if (QFile::exists(expectedPath))
- return String(expectedPath);
- return String(QString(baseName));
-}
-
-String executablePathOfWebProcess()
-{
- return executablePath(QStringLiteral("QtWebProcess"));
-}
-
-String executablePathOfPluginProcess()
-{
- return executablePath(QStringLiteral("QtWebPluginProcess"));
-}
-
-} // namespace WebKit
#include <QImage>
#include <QPainter>
-#include <QtGlobal>
#include <WebCore/BitmapImage.h>
#include <WebCore/GraphicsContext.h>
#include <WebCore/NotImplemented.h>
painter->drawImage(dstPoint, image, QRect(srcRect));
}
-void ShareableBitmap::paint(GraphicsContext& context, float scaleFactor, const IntPoint& dstPoint, const IntRect& srcRect)
+void ShareableBitmap::paint(GraphicsContext& /*context*/, float /*scaleFactor*/, const IntPoint& /*dstPoint*/, const IntRect& /*srcRect*/)
{
- if (qFuzzyCompare(scaleFactor, 1)) {
- paint(context, dstPoint, srcRect);
- return;
- }
-
// See <https://bugs.webkit.org/show_bug.cgi?id=64663>.
notImplemented();
}
Platform/SharedMemory.h \
Platform/WorkQueue.h \
PluginProcess/PluginControllerProxy.h \
- PluginProcess/PluginCreationParameters.h \
PluginProcess/PluginProcess.h \
PluginProcess/WebProcessConnection.h \
Shared/API/c/WKBase.h \
Shared/OriginAndDatabases.h \
Shared/PlatformPopupMenuData.h \
Shared/PrintInfo.h \
- Shared/ProcessExecutablePath.h \
Shared/SameDocumentNavigationType.h \
Shared/SecurityOriginData.h \
Shared/SessionState.h \
Platform/WorkQueue.cpp \
Platform/qt/ModuleQt.cpp \
PluginProcess/PluginControllerProxy.cpp \
- PluginProcess/PluginCreationParameters.cpp \
PluginProcess/PluginProcess.cpp \
PluginProcess/WebProcessConnection.cpp \
PluginProcess/qt/PluginControllerProxyQt.cpp \
Shared/qt/NativeWebKeyboardEventQt.cpp \
Shared/qt/NativeWebMouseEventQt.cpp \
Shared/qt/NativeWebWheelEventQt.cpp \
- Shared/qt/ProcessExecutablePathQt.cpp \
Shared/qt/WebCoreArgumentCodersQt.cpp \
Shared/qt/WebEventFactoryQt.cpp \
Shared/qt/QtNetworkReplyData.cpp \
plugin_backend_xlib {
DEFINES += XP_UNIX
- PKGCONFIG += x11
}
include(DerivedSources.pri)
void invalidate();
static bool getProcessTypeFromString(const char*, ProcessType&);
+
private:
ProcessLauncher(Client*, const LaunchOptions& launchOptions);
#include "ProcessLauncher.h"
#include "Connection.h"
-#include "ProcessExecutablePath.h"
#include <WebCore/FileSystem.h>
#include <WebCore/ResourceHandle.h>
#include <WebCore/RunLoop.h>
namespace WebKit {
+const char* gWebKitWebProcessName = "WebKitWebProcess";
+const char* gWebKitPluginProcessName = "WebKitPluginProcess";
+
static void childSetupFunction(gpointer userData)
{
int socket = GPOINTER_TO_INT(userData);
close(GPOINTER_TO_INT(userData));
}
+static CString findWebKitProcess(const char* processName)
+{
+ const char* execDirectory = g_getenv("WEBKIT_EXEC_PATH");
+ if (execDirectory) {
+ String processPath = pathByAppendingComponent(filenameToString(execDirectory), processName);
+ if (fileExists(processPath))
+ return fileSystemRepresentation(processPath);
+ }
+
+ static bool gotExecutablePath = false;
+ static String executablePath;
+ if (!gotExecutablePath) {
+ gotExecutablePath = true;
+
+ CString executableFile = getCurrentExecutablePath();
+ if (!executableFile.isNull())
+ executablePath = directoryName(filenameToString(executableFile.data()));
+ }
+
+ if (!executablePath.isNull()) {
+ String processPath = pathByAppendingComponent(executablePath, processName);
+ if (fileExists(processPath))
+ return fileSystemRepresentation(processPath);
+ }
+
+ return fileSystemRepresentation(pathByAppendingComponent(filenameToString(LIBEXECDIR), processName));
+}
+
void ProcessLauncher::launchProcess()
{
GPid pid = 0;
return;
}
- String executablePath = m_launchOptions.processType == WebProcess ?
- executablePathOfWebProcess() : executablePathOfPluginProcess();
- CString binaryPath = fileSystemRepresentation(executablePath);
+ CString binaryPath = findWebKitProcess(m_launchOptions.processType == ProcessLauncher::WebProcess ? gWebKitWebProcessName : gWebKitPluginProcessName);
GOwnPtr<gchar> socket(g_strdup_printf("%d", sockets[0]));
char* argv[3];
argv[0] = const_cast<char*>(binaryPath.data());
#include "ProcessLauncher.h"
#include "Connection.h"
-#include "ProcessExecutablePath.h"
#include "WebProcess.h"
+#include <QCoreApplication>
#include <QDebug>
+#include <QFile>
#include <QLocalServer>
#include <QMetaType>
#include <QProcess>
void ProcessLauncher::launchProcess()
{
- QString commandLine = QLatin1String("%1 %2");
- commandLine = commandLine.arg(m_launchOptions.processType == WebProcess ?
- executablePathOfWebProcess() : executablePathOfPluginProcess());
+ QString applicationPath = QLatin1String("%1 %2");
+
+ if (QFile::exists(QCoreApplication::applicationDirPath() + QLatin1String("/QtWebProcess"))) {
+ applicationPath = applicationPath.arg(QCoreApplication::applicationDirPath() + QLatin1String("/QtWebProcess"));
+ } else {
+ applicationPath = applicationPath.arg(QLatin1String("QtWebProcess"));
+ }
#if OS(DARWIN)
// Create the listening port.
kern_return_t kr = bootstrap_register2(bootstrap_port, const_cast<char*>(serviceName.toUtf8().data()), connector, 0);
ASSERT_UNUSED(kr, kr == KERN_SUCCESS);
- commandLine = commandLine.arg(serviceName);
+ QString program(applicationPath.arg(serviceName));
#else
int sockets[2];
if (socketpair(AF_UNIX, SOCKET_TYPE, 0, sockets) == -1) {
}
int connector = sockets[1];
- commandLine = commandLine.arg(sockets[0]);
+ QString program(applicationPath.arg(sockets[0]));
#endif
QProcess* webProcess = new QtWebProcess();
webProcess->setProcessChannelMode(QProcess::ForwardedChannels);
- webProcess->start(commandLine);
+ webProcess->start(program);
#if !OS(DARWIN)
// Don't expose the web socket to possible future web processes
#endif
if (!webProcess->waitForStarted()) {
- qDebug() << "Failed to start" << commandLine;
+ qDebug() << "Failed to start" << program;
ASSERT_NOT_REACHED();
#if OS(DARWIN)
mach_port_deallocate(mach_task_self(), connector);
class WebProcessProxy;
struct PluginProcessCreationParameters;
-#if PLUGIN_ARCHITECTURE(X11)
-struct RawPluginMetaData {
- String name;
- String description;
- String mimeDescription;
-};
-#endif
-
class PluginProcessProxy : public RefCounted<PluginProcessProxy>, CoreIPC::Connection::Client, ProcessLauncher::Client {
public:
static PassRefPtr<PluginProcessProxy> create(PluginProcessManager*, const PluginModuleInfo&);
static bool createPropertyListFile(const PluginModuleInfo&);
#endif
-#if PLUGIN_ARCHITECTURE(X11)
- static bool scanPlugin(const String& pluginPath, RawPluginMetaData& result);
-#endif
-
private:
PluginProcessProxy(PluginProcessManager*, const PluginModuleInfo&);
#if ENABLE(PLUGIN_PROCESS)
#include "PluginProcessCreationParameters.h"
-#include "ProcessExecutablePath.h"
-#include <WebCore/FileSystem.h>
-#include <glib.h>
-#include <wtf/text/CString.h>
-#include <wtf/text/WTFString.h>
-
-using namespace WebCore;
+#include <WebCore/NotImplemented.h>
namespace WebKit {
-void PluginProcessProxy::platformInitializePluginProcess(PluginProcessCreationParameters&)
-{
-}
-
-bool PluginProcessProxy::scanPlugin(const String& pluginPath, RawPluginMetaData& result)
+void PluginProcessProxy::platformInitializePluginProcess(PluginProcessCreationParameters& parameters)
{
- CString binaryPath = fileSystemRepresentation(executablePathOfPluginProcess());
- CString pluginPathCString = fileSystemRepresentation(pluginPath);
- char* argv[4];
- argv[0] = const_cast<char*>(binaryPath.data());
- argv[1] = const_cast<char*>("-scanPlugin");
- argv[2] = const_cast<char*>(pluginPathCString.data());
- argv[3] = 0;
-
- gint status;
- gchar* stdOut;
- 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);
- while (lineIndex < kNumLinesExpected) {
- const UChar* start = current;
- while (*current++ != UChar('\n')) { }
- lines[lineIndex++] = String(start, current - start - 1);
- }
-
- result.name.swap(lines[0]);
- result.description.swap(lines[1]);
- result.mimeDescription.swap(lines[2]);
- return !result.mimeDescription.isEmpty();
+ notImplemented();
}
} // namespace WebKit
#if ENABLE(PLUGIN_PROCESS)
-#include "ProcessExecutablePath.h"
-#include <QByteArray>
-#include <QCoreApplication>
-#include <QDir>
-#include <QEventLoop>
-#include <QProcess>
-#include <QString>
+#include "PluginProcessCreationParameters.h"
+#include <WebCore/NotImplemented.h>
namespace WebKit {
-class PluginProcessCreationParameters;
-
-void PluginProcessProxy::platformInitializePluginProcess(PluginProcessCreationParameters&)
+void PluginProcessProxy::platformInitializePluginProcess(PluginProcessCreationParameters& parameters)
{
-}
-
-bool PluginProcessProxy::scanPlugin(const String& pluginPath, RawPluginMetaData& result)
-{
- QString commandLine = QLatin1String("%1 %2 %3");
- commandLine = commandLine.arg(executablePathOfPluginProcess());
- commandLine = commandLine.arg(QStringLiteral("-scanPlugin")).arg(static_cast<QString>(pluginPath));
-
- QProcess process;
- process.setReadChannel(QProcess::StandardOutput);
- process.start(commandLine);
-
- if (!process.waitForFinished()
- || process.exitStatus() != QProcess::NormalExit
- || process.exitCode() != EXIT_SUCCESS) {
- process.kill();
- return false;
- }
-
- QByteArray outputBytes = process.readAll();
- ASSERT(!(outputBytes.size() % sizeof(UChar)));
-
- String output(reinterpret_cast<const UChar*>(outputBytes.constData()), outputBytes.size() / sizeof(UChar));
- Vector<String> lines;
- output.split(UChar('\n'), lines);
- ASSERT(lines.size() == 3);
-
- result.name.swap(lines[0]);
- result.description.swap(lines[1]);
- result.mimeDescription.swap(lines[2]);
- return !result.mimeDescription.isEmpty();
+ notImplemented();
}
} // namespace WebKit
break;
case NPNVToolkit: {
- // Gtk based plugins need to be assured about the toolkit version.
- const uint32_t expectedGtkToolKitVersion = 2;
- *reinterpret_cast<uint32_t*>(value) = expectedGtkToolKitVersion;
+#if PLATFORM(GTK)
+ *reinterpret_cast<uint32_t*>(value) = 2;
+#else
+ const uint32_t expectedGTKToolKitVersion = 2;
+
+ // Set the expected GTK version if we know that this plugin needs it or if the plugin call us
+ // with a null instance. The latter is the case with NSPluginWrapper plugins.
+ bool requiresGTKToolKitVersion;
+ if (!npp)
+ requiresGTKToolKitVersion = true;
+ else {
+ RefPtr<NetscapePlugin> plugin = NetscapePlugin::fromNPP(npp);
+ requiresGTKToolKitVersion = plugin->quirks().contains(PluginQuirks::RequiresGTKToolKit);
+ }
+
+ *reinterpret_cast<uint32_t*>(value) = requiresGTKToolKitVersion ? expectedGTKToolKitVersion : 0;
+#endif
break;
}
+++ /dev/null
-/*
- * Copyright (C) 2011 Apple Inc. All rights reserved.
- * Copyright (C) 2011 University of Szeged. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * 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''
- * 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
- * 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
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-
-#include <QLibrary>
-#include <QtGlobal>
-
-namespace WebKit {
-Q_DECL_IMPORT int PluginProcessMain(int argc, char** argv);
-}
-
-int main(int argc, char** argv)
-{
- return WebKit::PluginProcessMain(argc, argv);
-}
+2012-04-02 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r112868, r112879, and r112881.
+ http://trac.webkit.org/changeset/112868
+ http://trac.webkit.org/changeset/112879
+ http://trac.webkit.org/changeset/112881
+ https://bugs.webkit.org/show_bug.cgi?id=82901
+
+ "Build fail on bots." (Requested by kbalazs on #webkit).
+
+ * MiniBrowser/gtk/GNUmakefile.am:
+ * qmake/mkspecs/features/features.prf:
+
2012-04-02 Philippe Normand <pnormand@igalia.com>
[GTK] Enable shadow-dom in build-webkit.
Programs_MiniBrowser_LDADD = \
libwebkit2gtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la \
$(GLIB_LIBS) \
- $(GTK_LIBS) \
- $(LIBSOUP_LIBS)
+ $(GTK_LIBS)
Programs_MiniBrowser_LDFLAGS = \
-no-fast-install \
no_webkit2 {
DEFINES += PLUGIN_ARCHITECTURE_UNSUPPORTED=1
} else {
- contains(QT_CONFIG, xcb-xlib) {
+ # Disable xlib plugins while they're in-process, because they crash
+ # as soon as an installed npapi plugin uses Qt 4.
+ false:contains(QT_CONFIG, xcb-xlib) {
CONFIG += plugin_backend_xlib
DEFINES += PLUGIN_ARCHITECTURE_X11=1 \
- PLUGIN_ARCHITECTURE_UNSUPPORTED=0 \
- ENABLE_PLUGIN_PROCESS=1
+ PLUGIN_ARCHITECTURE_UNSUPPORTED=0
} else {
DEFINES += PLUGIN_ARCHITECTURE_UNSUPPORTED=1
}