[Qt][WK2] Set up plugin process on Unix
authorkbalazs@webkit.org <kbalazs@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 2 Apr 2012 13:08:27 +0000 (13:08 +0000)
committerkbalazs@webkit.org <kbalazs@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 2 Apr 2012 13:08:27 +0000 (13:08 +0000)
commit3e8817359d078c47b520f3267ee55b6e956f42aa
tree5d9af0475a83150d6b897b0b64be1cf9a14e039f
parent28331f21ac78c9671883b5bc5eb09cbde8f37de8
[Qt][WK2] Set up plugin process on Unix
https://bugs.webkit.org/show_bug.cgi?id=72121

Reviewed by Simon Hausmann.

.:

* Source/QtWebKit.pro: Add PluginProcess subproject.

Source/WebKit2:

Setup plugin process for Qt and move the task of querying the plugins
to this process in order to avoid crashes due to plugin bugs or library
incompatibility.

* GNUmakefile.am:
* PluginProcess.pro: Added.

* PluginProcess/gtk/PluginProcessMainGtk.cpp:
(WebKit::PluginProcessMainGtk):
* PluginProcess/qt/PluginProcessMainQt.cpp:
(WebKit::messageHandler):
(WebKit::initializeGtk):
(WebKit):
(WebKit::PluginProcessMain):
Implement entry point of the plugin process.
Handle -scanPlugin command line switch: produce meta data
of plugin on standard output and terminate. Move Gtk initialization
hack to there.

* Shared/Plugins/Netscape/NetscapePluginModule.cpp:
(WebKit::NetscapePluginModule::tryLoad):
Get rid of the Gtk initialization hack. We do not nead it here anymore.

* Shared/Plugins/Netscape/NetscapePluginModule.h:
(WebKit):
(NetscapePluginModule):
* Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp:
(WebKit::parseMIMEDescription):
(WebKit::NetscapePluginModule::getPluginInfoForLoadedPlugin):
(WebKit):
(WebKit::NetscapePluginModule::getPluginInfo):
Get plugin meta data via PluginProcessproxy. If a failure
happened we ignore to use the plugin. Remove the concept
of stdout redirection since we can control it when launching
the process.

(WebKit::NetscapePluginModule::determineQuirks):
(WebKit::truncateToSingleLine):
(WebKit::NetscapePluginModule::scanPlugin):
Produce plugin meta data on standard output.

* Shared/ProcessExecutablePath.h: Added.
(WebKit):
* Shared/gtk/ProcessExecutablePathGtk.cpp: Added.
(findWebKitProcess):
(executablePathOfWebProcess):
(executablePathOfPluginProcess):
* Shared/qt/ProcessExecutablePathQt.cpp: Copied from Source/WebKit2/UIProcess/Plugins/qt/PluginProcessProxyQt.cpp.
(WebKit):
(WebKit::executablePath):
(WebKit::executablePathOfWebProcess):
(WebKit::executablePathOfPluginProcess):
Factored the executable path determination into free functions
to avoid code duplication.

* Shared/qt/ShareableBitmapQt.cpp:
(WebKit::ShareableBitmap::paint):
Added implementation for the override with the scale factor because
it is called from PluginProxy. It does not actually handle the case
when the scale factor is not 1. However it's ok because it can only
happen on Mac in the moment.

* Target.pri:
* UIProcess/Launcher/ProcessLauncher.h:
(ProcessLauncher):
* UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp:
(WebKit::ProcessLauncher::launchProcess):
* UIProcess/Launcher/qt/ProcessLauncherQt.cpp:
(WebKit::ProcessLauncher::launchProcess):
Use the new functions to determine the executable path.

* UIProcess/Plugins/PluginProcessProxy.h:
(WebKit):
(RawPluginMetaData):
(PluginProcessProxy):
* UIProcess/Plugins/gtk/PluginProcessProxyGtk.cpp:
(WebKit::PluginProcessProxy::platformInitializePluginProcess):
(WebKit):
(WebKit::PluginProcessProxy::scanPlugin):
* UIProcess/Plugins/qt/PluginProcessProxyQt.cpp:
(WebKit):
(WebKit::PluginProcessProxy::platformInitializePluginProcess):
(WebKit::PluginProcessProxy::scanPlugin):
Launch plugin process and parse it's output to get the meta data
for the plugin.

* WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
(WebKit::NPN_GetValue):
Changed according to the removing of the flash hack. Do not try
to decide whether the plugin needs Gtk by it's name but instead
always get back the expected Gtk version (2). Only Gtk plugins
should ask for this anyway.

* qt/PluginMainQt.cpp: Copied from Source/WebKit2/UIProcess/Plugins/gtk/PluginProcessProxyGtk.cpp.
(WebKit):
(main):

Tools:

* qmake/mkspecs/features/features.prf: Reenable plugins
and turn on plugin process.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@112868 268f45cc-cd09-0410-ab3c-d52691b4dbfc
26 files changed:
ChangeLog
Source/QtWebKit.pro
Source/WebKit2/ChangeLog
Source/WebKit2/GNUmakefile.am
Source/WebKit2/PluginProcess.pro [new file with mode: 0644]
Source/WebKit2/PluginProcess/gtk/PluginProcessMainGtk.cpp
Source/WebKit2/PluginProcess/qt/PluginProcessMainQt.cpp
Source/WebKit2/Shared/Plugins/Netscape/NetscapePluginModule.cpp
Source/WebKit2/Shared/Plugins/Netscape/NetscapePluginModule.h
Source/WebKit2/Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp
Source/WebKit2/Shared/ProcessExecutablePath.h [new file with mode: 0644]
Source/WebKit2/Shared/gtk/ProcessExecutablePathGtk.cpp [new file with mode: 0644]
Source/WebKit2/Shared/qt/ProcessExecutablePathQt.cpp [new file with mode: 0644]
Source/WebKit2/Shared/qt/ShareableBitmapQt.cpp
Source/WebKit2/Target.pri
Source/WebKit2/UIProcess/Launcher/ProcessLauncher.h
Source/WebKit2/UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp
Source/WebKit2/UIProcess/Launcher/qt/ProcessLauncherQt.cpp
Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.h
Source/WebKit2/UIProcess/Plugins/gtk/PluginProcessProxyGtk.cpp
Source/WebKit2/UIProcess/Plugins/qt/PluginProcessProxyQt.cpp
Source/WebKit2/WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp
Source/WebKit2/qt/PluginMainQt.cpp [new file with mode: 0644]
Tools/ChangeLog
Tools/MiniBrowser/gtk/GNUmakefile.am
Tools/qmake/mkspecs/features/features.prf