Title: [132142] trunk/Source/WebKit2
Revision
132142
Author
ander...@apple.com
Date
2012-10-22 15:09:56 -0700 (Mon, 22 Oct 2012)

Log Message

Remove MessageReceiverMap::deprecatedAddMessageReceiver
https://bugs.webkit.org/show_bug.cgi?id=100012

Reviewed by Andreas Kling.

Get rid of MessageReceiverMap::deprecatedAddMessageReceiver and make callers use addMessageReceiver instead.
Also, remove the message receiver map inside Connection and add a message receiver map to WebProcess instead.

* Platform/CoreIPC/Connection.cpp:
(CoreIPC::Connection::dispatchMessage):
* Platform/CoreIPC/Connection.h:
(Connection):
* Platform/CoreIPC/MessageReceiverMap.cpp:
(CoreIPC::MessageReceiverMap::invalidate):
(CoreIPC::MessageReceiverMap::dispatchMessage):
(CoreIPC::MessageReceiverMap::dispatchSyncMessage):
* Platform/CoreIPC/MessageReceiverMap.h:
(MessageReceiverMap):
* UIProcess/Notifications/WebNotificationManagerProxy.cpp:
(WebKit::WebNotificationManagerProxy::WebNotificationManagerProxy):
* UIProcess/WebApplicationCacheManagerProxy.cpp:
(WebKit::WebApplicationCacheManagerProxy::WebApplicationCacheManagerProxy):
* UIProcess/WebContext.cpp:
* UIProcess/WebContext.h:
(WebContext):
* UIProcess/WebCookieManagerProxy.cpp:
(WebKit::WebCookieManagerProxy::WebCookieManagerProxy):
* UIProcess/WebDatabaseManagerProxy.cpp:
(WebKit::WebDatabaseManagerProxy::WebDatabaseManagerProxy):
* UIProcess/WebGeolocationManagerProxy.cpp:
(WebKit::WebGeolocationManagerProxy::WebGeolocationManagerProxy):
* UIProcess/WebIconDatabase.cpp:
(WebKit::WebIconDatabase::WebIconDatabase):
* UIProcess/WebKeyValueStorageManagerProxy.cpp:
(WebKit::WebKeyValueStorageManagerProxy::WebKeyValueStorageManagerProxy):
* UIProcess/WebMediaCacheManagerProxy.cpp:
(WebKit::WebMediaCacheManagerProxy::WebMediaCacheManagerProxy):
* UIProcess/WebResourceCacheManagerProxy.cpp:
(WebKit::WebResourceCacheManagerProxy::WebResourceCacheManagerProxy):
* WebProcess/Authentication/AuthenticationManager.cpp:
(WebKit::AuthenticationManager::AuthenticationManager):
* WebProcess/Geolocation/WebGeolocationManager.cpp:
(WebKit::WebGeolocationManager::WebGeolocationManager):
(WebKit::WebGeolocationManager::registerWebPage):
* WebProcess/Geolocation/WebGeolocationManager.h:
(WebGeolocationManager):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::addMessageReceiver):
(WebKit):
(WebKit::WebProcess::didReceiveSyncMessage):
(WebKit::WebProcess::didReceiveMessage):
* WebProcess/WebProcess.h:
(WebProcess):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (132141 => 132142)


