summaryrefslogtreecommitdiff
path: root/Source/WebKit2/Platform
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2012-10-16 14:56:46 +0200
committerSimon Hausmann <simon.hausmann@digia.com>2012-10-16 14:57:30 +0200
commitb297e0fa5c217c9467033b7c8b46891a52870120 (patch)
tree43fc14689295e9e64f2719d05aad94e3049f6cd7 /Source/WebKit2/Platform
parent69d517dbfa69903d8593cc1737f0474b21e3251e (diff)
downloadqtwebkit-b297e0fa5c217c9467033b7c8b46891a52870120.tar.gz
Revert "Imported WebKit commit 0dc6cd75e1d4836eaffbb520be96fac4847cc9d2 (http://svn.webkit.org/repository/webkit/trunk@131300)"
This reverts commit 5466563f4b5b6b86523e3f89bb7f77e5b5270c78. Caused OOM issues on some CI machines :(
Diffstat (limited to 'Source/WebKit2/Platform')
-rw-r--r--Source/WebKit2/Platform/CoreIPC/ArgumentCoders.h8
-rw-r--r--Source/WebKit2/Platform/CoreIPC/Connection.cpp40
-rw-r--r--Source/WebKit2/Platform/CoreIPC/Connection.h33
-rw-r--r--Source/WebKit2/Platform/CoreIPC/MessageID.h13
-rw-r--r--Source/WebKit2/Platform/CoreIPC/MessageReceiver.h52
-rw-r--r--Source/WebKit2/Platform/CoreIPC/MessageReceiverMap.cpp77
-rw-r--r--Source/WebKit2/Platform/CoreIPC/MessageReceiverMap.h60
-rw-r--r--Source/WebKit2/Platform/CoreIPC/mac/ConnectionMac.cpp10
-rw-r--r--Source/WebKit2/Platform/Logging.cpp5
-rw-r--r--Source/WebKit2/Platform/Logging.h1
-rw-r--r--Source/WebKit2/Platform/gtk/WorkQueueGtk.cpp4
-rw-r--r--Source/WebKit2/Platform/mac/WorkQueueMac.cpp27
-rw-r--r--Source/WebKit2/Platform/qt/WorkQueueQt.cpp2
13 files changed, 62 insertions, 270 deletions
diff --git a/Source/WebKit2/Platform/CoreIPC/ArgumentCoders.h b/Source/WebKit2/Platform/CoreIPC/ArgumentCoders.h
index af163be6d..dd54dfeef 100644
--- a/Source/WebKit2/Platform/CoreIPC/ArgumentCoders.h
+++ b/Source/WebKit2/Platform/CoreIPC/ArgumentCoders.h
@@ -75,8 +75,8 @@ template<typename T, typename U> struct ArgumentCoder<std::pair<T, U> > {
template<typename KeyType, typename ValueType> struct ArgumentCoder<WTF::KeyValuePair<KeyType, ValueType> > {
static void encode(ArgumentEncoder* encoder, const WTF::KeyValuePair<KeyType, ValueType>& pair)
{
- encoder->encode(pair.key);
- encoder->encode(pair.value);
+ encoder->encode(pair.first);
+ encoder->encode(pair.second);
}
static bool decode(ArgumentDecoder* decoder, WTF::KeyValuePair<KeyType, ValueType>& pair)
@@ -89,8 +89,8 @@ template<typename KeyType, typename ValueType> struct ArgumentCoder<WTF::KeyValu
if (!decoder->decode(value))
return false;
- pair.key = key;
- pair.value = value;
+ pair.first = key;
+ pair.second = value;
return true;
}
};
diff --git a/Source/WebKit2/Platform/CoreIPC/Connection.cpp b/Source/WebKit2/Platform/CoreIPC/Connection.cpp
index 02634874c..b19eb7507 100644
--- a/Source/WebKit2/Platform/CoreIPC/Connection.cpp
+++ b/Source/WebKit2/Platform/CoreIPC/Connection.cpp
@@ -102,12 +102,12 @@ PassRefPtr<Connection::SyncMessageState> Connection::SyncMessageState::getOrCrea
SyncMessageStateMap::AddResult result = syncMessageStateMap().add(runLoop, 0);
if (!result.isNewEntry) {
- ASSERT(result.iterator->value);
- return result.iterator->value;
+ ASSERT(result.iterator->second);
+ return result.iterator->second;
}
RefPtr<SyncMessageState> syncMessageState = adoptRef(new SyncMessageState(runLoop));
- result.iterator->value = syncMessageState.get();
+ result.iterator->second = syncMessageState.get();
return syncMessageState.release();
}
@@ -203,6 +203,7 @@ Connection::Connection(Identifier identifier, bool isServer, Client* client, Run
, m_inDispatchMessageCount(0)
, m_inDispatchMessageMarkedDispatchWhenWaitingForSyncReplyCount(0)
, m_didReceiveInvalidMessage(false)
+ , m_defaultSyncMessageTimeout(NoTimeout)
, m_syncMessageState(SyncMessageState::getOrCreate(clientRunLoop))
, m_shouldWaitForSyncReplies(true)
{
@@ -283,6 +284,13 @@ void Connection::markCurrentlyDispatchedMessageAsInvalid()
m_didReceiveInvalidMessage = true;
}
+void Connection::setDefaultSyncMessageTimeout(double defaultSyncMessageTimeout)
+{
+ ASSERT(defaultSyncMessageTimeout != DefaultTimeout);
+
+ m_defaultSyncMessageTimeout = defaultSyncMessageTimeout;
+}
+
PassOwnPtr<ArgumentEncoder> Connection::createSyncMessageArgumentEncoder(uint64_t destinationID, uint64_t& syncRequestID)
{
OwnPtr<ArgumentEncoder> argumentEncoder = ArgumentEncoder::create(destinationID);
@@ -354,10 +362,10 @@ PassOwnPtr<ArgumentDecoder> Connection::waitForMessage(MessageID messageID, uint
MutexLocker locker(m_waitForMessageMutex);
HashMap<std::pair<unsigned, uint64_t>, ArgumentDecoder*>::iterator it = m_waitForMessageMap.find(messageAndDestination);
- if (it->value) {
+ if (it->second) {
// FIXME: m_waitForMessageMap should really hold OwnPtrs to
// ArgumentDecoders, but HashMap doesn't currently support OwnPtrs.
- OwnPtr<ArgumentDecoder> arguments = adoptPtr(it->value);
+ OwnPtr<ArgumentDecoder> arguments = adoptPtr(it->second);
m_waitForMessageMap.remove(it);
return arguments.release();
@@ -419,6 +427,9 @@ PassOwnPtr<ArgumentDecoder> Connection::sendSyncMessage(MessageID messageID, uin
PassOwnPtr<ArgumentDecoder> Connection::waitForSyncReply(uint64_t syncRequestID, double timeout, unsigned syncSendFlags)
{
+ if (timeout == DefaultTimeout)
+ timeout = m_defaultSyncMessageTimeout;
+
// Use a really long timeout.
if (timeout == NoTimeout)
timeout = 1e10;
@@ -471,6 +482,10 @@ PassOwnPtr<ArgumentDecoder> Connection::waitForSyncReply(uint64_t syncRequestID,
}
+ // We timed out.
+ if (m_client)
+ m_client->syncMessageSendTimedOut(this);
+
return nullptr;
}
@@ -524,8 +539,8 @@ void Connection::processIncomingMessage(MessageID messageID, PassOwnPtr<Argument
HashMap<std::pair<unsigned, uint64_t>, ArgumentDecoder*>::iterator it = m_waitForMessageMap.find(std::make_pair(messageID.toInt(), incomingMessage.destinationID()));
if (it != m_waitForMessageMap.end()) {
- it->value = incomingMessage.releaseArguments().leakPtr();
- ASSERT(it->value);
+ it->second = incomingMessage.releaseArguments().leakPtr();
+ ASSERT(it->second);
m_waitForMessageCondition.signal();
return;
@@ -653,15 +668,6 @@ void Connection::enqueueIncomingMessage(IncomingMessage& incomingMessage)
m_clientRunLoop->dispatch(WTF::bind(&Connection::dispatchOneMessage, this));
}
-void Connection::dispatchMessage(MessageID messageID, ArgumentDecoder* argumentDecoder)
-{
- // Try the message receiver map first.
- if (m_messageReceiverMap.dispatchMessage(this, messageID, argumentDecoder))
- return;
-
- m_client->didReceiveMessage(this, messageID, argumentDecoder);
-}
-
void Connection::dispatchMessage(IncomingMessage& message)
{
OwnPtr<ArgumentDecoder> arguments = message.releaseArguments();
@@ -682,7 +688,7 @@ void Connection::dispatchMessage(IncomingMessage& message)
if (message.messageID().isSync())
dispatchSyncMessage(message.messageID(), arguments.get());
else
- dispatchMessage(message.messageID(), arguments.get());
+ m_client->didReceiveMessage(this, message.messageID(), arguments.get());
m_didReceiveInvalidMessage |= arguments->isInvalid();
m_inDispatchMessageCount--;
diff --git a/Source/WebKit2/Platform/CoreIPC/Connection.h b/Source/WebKit2/Platform/CoreIPC/Connection.h
index 652bcfe30..8850de0d3 100644
--- a/Source/WebKit2/Platform/CoreIPC/Connection.h
+++ b/Source/WebKit2/Platform/CoreIPC/Connection.h
@@ -31,9 +31,9 @@
#include "ArgumentDecoder.h"
#include "ArgumentEncoder.h"
#include "Arguments.h"
-#include "MessageReceiver.h"
-#include "MessageReceiverMap.h"
+#include "MessageID.h"
#include "WorkQueue.h"
+#include <wtf/HashMap.h>
#include <wtf/PassRefPtr.h>
#include <wtf/OwnPtr.h>
#include <wtf/Threading.h>
@@ -85,10 +85,20 @@ while (0)
class Connection : public ThreadSafeRefCounted<Connection> {
public:
+ class MessageReceiver {
+ public:
+ virtual void didReceiveMessage(Connection*, MessageID, ArgumentDecoder*) = 0;
+ virtual void didReceiveSyncMessage(Connection*, MessageID, ArgumentDecoder*, OwnPtr<ArgumentEncoder>&) { ASSERT_NOT_REACHED(); }
+
+ protected:
+ virtual ~MessageReceiver() { }
+ };
+
class Client : public MessageReceiver {
public:
virtual void didClose(Connection*) = 0;
virtual void didReceiveInvalidMessage(Connection*, MessageID) = 0;
+ virtual void syncMessageSendTimedOut(Connection*) = 0;
#if PLATFORM(WIN)
virtual Vector<HWND> windowsToReceiveSentMessagesWhileWaitingForSyncReply() = 0;
@@ -151,8 +161,6 @@ public:
static PassRefPtr<Connection> createClientConnection(Identifier, Client*, WebCore::RunLoop* clientRunLoop);
~Connection();
- Client* client() const { return m_client; }
-
#if OS(DARWIN)
void setShouldCloseConnectionOnMachExceptions();
#elif PLATFORM(QT)
@@ -173,21 +181,19 @@ public:
void addQueueClient(QueueClient*);
void removeQueueClient(QueueClient*);
- void addMessageReceiver(MessageClass messageClass, MessageReceiver* messageReceiver)
- {
- m_messageReceiverMap.addMessageReceiver(messageClass, messageReceiver);
- }
-
bool open();
void invalidate();
void markCurrentlyDispatchedMessageAsInvalid();
+ void setDefaultSyncMessageTimeout(double);
+
void postConnectionDidCloseOnConnectionWorkQueue();
+ static const int DefaultTimeout = 0;
static const int NoTimeout = -1;
template<typename T> bool send(const T& message, uint64_t destinationID, unsigned messageSendFlags = 0);
- template<typename T> bool sendSync(const T& message, const typename T::Reply& reply, uint64_t destinationID, double timeout = NoTimeout, unsigned syncSendFlags = 0);
+ template<typename T> bool sendSync(const T& message, const typename T::Reply& reply, uint64_t destinationID, double timeout = DefaultTimeout, unsigned syncSendFlags = 0);
template<typename T> bool waitForAndDispatchImmediately(uint64_t destinationID, double timeout);
PassOwnPtr<ArgumentEncoder> createSyncMessageArgumentEncoder(uint64_t destinationID, uint64_t& syncRequestID);
@@ -273,9 +279,8 @@ private:
// Called on the listener thread.
void dispatchConnectionDidClose();
- void dispatchOneMessage();
void dispatchMessage(IncomingMessage&);
- void dispatchMessage(MessageID, ArgumentDecoder*);
+ void dispatchOneMessage();
void dispatchSyncMessage(MessageID, ArgumentDecoder*);
void didFailToSendSyncMessage();
@@ -300,12 +305,12 @@ private:
unsigned m_inDispatchMessageMarkedDispatchWhenWaitingForSyncReplyCount;
bool m_didReceiveInvalidMessage;
+ double m_defaultSyncMessageTimeout;
+
// Incoming messages.
Mutex m_incomingMessagesLock;
Deque<IncomingMessage> m_incomingMessages;
- MessageReceiverMap m_messageReceiverMap;
-
// Outgoing messages.
Mutex m_outgoingMessagesLock;
Deque<OutgoingMessage> m_outgoingMessages;
diff --git a/Source/WebKit2/Platform/CoreIPC/MessageID.h b/Source/WebKit2/Platform/CoreIPC/MessageID.h
index 5c21336dd..22d306b04 100644
--- a/Source/WebKit2/Platform/CoreIPC/MessageID.h
+++ b/Source/WebKit2/Platform/CoreIPC/MessageID.h
@@ -29,7 +29,7 @@
namespace CoreIPC {
enum MessageClass {
- MessageClassInvalid = 0,
+ MessageClassReserved = 0,
// Messages sent by Core IPC.
MessageClassCoreIPC,
@@ -37,6 +37,7 @@ enum MessageClass {
// Messages sent by the UI process to the web process.
MessageClassAuthenticationManager,
MessageClassDrawingArea,
+ MessageClassInjectedBundle,
MessageClassLayerTreeCoordinator,
MessageClassWebApplicationCacheManager,
MessageClassWebBatteryManagerProxy,
@@ -51,7 +52,6 @@ enum MessageClass {
MessageClassWebNetworkInfoManagerProxy,
MessageClassWebNotificationManager,
MessageClassWebPage,
- MessageClassWebPageGroupProxy,
MessageClassWebProcess,
MessageClassWebResourceCacheManager,
MessageClassEventDispatcher,
@@ -65,7 +65,6 @@ enum MessageClass {
MessageClassLayerTreeCoordinatorProxy,
MessageClassWebApplicationCacheManagerProxy,
MessageClassWebBatteryManager,
- MessageClassWebConnection,
MessageClassWebContext,
MessageClassWebContextLegacy,
MessageClassWebCookieManagerProxy,
@@ -105,9 +104,6 @@ enum MessageClass {
// NPObject messages sent by both the plug-in process and the web process.
MessageClassNPObjectMessageReceiver,
-
- // Messages sent by the UI process to the network process.
- MessageClassNetworkProcess,
};
template<typename> struct MessageKindTraits { };
@@ -184,11 +180,6 @@ public:
bool shouldDispatchMessageWhenWaitingForSyncReply() const { return getFlags() & DispatchMessageWhenWaitingForSyncReply; }
bool isSync() const { return getFlags() & SyncMessage; }
- MessageClass messageClass() const
- {
- return static_cast<MessageClass>(getClass());
- }
-
private:
static inline unsigned stripMostSignificantBit(unsigned value)
{
diff --git a/Source/WebKit2/Platform/CoreIPC/MessageReceiver.h b/Source/WebKit2/Platform/CoreIPC/MessageReceiver.h
deleted file mode 100644
index f7b61ccdc..000000000
--- a/Source/WebKit2/Platform/CoreIPC/MessageReceiver.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (C) 2012 Apple 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 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.
- */
-
-#ifndef MessageReceiver_h
-#define MessageReceiver_h
-
-#include "MessageID.h"
-#include <wtf/Assertions.h>
-#include <wtf/OwnPtr.h>
-
-namespace CoreIPC {
-
-class ArgumentDecoder;
-class ArgumentEncoder;
-class Connection;
-
-class MessageReceiver {
-public:
- virtual ~MessageReceiver() { }
-
- virtual void didReceiveMessage(Connection*, MessageID, ArgumentDecoder*) = 0;
- virtual void didReceiveSyncMessage(Connection*, MessageID, ArgumentDecoder*, OwnPtr<ArgumentEncoder>&)
- {
- ASSERT_NOT_REACHED();
- }
-};
-
-} // namespace CoreIPC
-
-#endif // MessageReceiver_h
diff --git a/Source/WebKit2/Platform/CoreIPC/MessageReceiverMap.cpp b/Source/WebKit2/Platform/CoreIPC/MessageReceiverMap.cpp
deleted file mode 100644
index e4c666e6b..000000000
--- a/Source/WebKit2/Platform/CoreIPC/MessageReceiverMap.cpp
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright (C) 2012 Apple 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 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 "MessageReceiverMap.h"
-
-#include "MessageReceiver.h"
-
-namespace CoreIPC {
-
-MessageReceiverMap::MessageReceiverMap()
-{
-}
-
-MessageReceiverMap::~MessageReceiverMap()
-{
-}
-
-void MessageReceiverMap::addMessageReceiver(MessageClass messageClass, MessageReceiver* messageReceiver)
-{
- ASSERT(!m_globalMessageReceivers.contains(messageClass));
- m_globalMessageReceivers.set(messageClass, messageReceiver);
-}
-
-void MessageReceiverMap::invalidate()
-{
- m_globalMessageReceivers.clear();
-}
-
-bool MessageReceiverMap::knowsHowToHandleMessage(MessageID messageID) const
-{
- return m_globalMessageReceivers.contains(messageID.messageClass());
-}
-
-bool MessageReceiverMap::dispatchMessage(Connection* connection, MessageID messageID, ArgumentDecoder* argumentDecoder)
-{
- if (MessageReceiver* messageReceiver = m_globalMessageReceivers.get(messageID.messageClass())) {
- messageReceiver->didReceiveMessage(connection, messageID, argumentDecoder);
- return true;
- }
-
- return false;
-}
-
-bool MessageReceiverMap::dispatchSyncMessage(Connection* connection, MessageID messageID, ArgumentDecoder* argumentDecoder, OwnPtr<ArgumentEncoder>& reply)
-{
- if (MessageReceiver* messageReceiver = m_globalMessageReceivers.get(messageID.messageClass())) {
- messageReceiver->didReceiveSyncMessage(connection, messageID, argumentDecoder, reply);
- return true;
- }
-
- return false;
-}
-
-} // namespace CoreIPC
diff --git a/Source/WebKit2/Platform/CoreIPC/MessageReceiverMap.h b/Source/WebKit2/Platform/CoreIPC/MessageReceiverMap.h
deleted file mode 100644
index b3fb2ee2d..000000000
--- a/Source/WebKit2/Platform/CoreIPC/MessageReceiverMap.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (C) 2012 Apple 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 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.
- */
-
-#ifndef MessageReceiverMap_h
-#define MessageReceiverMap_h
-
-#include "MessageID.h"
-#include <wtf/Forward.h>
-#include <wtf/HashMap.h>
-
-namespace CoreIPC {
-
-class ArgumentEncoder;
-class ArgumentDecoder;
-class Connection;
-class MessageReceiver;
-
-class MessageReceiverMap {
-public:
- MessageReceiverMap();
- ~MessageReceiverMap();
-
- void addMessageReceiver(MessageClass, MessageReceiver*);
-
- void invalidate();
- bool knowsHowToHandleMessage(MessageID) const;
-
- bool dispatchMessage(Connection*, MessageID, ArgumentDecoder*);
- bool dispatchSyncMessage(Connection*, MessageID, ArgumentDecoder*, OwnPtr<ArgumentEncoder>&);
-
-private:
- // Message receivers that don't require a destination ID.
- HashMap<unsigned, MessageReceiver*> m_globalMessageReceivers;
-};
-
-};
-
-#endif // MessageReceiverMap_h
diff --git a/Source/WebKit2/Platform/CoreIPC/mac/ConnectionMac.cpp b/Source/WebKit2/Platform/CoreIPC/mac/ConnectionMac.cpp
index 72989dda0..3db1b83d7 100644
--- a/Source/WebKit2/Platform/CoreIPC/mac/ConnectionMac.cpp
+++ b/Source/WebKit2/Platform/CoreIPC/mac/ConnectionMac.cpp
@@ -111,10 +111,7 @@ bool Connection::open()
m_isConnected = true;
// Send the initialize message, which contains a send right for the server to use.
- OwnPtr<ArgumentEncoder> argumentEncoder = ArgumentEncoder::create(0);
- argumentEncoder->encode(MachPort(m_receivePort, MACH_MSG_TYPE_MAKE_SEND));
-
- sendMessage(MessageID(CoreIPCMessage::InitializeConnection), argumentEncoder.release());
+ deprecatedSend(CoreIPCMessage::InitializeConnection, 0, MachPort(m_receivePort, MACH_MSG_TYPE_MAKE_SEND));
// Set the dead name handler for our send port.
initializeDeadNameSource();
@@ -130,10 +127,7 @@ bool Connection::open()
if (m_exceptionPort) {
m_connectionQueue.registerMachPortEventHandler(m_exceptionPort, WorkQueue::MachPortDataAvailable, bind(&Connection::exceptionSourceEventHandler, this));
- OwnPtr<ArgumentEncoder> argumentEncoder = ArgumentEncoder::create(0);
- argumentEncoder->encode(MachPort(m_exceptionPort, MACH_MSG_TYPE_MAKE_SEND));
-
- sendMessage(MessageID(CoreIPCMessage::SetExceptionPort), argumentEncoder.release());
+ deprecatedSend(CoreIPCMessage::SetExceptionPort, 0, MachPort(m_exceptionPort, MACH_MSG_TYPE_MAKE_SEND));
}
return true;
diff --git a/Source/WebKit2/Platform/Logging.cpp b/Source/WebKit2/Platform/Logging.cpp
index df98e724e..17694c993 100644
--- a/Source/WebKit2/Platform/Logging.cpp
+++ b/Source/WebKit2/Platform/Logging.cpp
@@ -37,7 +37,6 @@ 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)
@@ -70,9 +69,6 @@ WTFLogChannel* getChannelFromName(const String& channelName)
if (equalIgnoringCase(channelName, String("KeyHandling")))
return &LogKeyHandling;
- if (equalIgnoringCase(channelName, String("Plugins")))
- return &LogPlugins;
-
return 0;
}
#endif
@@ -87,7 +83,6 @@ void initializeLogChannelsIfNecessary()
initializeLogChannel(&LogContextMenu);
initializeLogChannel(&LogIconDatabase);
initializeLogChannel(&LogKeyHandling);
- initializeLogChannel(&LogPlugins);
initializeLogChannel(&LogSessionState);
initializeLogChannel(&LogTextInput);
initializeLogChannel(&LogView);
diff --git a/Source/WebKit2/Platform/Logging.h b/Source/WebKit2/Platform/Logging.h
index 603686f3d..173d604e9 100644
--- a/Source/WebKit2/Platform/Logging.h
+++ b/Source/WebKit2/Platform/Logging.h
@@ -40,7 +40,6 @@ namespace WebKit {
extern WTFLogChannel LogContextMenu;
extern WTFLogChannel LogIconDatabase;
extern WTFLogChannel LogKeyHandling;
-extern WTFLogChannel LogPlugins;
extern WTFLogChannel LogSessionState;
extern WTFLogChannel LogTextInput;
extern WTFLogChannel LogView;
diff --git a/Source/WebKit2/Platform/gtk/WorkQueueGtk.cpp b/Source/WebKit2/Platform/gtk/WorkQueueGtk.cpp
index 6885d485b..1dfab83cc 100644
--- a/Source/WebKit2/Platform/gtk/WorkQueueGtk.cpp
+++ b/Source/WebKit2/Platform/gtk/WorkQueueGtk.cpp
@@ -166,7 +166,7 @@ void WorkQueue::registerEventSourceHandler(int fileDescriptor, int condition, co
Vector<EventSource*> sources;
EventSourceIterator it = m_eventSources.find(fileDescriptor);
if (it != m_eventSources.end())
- sources = it->value;
+ sources = it->second;
sources.append(eventSource);
m_eventSources.set(fileDescriptor, sources);
@@ -186,7 +186,7 @@ void WorkQueue::unregisterEventSourceHandler(int fileDescriptor)
ASSERT(m_eventSources.contains(fileDescriptor));
if (it != m_eventSources.end()) {
- Vector<EventSource*> sources = it->value;
+ Vector<EventSource*> sources = it->second;
for (unsigned i = 0; i < sources.size(); i++)
sources[i]->cancel();
diff --git a/Source/WebKit2/Platform/mac/WorkQueueMac.cpp b/Source/WebKit2/Platform/mac/WorkQueueMac.cpp
index ded1d7ac3..9e57e150c 100644
--- a/Source/WebKit2/Platform/mac/WorkQueueMac.cpp
+++ b/Source/WebKit2/Platform/mac/WorkQueueMac.cpp
@@ -30,39 +30,30 @@
#include <mach/mach_port.h>
#include <wtf/PassOwnPtr.h>
-struct WorkQueueAndFunction {
- WorkQueueAndFunction(WorkQueue* workQueue, const Function<void()>& function)
- : workQueue(workQueue)
- , function(function)
- {
- }
-
- WorkQueue* workQueue;
- Function<void()> function;
-};
-
void WorkQueue::executeFunction(void* context)
{
- OwnPtr<WorkQueueAndFunction> workQueueAndFunction = adoptPtr(static_cast<WorkQueueAndFunction*>(context));
+ WorkQueue* queue = static_cast<WorkQueue*>(dispatch_get_context(dispatch_get_current_queue()));
+ OwnPtr<Function<void()> > function = adoptPtr(static_cast<Function<void()>*>(context));
{
- MutexLocker locker(workQueueAndFunction->workQueue->m_isValidMutex);
- if (!workQueueAndFunction->workQueue->m_isValid)
+ MutexLocker locker(queue->m_isValidMutex);
+ if (!queue->m_isValid)
return;
}
- (workQueueAndFunction->function)();
+ (*function)();
}
void WorkQueue::dispatch(const Function<void()>& function)
{
- dispatch_async_f(m_dispatchQueue, new WorkQueueAndFunction(this, function), executeFunction);
+ dispatch_async_f(m_dispatchQueue, new Function<void()>(function), executeFunction);
}
void WorkQueue::dispatchAfterDelay(const Function<void()>& function, double delay)
{
dispatch_time_t delayTime = dispatch_time(DISPATCH_TIME_NOW, delay * NSEC_PER_SEC);
- dispatch_after_f(delayTime, m_dispatchQueue, new WorkQueueAndFunction(this, function), executeFunction);
+
+ dispatch_after_f(delayTime, m_dispatchQueue, new Function<void()>(function), executeFunction);
}
class WorkQueue::EventSource {
@@ -164,7 +155,7 @@ void WorkQueue::unregisterMachPortEventHandler(mach_port_t machPort)
ASSERT(m_eventSources.contains(machPort));
- EventSource* eventSource = it->value;
+ EventSource* eventSource = it->second;
// Cancel and release the source. It will be deleted in its finalize handler.
dispatch_source_cancel(eventSource->dispatchSource());
dispatch_release(eventSource->dispatchSource());
diff --git a/Source/WebKit2/Platform/qt/WorkQueueQt.cpp b/Source/WebKit2/Platform/qt/WorkQueueQt.cpp
index 9b4f4dc96..aaa2be3d0 100644
--- a/Source/WebKit2/Platform/qt/WorkQueueQt.cpp
+++ b/Source/WebKit2/Platform/qt/WorkQueueQt.cpp
@@ -90,7 +90,7 @@ QSocketNotifier* WorkQueue::registerSocketEventHandler(int socketDescriptor, QSo
notifier->moveToThread(m_workThread);
WorkQueue::WorkItemQt* itemQt = new WorkQueue::WorkItemQt(this, notifier, SIGNAL(activated(int)), function);
itemQt->moveToThread(m_workThread);
- QMetaObject::invokeMethod(notifier, "setEnabled", Q_ARG(bool, true));
+ notifier->setEnabled(true);
return notifier;
}