summaryrefslogtreecommitdiffstats
path: root/Source/WebKit2/WebProcess/Plugins/PluginProcessConnection.cpp
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2011-06-02 12:07:03 +0100
committerBen Murdoch <benm@google.com>2011-06-10 10:47:21 +0100
commit2daae5fd11344eaa88a0d92b0f6d65f8d2255c00 (patch)
treee4964fbd1cb70599f7718ff03e50ea1dab33890b /Source/WebKit2/WebProcess/Plugins/PluginProcessConnection.cpp
parent87bdf0060a247bfbe668342b87e0874182e0ffa9 (diff)
downloadexternal_webkit-2daae5fd11344eaa88a0d92b0f6d65f8d2255c00.zip
external_webkit-2daae5fd11344eaa88a0d92b0f6d65f8d2255c00.tar.gz
external_webkit-2daae5fd11344eaa88a0d92b0f6d65f8d2255c00.tar.bz2
Merge WebKit at r84325: Initial merge by git.
Change-Id: Ic1a909300ecc0a13ddc6b4e784371d2ac6e3d59b
Diffstat (limited to 'Source/WebKit2/WebProcess/Plugins/PluginProcessConnection.cpp')
-rw-r--r--Source/WebKit2/WebProcess/Plugins/PluginProcessConnection.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/Source/WebKit2/WebProcess/Plugins/PluginProcessConnection.cpp b/Source/WebKit2/WebProcess/Plugins/PluginProcessConnection.cpp
index 3d007a6..31e377f 100644
--- a/Source/WebKit2/WebProcess/Plugins/PluginProcessConnection.cpp
+++ b/Source/WebKit2/WebProcess/Plugins/PluginProcessConnection.cpp
@@ -32,14 +32,33 @@
#include "PluginProcessConnectionManager.h"
#include "PluginProxy.h"
#include "WebProcess.h"
+#include "WebProcessProxyMessages.h"
+#include <WebCore/FileSystem.h>
+
+using namespace WebCore;
namespace WebKit {
+// The timeout, in seconds, when sending sync messages to the plug-in.
+static const double syncMessageTimeout = 45;
+
+static double defaultSyncMessageTimeout(const String& pluginPath)
+{
+ // We don't want a message timeout for the AppleConnect plug-in.
+ // FIXME: We should key this off something other than the path.
+ if (pathGetFileName(pluginPath) == "AppleConnect.plugin")
+ return CoreIPC::Connection::NoTimeout;
+
+ return syncMessageTimeout;
+}
+
PluginProcessConnection::PluginProcessConnection(PluginProcessConnectionManager* pluginProcessConnectionManager, const String& pluginPath, CoreIPC::Connection::Identifier connectionIdentifier)
: m_pluginProcessConnectionManager(pluginProcessConnectionManager)
, m_pluginPath(pluginPath)
{
m_connection = CoreIPC::Connection::createClientConnection(connectionIdentifier, this, WebProcess::shared().runLoop());
+
+ m_connection->setDefaultSyncMessageTimeout(defaultSyncMessageTimeout(m_pluginPath));
m_npRemoteObjectMap = NPRemoteObjectMap::create(m_connection.get());
m_connection->open();
@@ -116,6 +135,11 @@ void PluginProcessConnection::didReceiveInvalidMessage(CoreIPC::Connection*, Cor
{
}
+void PluginProcessConnection::syncMessageSendTimedOut(CoreIPC::Connection*)
+{
+ WebProcess::shared().connection()->send(Messages::WebProcessProxy::PluginSyncMessageSendTimedOut(m_pluginPath), 0);
+}
+
} // namespace WebKit
#endif // ENABLE(PLUGIN_PROCESS)