--- trunk/Source/WebKit2/ChangeLog	2012-10-22 22:05:34 UTC (rev 132141)
+++ trunk/Source/WebKit2/ChangeLog	2012-10-22 22:09:56 UTC (rev 132142)
@@ -1,3 +1,59 @@
+2012-10-22  Anders Carlsson  <ander...@apple.com>
+
+        Remove MessageReceiverMap::deprecatedAddMessageReceiver
+        https://bugs.webkit.org/show_bug.cgi?id=100012
+
+        Reviewed by Andreas Kling.
+
+        Get rid of MessageReceiverMap::deprecatedAddMessageReceiver and make callers use addMessageReceiver instead.
+        Also, remove the message receiver map inside Connection and add a message receiver map to WebProcess instead.
+
+        * Platform/CoreIPC/Connection.cpp:
+        (CoreIPC::Connection::dispatchMessage):
+        * Platform/CoreIPC/Connection.h:
+        (Connection):
+        * Platform/CoreIPC/MessageReceiverMap.cpp:
+        (CoreIPC::MessageReceiverMap::invalidate):
+        (CoreIPC::MessageReceiverMap::dispatchMessage):
+        (CoreIPC::MessageReceiverMap::dispatchSyncMessage):
+        * Platform/CoreIPC/MessageReceiverMap.h:
+        (MessageReceiverMap):
+        * UIProcess/Notifications/WebNotificationManagerProxy.cpp:
+        (WebKit::WebNotificationManagerProxy::WebNotificationManagerProxy):
+        * UIProcess/WebApplicationCacheManagerProxy.cpp:
+        (WebKit::WebApplicationCacheManagerProxy::WebApplicationCacheManagerProxy):
+        * UIProcess/WebContext.cpp:
+        * UIProcess/WebContext.h:
+        (WebContext):
+        * UIProcess/WebCookieManagerProxy.cpp:
+        (WebKit::WebCookieManagerProxy::WebCookieManagerProxy):
+        * UIProcess/WebDatabaseManagerProxy.cpp:
+        (WebKit::WebDatabaseManagerProxy::WebDatabaseManagerProxy):
+        * UIProcess/WebGeolocationManagerProxy.cpp:
+        (WebKit::WebGeolocationManagerProxy::WebGeolocationManagerProxy):
+        * UIProcess/WebIconDatabase.cpp:
+        (WebKit::WebIconDatabase::WebIconDatabase):
+        * UIProcess/WebKeyValueStorageManagerProxy.cpp:
+        (WebKit::WebKeyValueStorageManagerProxy::WebKeyValueStorageManagerProxy):
+        * UIProcess/WebMediaCacheManagerProxy.cpp:
+        (WebKit::WebMediaCacheManagerProxy::WebMediaCacheManagerProxy):
+        * UIProcess/WebResourceCacheManagerProxy.cpp:
+        (WebKit::WebResourceCacheManagerProxy::WebResourceCacheManagerProxy):
+        * WebProcess/Authentication/AuthenticationManager.cpp:
+        (WebKit::AuthenticationManager::AuthenticationManager):
+        * WebProcess/Geolocation/WebGeolocationManager.cpp:
+        (WebKit::WebGeolocationManager::WebGeolocationManager):
+        (WebKit::WebGeolocationManager::registerWebPage):
+        * WebProcess/Geolocation/WebGeolocationManager.h:
+        (WebGeolocationManager):
+        * WebProcess/WebProcess.cpp:
+        (WebKit::WebProcess::addMessageReceiver):
+        (WebKit):
+        (WebKit::WebProcess::didReceiveSyncMessage):
+        (WebKit::WebProcess::didReceiveMessage):
+        * WebProcess/WebProcess.h:
+        (WebProcess):
+
 2012-10-22  Sudarsana Nagineni  <sudarsana.nagin...@intel.com>
 
         [EFL][WK2] ewk_view_color_picker_color_set() is leaking

Modified: trunk/Source/WebKit2/Platform/CoreIPC/Connection.cpp (132141 => 132142)


--- trunk/Source/WebKit2/Platform/CoreIPC/Connection.cpp	2012-10-22 22:05:34 UTC (rev 132141)
+++ trunk/Source/WebKit2/Platform/CoreIPC/Connection.cpp	2012-10-22 22:09:56 UTC (rev 132142)
@@ -656,10 +656,6 @@
 
 void Connection::dispatchMessage(MessageID messageID, MessageDecoder& decoder)
 {
-    // Try the message receiver map first.
-    if (m_messageReceiverMap.dispatchMessage(this, messageID, decoder))
-        return;
-
     m_client->didReceiveMessage(this, messageID, decoder);
 }
 

Modified: trunk/Source/WebKit2/Platform/CoreIPC/Connection.h (132141 => 132142)


--- trunk/Source/WebKit2/Platform/CoreIPC/Connection.h	2012-10-22 22:05:34 UTC (rev 132141)
+++ trunk/Source/WebKit2/Platform/CoreIPC/Connection.h	2012-10-22 22:09:56 UTC (rev 132142)
@@ -32,7 +32,6 @@
 #include "MessageDecoder.h"
 #include "MessageEncoder.h"
 #include "MessageReceiver.h"
-#include "MessageReceiverMap.h"
 #include "WorkQueue.h"
 #include <wtf/PassRefPtr.h>
 #include <wtf/OwnPtr.h>
@@ -174,11 +173,6 @@
     void addQueueClient(QueueClient*);
     void removeQueueClient(QueueClient*);
 
-    void deprecatedAddMessageReceiver(MessageClass messageClass, MessageReceiver* messageReceiver)
-    {
-        m_messageReceiverMap.deprecatedAddMessageReceiver(messageClass, messageReceiver);
-    }
-
     bool open();
     void invalidate();
     void markCurrentlyDispatchedMessageAsInvalid();
