[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
andersca at apple.com
andersca at apple.com
Wed Dec 22 13:53:14 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit dd265f94b12c4807c28ea658881287b4c3baac8c
Author: andersca at apple.com <andersca at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Sep 28 21:27:11 2010 +0000
ASSERT when launching the plugin process
https://bugs.webkit.org/show_bug.cgi?id=46754
<rdar://problem/8484570>
Reviewed by Sam Weinig.
* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::ProcessLauncher::launchProcess):
Don't assert if we fail to launch the process. Instead, set the connection identifier
and process ID to null and deallocate the port we created.
* UIProcess/Plugins/PluginProcessProxy.cpp:
(WebKit::PluginProcessProxy::pluginProcessCrashedOrFailedToLaunch):
Move all code from didClose here.
(WebKit::PluginProcessProxy::didClose):
Call pluginProcessCrashedOrFailedToLaunch.
(WebKit::PluginProcessProxy::didFinishLaunching):
If we failed to launch, call pluginProcessCrashedOrFailedToLaunch.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68562 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 08e45ea..b4a1da7 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -2,6 +2,29 @@
Reviewed by Sam Weinig.
+ ASSERT when launching the plugin process
+ https://bugs.webkit.org/show_bug.cgi?id=46754
+ <rdar://problem/8484570>
+
+ * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
+ (WebKit::ProcessLauncher::launchProcess):
+ Don't assert if we fail to launch the process. Instead, set the connection identifier
+ and process ID to null and deallocate the port we created.
+
+ * UIProcess/Plugins/PluginProcessProxy.cpp:
+ (WebKit::PluginProcessProxy::pluginProcessCrashedOrFailedToLaunch):
+ Move all code from didClose here.
+
+ (WebKit::PluginProcessProxy::didClose):
+ Call pluginProcessCrashedOrFailedToLaunch.
+
+ (WebKit::PluginProcessProxy::didFinishLaunching):
+ If we failed to launch, call pluginProcessCrashedOrFailedToLaunch.
+
+2010-09-28 Anders Carlsson <andersca at apple.com>
+
+ Reviewed by Sam Weinig.
+
Differentiate waitForSyncReply from waitForReply
https://bugs.webkit.org/show_bug.cgi?id=46752
diff --git a/WebKit2/UIProcess/Launcher/mac/ProcessLauncherMac.mm b/WebKit2/UIProcess/Launcher/mac/ProcessLauncherMac.mm
index bff0350..35620d6 100644
--- a/WebKit2/UIProcess/Launcher/mac/ProcessLauncherMac.mm
+++ b/WebKit2/UIProcess/Launcher/mac/ProcessLauncherMac.mm
@@ -130,13 +130,23 @@ void ProcessLauncher::launchProcess()
pid_t processIdentifier;
int result = posix_spawn(&processIdentifier, path, 0, &attr, (char *const*)args, *_NSGetEnviron());
- ASSERT_UNUSED(result, !result);
posix_spawnattr_destroy(&attr);
- // Set up the termination notification handler and then ask the child process to continue.
- setUpTerminationNotificationHandler(processIdentifier);
- kill(processIdentifier, SIGCONT);
+ if (!result) {
+ // Set up the termination notification handler and then ask the child process to continue.
+ setUpTerminationNotificationHandler(processIdentifier);
+ kill(processIdentifier, SIGCONT);
+ } else {
+ // We failed to launch. Release the send right.
+ mach_port_deallocate(mach_task_self(), listeningPort);
+
+ // And the receive right.
+ mach_port_mod_refs(mach_task_self(), listeningPort, MACH_PORT_RIGHT_RECEIVE, -1);
+
+ listeningPort = MACH_PORT_NULL;
+ processIdentifier = 0;
+ }
// We've finished launching the process, message back to the main run loop.
RunLoop::main()->scheduleWork(WorkItem::create(this, &ProcessLauncher::didFinishLaunchingProcess, processIdentifier, listeningPort));
diff --git a/WebKit2/UIProcess/Plugins/PluginProcessProxy.cpp b/WebKit2/UIProcess/Plugins/PluginProcessProxy.cpp
index ddc430d..f08689c 100644
--- a/WebKit2/UIProcess/Plugins/PluginProcessProxy.cpp
+++ b/WebKit2/UIProcess/Plugins/PluginProcessProxy.cpp
@@ -73,13 +73,8 @@ void PluginProcessProxy::createWebProcessConnection(WebProcessProxy* webProcessP
// Ask the plug-in process to create a connection.
m_connection->send(Messages::PluginProcess::CreateWebProcessConnection(), 0);
}
-
-void PluginProcessProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
-{
- didReceivePluginProcessProxyMessage(connection, messageID, arguments);
-}
-void PluginProcessProxy::didClose(CoreIPC::Connection*)
+void PluginProcessProxy::pluginProcessCrashedOrFailedToLaunch()
{
// The plug-in process must have crashed or exited, send any pending sync replies we might have.
while (!m_pendingConnectionReplies.isEmpty()) {
@@ -97,6 +92,16 @@ void PluginProcessProxy::didClose(CoreIPC::Connection*)
delete this;
}
+void PluginProcessProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
+{
+ didReceivePluginProcessProxyMessage(connection, messageID, arguments);
+}
+
+void PluginProcessProxy::didClose(CoreIPC::Connection*)
+{
+ pluginProcessCrashedOrFailedToLaunch();
+}
+
void PluginProcessProxy::didReceiveInvalidMessage(CoreIPC::Connection*, CoreIPC::MessageID)
{
}
@@ -104,6 +109,11 @@ void PluginProcessProxy::didReceiveInvalidMessage(CoreIPC::Connection*, CoreIPC:
void PluginProcessProxy::didFinishLaunching(ProcessLauncher*, CoreIPC::Connection::Identifier connectionIdentifier)
{
ASSERT(!m_connection);
+
+ if (!connectionIdentifier) {
+ pluginProcessCrashedOrFailedToLaunch();
+ return;
+ }
m_connection = CoreIPC::Connection::createServerConnection(connectionIdentifier, this, RunLoop::main());
m_connection->open();
diff --git a/WebKit2/UIProcess/Plugins/PluginProcessProxy.h b/WebKit2/UIProcess/Plugins/PluginProcessProxy.h
index 34c5aa4..b1cc751 100644
--- a/WebKit2/UIProcess/Plugins/PluginProcessProxy.h
+++ b/WebKit2/UIProcess/Plugins/PluginProcessProxy.h
@@ -57,6 +57,8 @@ public:
private:
PluginProcessProxy(PluginProcessManager*, const PluginInfoStore::Plugin&);
+ void pluginProcessCrashedOrFailedToLaunch();
+
// CoreIPC::Connection::Client
virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
virtual void didClose(CoreIPC::Connection*);
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list