@@ -305,8 +299,6 @@
     Mutex m_incomingMessagesLock;
     Deque<IncomingMessage> m_incomingMessages;
 
-    MessageReceiverMap m_messageReceiverMap;
-
     // Outgoing messages.
     Mutex m_outgoingMessagesLock;
     Deque<OutgoingMessage> m_outgoingMessages;

Modified: trunk/Source/WebKit2/Platform/CoreIPC/MessageReceiverMap.cpp (132141 => 132142)


--- trunk/Source/WebKit2/Platform/CoreIPC/MessageReceiverMap.cpp	2012-10-22 22:05:34 UTC (rev 132141)
+++ trunk/Source/WebKit2/Platform/CoreIPC/MessageReceiverMap.cpp	2012-10-22 22:09:56 UTC (rev 132142)
@@ -45,15 +45,9 @@
     m_globalMessageReceivers.set(messageReceiverName, messageReceiver);
 }
 
-void MessageReceiverMap::deprecatedAddMessageReceiver(MessageClass messageClass, MessageReceiver* messageReceiver)
-{
-    ASSERT(!m_deprecatedGlobalMessageReceivers.contains(messageClass));
-    m_deprecatedGlobalMessageReceivers.set(messageClass, messageReceiver);
-}
-
 void MessageReceiverMap::invalidate()
 {
-    m_deprecatedGlobalMessageReceivers.clear();
+    m_globalMessageReceivers.clear();
 }
 
 bool MessageReceiverMap::dispatchMessage(Connection* connection, MessageID messageID, MessageDecoder& decoder)
@@ -63,11 +57,6 @@
         return true;
     }
 
-    if (MessageReceiver* messageReceiver = m_deprecatedGlobalMessageReceivers.get(messageID.messageClass())) {
-        messageReceiver->didReceiveMessage(connection, messageID, decoder);
-        return true;
-    }
-
     return false;
 }
 
@@ -78,11 +67,6 @@
         return true;
     }
 
-    if (MessageReceiver* messageReceiver = m_deprecatedGlobalMessageReceivers.get(messageID.messageClass())) {
-        messageReceiver->didReceiveSyncMessage(connection, messageID, decoder, replyEncoder);
-        return true;
-    }
-
     return false;
 }
 

Modified: trunk/Source/WebKit2/Platform/CoreIPC/MessageReceiverMap.h (132141 => 132142)


--- trunk/Source/WebKit2/Platform/CoreIPC/MessageReceiverMap.h	2012-10-22 22:05:34 UTC (rev 132141)
+++ trunk/Source/WebKit2/Platform/CoreIPC/MessageReceiverMap.h	2012-10-22 22:09:56 UTC (rev 132142)
@@ -45,9 +45,6 @@
 
     void addMessageReceiver(StringReference messageReceiverName, MessageReceiver*);
 
-    // FIXME: Stop using this deprecated function and get rid of it.
-    void deprecatedAddMessageReceiver(MessageClass, MessageReceiver*);
-
     void invalidate();
 
     bool dispatchMessage(Connection*, MessageID, MessageDecoder&);
@@ -55,8 +52,6 @@
 
 private:
     // Message receivers that don't require a destination ID.
-    HashMap<unsigned, MessageReceiver*> m_deprecatedGlobalMessageReceivers;
-
     HashMap<StringReference, MessageReceiver*> m_globalMessageReceivers;
 };
 

Modified: trunk/Source/WebKit2/UIProcess/Notifications/WebNotificationManagerProxy.cpp (132141 => 132142)


--- trunk/Source/WebKit2/UIProcess/Notifications/WebNotificationManagerProxy.cpp	2012-10-22 22:05:34 UTC (rev 132141)
+++ trunk/Source/WebKit2/UIProcess/Notifications/WebNotificationManagerProxy.cpp	2012-10-22 22:09:56 UTC (rev 132142)
@@ -31,6 +31,7 @@
 #include "WebContext.h"
 #include "WebNotification.h"
 #include "WebNotificationManagerMessages.h"
+#include "WebNotificationManagerProxyMessages.h"
 #include "WebPageProxy.h"
 #include "WebSecurityOrigin.h"
 
@@ -47,7 +48,7 @@
 WebNotificationManagerProxy::WebNotificationManagerProxy(WebContext* context)
     : m_context(context)
 {
-    m_context->deprecatedAddMessageReceiver(CoreIPC::MessageClassWebNotificationManagerProxy, this);
+    m_context->addMessageReceiver(Messages::WebNotificationManagerProxy::messageReceiverName(), this);
 }
 
 void WebNotificationManagerProxy::invalidate()

Modified: trunk/Source/WebKit2/UIProcess/WebApplicationCacheManagerProxy.cpp (132141 => 132142)


--- trunk/Source/WebKit2/UIProcess/WebApplicationCacheManagerProxy.cpp	2012-10-22 22:05:34 UTC (rev 132141)
+++ trunk/Source/WebKit2/UIProcess/WebApplicationCacheManagerProxy.cpp	2012-10-22 22:09:56 UTC (rev 132142)
@@ -28,6 +28,7 @@
 
 #include "SecurityOriginData.h"
 #include "WebApplicationCacheManagerMessages.h"
+#include "WebApplicationCacheManagerProxyMessages.h"
 #include "WebContext.h"
 #include "WebSecurityOrigin.h"
 
@@ -41,7 +42,7 @@
 WebApplicationCacheManagerProxy::WebApplicationCacheManagerProxy(WebContext* context)
     : m_webContext(context)
 {
-    m_webContext->deprecatedAddMessageReceiver(CoreIPC::MessageClassWebApplicationCacheManagerProxy, this);
+    m_webContext->addMessageReceiver(Messages::WebApplicationCacheManagerProxy::messageReceiverName(), this);
 }
 
 WebApplicationCacheManagerProxy::~WebApplicationCacheManagerProxy()

Modified: trunk/Source/WebKit2/UIProcess/WebBatteryManagerProxy.cpp (132141 => 132142)


--- trunk/Source/WebKit2/UIProcess/WebBatteryManagerProxy.cpp	2012-10-22 22:05:34 UTC (rev 132141)
+++ trunk/Source/WebKit2/UIProcess/WebBatteryManagerProxy.cpp	2012-10-22 22:09:56 UTC (rev 132142)
@@ -29,6 +29,7 @@
 #if ENABLE(BATTERY_STATUS)
 
 #include "WebBatteryManagerMessages.h"
+#include "WebBatteryManagerProxyMessages.h"
 #include "WebContext.h"
 
 namespace WebKit {
@@ -42,7 +43,7 @@
     : m_isUpdating(false)
     , m_context(context)
 {
-    m_context->deprecatedAddMessageReceiver(CoreIPC::MessageClassWebBatteryManagerProxy, this);
+    m_context->addMessageReceiver(Messages::WebBatteryManagerProxy::messageReceiverName(), this);
 }
 
 WebBatteryManagerProxy::~WebBatteryManagerProxy()

Modified: trunk/Source/WebKit2/UIProcess/WebContext.cpp (132141 => 132142)


--- trunk/Source/WebKit2/UIProcess/WebContext.cpp	2012-10-22 22:05:34 UTC (rev 132141)
+++ trunk/Source/WebKit2/UIProcess/WebContext.cpp	2012-10-22 22:09:56 UTC (rev 132142)
@@ -790,11 +790,6 @@
     m_messageReceiverMap.addMessageReceiver(messageReceiverName, messageReceiver);
 }
 
-void WebContext::deprecatedAddMessageReceiver(CoreIPC::MessageClass messageClass, CoreIPC::MessageReceiver* messageReceiver)
-{
-    m_messageReceiverMap.deprecatedAddMessageReceiver(messageClass, messageReceiver);
-}
-
 bool WebContext::dispatchMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder)
 {
     return m_messageReceiverMap.dispatchMessage(connection, messageID, decoder);

Modified: trunk/Source/WebKit2/UIProcess/WebContext.h (132141 => 132142)


--- trunk/Source/WebKit2/UIProcess/WebContext.h	2012-10-22 22:05:34 UTC (rev 132141)
+++ trunk/Source/WebKit2/UIProcess/WebContext.h	2012-10-22 22:09:56 UTC (rev 132142)
@@ -87,7 +87,6 @@
     static const Vector<WebContext*>& allContexts();
 
     void addMessageReceiver(CoreIPC::StringReference messageReceiverName, CoreIPC::MessageReceiver*);
-    void deprecatedAddMessageReceiver(CoreIPC::MessageClass, CoreIPC::MessageReceiver*);
     bool dispatchMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
     bool dispatchSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&, OwnPtr<CoreIPC::MessageEncoder>&);
 

Modified: trunk/Source/WebKit2/UIProcess/WebCookieManagerProxy.cpp (132141 => 132142)


--- trunk/Source/WebKit2/UIProcess/WebCookieManagerProxy.cpp	2012-10-22 22:05:34 UTC (rev 132141)
+++ trunk/Source/WebKit2/UIProcess/WebCookieManagerProxy.cpp	2012-10-22 22:09:56 UTC (rev 132142)
@@ -27,8 +27,9 @@
 #include "WebCookieManagerProxy.h"
 
 #include "SecurityOriginData.h"
+#include "WebContext.h"
 #include "WebCookieManagerMessages.h"
-#include "WebContext.h"
+#include "WebCookieManagerProxyMessages.h"
 #include "WebSecurityOrigin.h"
 
 namespace WebKit {
@@ -41,7 +42,7 @@
 WebCookieManagerProxy::WebCookieManagerProxy(WebContext* context)
     : m_webContext(context)
 {
-    m_webContext->deprecatedAddMessageReceiver(CoreIPC::MessageClassWebCookieManagerProxy, this);
+    m_webContext->addMessageReceiver(Messages::WebCookieManagerProxy::messageReceiverName(), this);
 }
 
 WebCookieManagerProxy::~WebCookieManagerProxy()

Modified: trunk/Source/WebKit2/UIProcess/WebDatabaseManagerProxy.cpp (132141 => 132142)


--- trunk/Source/WebKit2/UIProcess/WebDatabaseManagerProxy.cpp	2012-10-22 22:05:34 UTC (rev 132141)
+++ trunk/Source/WebKit2/UIProcess/WebDatabaseManagerProxy.cpp	2012-10-22 22:09:56 UTC (rev 132142)
@@ -30,8 +30,9 @@
 
 #include "ImmutableArray.h"
 #include "ImmutableDictionary.h"
+#include "WebContext.h"
 #include "WebDatabaseManagerMessages.h"
-#include "WebContext.h"
+#include "WebDatabaseManagerProxyMessages.h"
 #include "WebSecurityOrigin.h"
 
 using namespace WebCore;
@@ -94,7 +95,7 @@
 WebDatabaseManagerProxy::WebDatabaseManagerProxy(WebContext* webContext)
     : m_webContext(webContext)
 {
-    m_webContext->deprecatedAddMessageReceiver(CoreIPC::MessageClassWebDatabaseManagerProxy, this);
+    m_webContext->addMessageReceiver(Messages::WebDatabaseManagerProxy::messageReceiverName(), this);
 }
 
 WebDatabaseManagerProxy::~WebDatabaseManagerProxy()

Modified: trunk/Source/WebKit2/UIProcess/WebGeolocationManagerProxy.cpp (132141 => 132142)


--- trunk/Source/WebKit2/UIProcess/WebGeolocationManagerProxy.cpp	2012-10-22 22:05:34 UTC (rev 132141)
+++ trunk/Source/WebKit2/UIProcess/WebGeolocationManagerProxy.cpp	2012-10-22 22:09:56 UTC (rev 132142)
@@ -28,6 +28,7 @@
 
 #include "WebContext.h"
 #include "WebGeolocationManagerMessages.h"
+#include "WebGeolocationManagerProxyMessages.h"
 
 namespace WebKit {
 
@@ -40,7 +41,7 @@
     : m_isUpdating(false)
     , m_context(context)
 {
-    m_context->deprecatedAddMessageReceiver(CoreIPC::MessageClassWebGeolocationManagerProxy, this);
+    m_context->addMessageReceiver(Messages::WebGeolocationManagerProxy::messageReceiverName(), this);
 }
 
 WebGeolocationManagerProxy::~WebGeolocationManagerProxy()

Modified: trunk/Source/WebKit2/UIProcess/WebIconDatabase.cpp (132141 => 132142)


--- trunk/Source/WebKit2/UIProcess/WebIconDatabase.cpp	2012-10-22 22:05:34 UTC (rev 132141)
+++ trunk/Source/WebKit2/UIProcess/WebIconDatabase.cpp	2012-10-22 22:09:56 UTC (rev 132142)
@@ -29,6 +29,7 @@
 #include "DataReference.h"
 #include "Logging.h"
 #include "WebContext.h"
+#include "WebIconDatabaseMessages.h"
 #include "WebIconDatabaseProxyMessages.h"
 #include <WebCore/FileSystem.h>
 #include <WebCore/IconDatabase.h>
@@ -54,7 +55,7 @@
     , m_urlImportCompleted(false)
     , m_databaseCleanupDisabled(false)
 {
-    m_webContext->deprecatedAddMessageReceiver(CoreIPC::MessageClassWebIconDatabase, this);
+    m_webContext->addMessageReceiver(Messages::WebIconDatabase::messageReceiverName(), this);
 }
 
 void WebIconDatabase::invalidate()

Modified: trunk/Source/WebKit2/UIProcess/WebKeyValueStorageManagerProxy.cpp (132141 => 132142)


--- trunk/Source/WebKit2/UIProcess/WebKeyValueStorageManagerProxy.cpp	2012-10-22 22:05:34 UTC (rev 132141)
+++ trunk/Source/WebKit2/UIProcess/WebKeyValueStorageManagerProxy.cpp	2012-10-22 22:09:56 UTC (rev 132142)
@@ -27,8 +27,9 @@
 #include "WebKeyValueStorageManagerProxy.h"
 
 #include "SecurityOriginData.h"
+#include "WebContext.h"
 #include "WebKeyValueStorageManagerMessages.h"
-#include "WebContext.h"
+#include "WebKeyValueStorageManagerProxyMessages.h"
 #include "WebSecurityOrigin.h"
 
 namespace WebKit {
@@ -41,7 +42,7 @@
 WebKeyValueStorageManagerProxy::WebKeyValueStorageManagerProxy(WebContext* context)
     : m_webContext(context)
 {
-    m_webContext->deprecatedAddMessageReceiver(CoreIPC::MessageClassWebKeyValueStorageManagerProxy, this);
+    m_webContext->addMessageReceiver(Messages::WebKeyValueStorageManagerProxy::messageReceiverName(), this);
 }
 
 WebKeyValueStorageManagerProxy::~WebKeyValueStorageManagerProxy()

Modified: trunk/Source/WebKit2/UIProcess/WebMediaCacheManagerProxy.cpp (132141 => 132142)


--- trunk/Source/WebKit2/UIProcess/WebMediaCacheManagerProxy.cpp	2012-10-22 22:05:34 UTC (rev 132141)
+++ trunk/Source/WebKit2/UIProcess/WebMediaCacheManagerProxy.cpp	2012-10-22 22:09:56 UTC (rev 132142)
@@ -28,6 +28,7 @@
 
 #include "WebContext.h"
 #include "WebMediaCacheManagerMessages.h"
+#include "WebMediaCacheManagerProxyMessages.h"
 #include "WebSecurityOrigin.h"
 
 namespace WebKit {
@@ -40,7 +41,7 @@
 WebMediaCacheManagerProxy::WebMediaCacheManagerProxy(WebContext* context)
     : m_webContext(context)
 {
-    m_webContext->deprecatedAddMessageReceiver(CoreIPC::MessageClassWebMediaCacheManagerProxy, this);
+    m_webContext->addMessageReceiver(Messages::WebMediaCacheManagerProxy::messageReceiverName(), this);
 }
 
 WebMediaCacheManagerProxy::~WebMediaCacheManagerProxy()

Modified: trunk/Source/WebKit2/UIProcess/WebNetworkInfoManagerProxy.cpp (132141 => 132142)


--- trunk/Source/WebKit2/UIProcess/WebNetworkInfoManagerProxy.cpp	2012-10-22 22:05:34 UTC (rev 132141)
+++ trunk/Source/WebKit2/UIProcess/WebNetworkInfoManagerProxy.cpp	2012-10-22 22:09:56 UTC (rev 132142)
@@ -31,6 +31,7 @@
 #include "WebContext.h"
 #include "WebNetworkInfo.h"
 #include "WebNetworkInfoManagerMessages.h"
+#include "WebNetworkInfoManagerProxyMessages.h"
 
 namespace WebKit {
 
@@ -43,7 +44,7 @@
     : m_isUpdating(false)
     , m_context(context)
 {
-    m_context->deprecatedAddMessageReceiver(CoreIPC::MessageClassWebNetworkInfoManagerProxy, this);
+    m_context->addMessageReceiver(Messages::WebNetworkInfoManagerProxy::messageReceiverName(), this);
 }
 
 WebNetworkInfoManagerProxy::~WebNetworkInfoManagerProxy()

Modified: trunk/Source/WebKit2/UIProcess/WebResourceCacheManagerProxy.cpp (132141 => 132142)


--- trunk/Source/WebKit2/UIProcess/WebResourceCacheManagerProxy.cpp	2012-10-22 22:05:34 UTC (rev 132141)
+++ trunk/Source/WebKit2/UIProcess/WebResourceCacheManagerProxy.cpp	2012-10-22 22:09:56 UTC (rev 132142)
@@ -31,6 +31,7 @@
 #include "SecurityOriginData.h"
 #include "WebContext.h"
 #include "WebResourceCacheManagerMessages.h"
+#include "WebResourceCacheManagerProxyMessages.h"
 #include "WebSecurityOrigin.h"
 
 using namespace WebCore;
@@ -45,7 +46,7 @@
 WebResourceCacheManagerProxy::WebResourceCacheManagerProxy(WebContext* webContext)
     : m_webContext(webContext)
 {
-    m_webContext->deprecatedAddMessageReceiver(CoreIPC::MessageClassWebResourceCacheManagerProxy, this);
+    m_webContext->addMessageReceiver(Messages::WebResourceCacheManagerProxy::messageReceiverName(), this);
 }
 
 WebResourceCacheManagerProxy::~WebResourceCacheManagerProxy()

Modified: trunk/Source/WebKit2/UIProcess/WebVibrationProxy.cpp (132141 => 132142)


--- trunk/Source/WebKit2/UIProcess/WebVibrationProxy.cpp	2012-10-22 22:05:34 UTC (rev 132141)
+++ trunk/Source/WebKit2/UIProcess/WebVibrationProxy.cpp	2012-10-22 22:09:56 UTC (rev 132142)
@@ -29,6 +29,7 @@
 #if ENABLE(VIBRATION)
 
 #include "WebContext.h"
+#include "WebVibrationProxyMessages.h"
 
 namespace WebKit {
 
@@ -40,7 +41,7 @@
 WebVibrationProxy::WebVibrationProxy(WebContext* context)
     : m_context(context)
 {
-    m_context->deprecatedAddMessageReceiver(CoreIPC::MessageClassWebVibrationProxy, this);
+    m_context->addMessageReceiver(Messages::WebVibrationProxy::messageReceiverName(), this);
 }
 
 WebVibrationProxy::~WebVibrationProxy()

Modified: trunk/Source/WebKit2/UIProcess/soup/WebSoupRequestManagerProxy.cpp (132141 => 132142)


--- trunk/Source/WebKit2/UIProcess/soup/WebSoupRequestManagerProxy.cpp	2012-10-22 22:05:34 UTC (rev 132141)
+++ trunk/Source/WebKit2/UIProcess/soup/WebSoupRequestManagerProxy.cpp	2012-10-22 22:09:56 UTC (rev 132142)
@@ -23,6 +23,7 @@
 #include "WebContext.h"
 #include "WebData.h"
 #include "WebSoupRequestManagerMessages.h"
+#include "WebSoupRequestManagerProxyMessages.h"
 
 namespace WebKit {
 
@@ -35,7 +36,7 @@
     : m_webContext(context)
     , m_loadFailed(false)
 {
-    m_webContext->deprecatedAddMessageReceiver(CoreIPC::MessageClassWebSoupRequestManagerProxy, this);
+    m_webContext->addMessageReceiver(Messages::WebSoupRequestManagerProxy::messageReceiverName(), this);
 }
 
 WebSoupRequestManagerProxy::~WebSoupRequestManagerProxy()

Modified: trunk/Source/WebKit2/WebProcess/Authentication/AuthenticationManager.cpp (132141 => 132142)


--- trunk/Source/WebKit2/WebProcess/Authentication/AuthenticationManager.cpp	2012-10-22 22:05:34 UTC (rev 132141)
+++ trunk/Source/WebKit2/WebProcess/Authentication/AuthenticationManager.cpp	2012-10-22 22:09:56 UTC (rev 132142)
@@ -26,6 +26,7 @@
 #include "config.h"
 #include "AuthenticationManager.h"
 
+#include "AuthenticationManagerMessages.h"
 #include "Download.h"
 #include "DownloadProxyMessages.h"
 #include "MessageID.h"
@@ -55,7 +56,7 @@
 
 AuthenticationManager::AuthenticationManager()
 {
-    WebProcess::shared().connection()->deprecatedAddMessageReceiver(CoreIPC::MessageClassAuthenticationManager, this);
+    WebProcess::shared().addMessageReceiver(Messages::AuthenticationManager::messageReceiverName(), this);
 }
 
 void AuthenticationManager::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder)

Modified: trunk/Source/WebKit2/WebProcess/Geolocation/WebGeolocationManager.cpp (132141 => 132142)


--- trunk/Source/WebKit2/WebProcess/Geolocation/WebGeolocationManager.cpp	2012-10-22 22:05:34 UTC (rev 132141)
+++ trunk/Source/WebKit2/WebProcess/Geolocation/WebGeolocationManager.cpp	2012-10-22 22:09:56 UTC (rev 132142)
@@ -26,6 +26,7 @@
 #include "config.h"
 #include "WebGeolocationManager.h"
 
+#include "WebGeolocationManagerMessages.h"
 #include "WebGeolocationManagerProxyMessages.h"
 #include "WebPage.h"
 #include "WebProcess.h"
@@ -41,8 +42,8 @@
 
 WebGeolocationManager::WebGeolocationManager(WebProcess* process)
     : m_process(process)
-    , m_didAddMessageReceiver(false)
 {
+    m_process->addMessageReceiver(Messages::WebGeolocationManager::messageReceiverName(), this);
 }
 
 WebGeolocationManager::~WebGeolocationManager()
@@ -56,11 +57,6 @@
 
 void WebGeolocationManager::registerWebPage(WebPage* page)
 {
-    if (!m_didAddMessageReceiver) {
-        m_process->connection()->deprecatedAddMessageReceiver(CoreIPC::MessageClassWebGeolocationManager, this);
-        m_didAddMessageReceiver = true;
-    }
-
     bool wasEmpty = m_pageSet.isEmpty();
 
     m_pageSet.add(page);

Modified: trunk/Source/WebKit2/WebProcess/Geolocation/WebGeolocationManager.h (132141 => 132142)


--- trunk/Source/WebKit2/WebProcess/Geolocation/WebGeolocationManager.h	2012-10-22 22:05:34 UTC (rev 132141)
+++ trunk/Source/WebKit2/WebProcess/Geolocation/WebGeolocationManager.h	2012-10-22 22:09:56 UTC (rev 132142)
@@ -64,7 +64,6 @@
     void didFailToDeterminePosition(const String& errorMessage);
 
     WebProcess* m_process;
-    bool m_didAddMessageReceiver;
     HashSet<WebPage*> m_pageSet;
 };
 

Modified: trunk/Source/WebKit2/WebProcess/WebProcess.cpp (132141 => 132142)


--- trunk/Source/WebKit2/WebProcess/WebProcess.cpp	2012-10-22 22:05:34 UTC (rev 132141)
+++ trunk/Source/WebKit2/WebProcess/WebProcess.cpp	2012-10-22 22:09:56 UTC (rev 132142)
@@ -194,6 +194,11 @@
     startRandomCrashThreadIfRequested();
 }
 
+void WebProcess::addMessageReceiver(CoreIPC::StringReference messageReceiverName, CoreIPC::MessageReceiver* messageReceiver)
+{
+    m_messageReceiverMap.addMessageReceiver(messageReceiverName, messageReceiver);
+}
+
 void WebProcess::initializeWebProcess(const WebProcessCreationParameters& parameters, CoreIPC::MessageDecoder& decoder)
 {
     ASSERT(m_pageMap.isEmpty());
@@ -645,7 +650,10 @@
 }
 
 void WebProcess::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder, OwnPtr<CoreIPC::MessageEncoder>& replyEncoder)
-{   
+{
+    if (m_messageReceiverMap.dispatchSyncMessage(connection, messageID, decoder, replyEncoder))
+        return;
+
     uint64_t pageID = decoder.destinationID();
     if (!pageID)
         return;
@@ -659,6 +667,9 @@
 
 void WebProcess::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder)
 {
+    if (m_messageReceiverMap.dispatchMessage(connection, messageID, decoder))
+        return;
+
     if (messageID.is<CoreIPC::MessageClassWebProcess>()) {
         didReceiveWebProcessMessage(connection, messageID, decoder);
         return;

Modified: trunk/Source/WebKit2/WebProcess/WebProcess.h (132141 => 132142)


--- trunk/Source/WebKit2/WebProcess/WebProcess.h	2012-10-22 22:05:34 UTC (rev 132141)
+++ trunk/Source/WebKit2/WebProcess/WebProcess.h	2012-10-22 22:09:56 UTC (rev 132142)
@@ -30,6 +30,7 @@
 #include "ChildProcess.h"
 #include "DrawingArea.h"
 #include "EventDispatcher.h"
+#include "MessageReceiverMap.h"
 #include "PluginInfoStore.h"
 #include "ResourceCachesToClear.h"
 #include "SandboxExtension.h"
@@ -113,6 +114,8 @@
     CoreIPC::Connection* connection() const { return m_connection->connection(); }
     WebCore::RunLoop* runLoop() const { return m_runLoop; }
 
+    void addMessageReceiver(CoreIPC::StringReference messageReceiverName, CoreIPC::MessageReceiver*);
+
     WebConnectionToUIProcess* webConnectionToUIProcess() const { return m_connection.get(); }
 
     WebPage* webPage(uint64_t pageID) const;
@@ -292,6 +295,7 @@
 #endif
 
     RefPtr<WebConnectionToUIProcess> m_connection;
+    CoreIPC::MessageReceiverMap m_messageReceiverMap;
 
     HashMap<uint64_t, RefPtr<WebPage> > m_pageMap;
     HashMap<uint64_t, RefPtr<WebPageGroupProxy> > m_pageGroupMap;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to