Title: [132743] trunk/Source/WebKit2
Revision
132743
Author
[email protected]
Date
2012-10-27 22:49:45 -0700 (Sat, 27 Oct 2012)

Log Message

Unreviewed, rolling out r132740.
http://trac.webkit.org/changeset/132740
https://bugs.webkit.org/show_bug.cgi?id=100603

"Causing many crashes" (Requested by weinig on #webkit).

Patch by Sheriff Bot <[email protected]> on 2012-10-27

* UIProcess/Downloads/DownloadProxy.cpp:
(WebKit::DownloadProxy::DownloadProxy):
(WebKit::DownloadProxy::invalidate):
(WebKit):
* UIProcess/Downloads/DownloadProxy.h:
(DownloadProxy):
* UIProcess/WebContext.cpp:
(WebKit::WebContext::createDownloadProxy):
(WebKit::WebContext::downloadFinished):
(WebKit::WebContext::didReceiveMessage):
(WebKit::WebContext::didReceiveSyncMessage):
* UIProcess/WebContext.h:
(WebKit):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy):
(WebKit::WebPageProxy::~WebPageProxy):
(WebKit::WebPageProxy::didReceiveMessage):
(WebKit::WebPageProxy::didReceiveSyncMessage):
* UIProcess/WebPageProxy.h:
(CoreIPC):
(WebPageProxy):
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::didReceiveMessage):
(WebKit::WebProcessProxy::didReceiveSyncMessage):
* UIProcess/WebProcessProxy.h:
(WebProcessProxy):
* WebProcess/WebPage/WebPageGroupProxy.cpp:
(WebKit::WebPageGroupProxy::~WebPageGroupProxy):
(WebKit):
(WebKit::WebPageGroupProxy::didReceiveMessage):
(WebKit::WebPageGroupProxy::WebPageGroupProxy):
* WebProcess/WebPage/WebPageGroupProxy.h:
(CoreIPC):
(WebPageGroupProxy):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::didReceiveSyncMessage):
(WebKit::WebProcess::didReceiveMessage):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (132742 => 132743)


--- trunk/Source/WebKit2/ChangeLog	2012-10-28 01:32:58 UTC (rev 132742)
+++ trunk/Source/WebKit2/ChangeLog	2012-10-28 05:49:45 UTC (rev 132743)
@@ -1,3 +1,49 @@
+2012-10-27  Sheriff Bot  <[email protected]>
+
+        Unreviewed, rolling out r132740.
+        http://trac.webkit.org/changeset/132740
+        https://bugs.webkit.org/show_bug.cgi?id=100603
+
+        "Causing many crashes" (Requested by weinig on #webkit).
+
+        * UIProcess/Downloads/DownloadProxy.cpp:
+        (WebKit::DownloadProxy::DownloadProxy):
+        (WebKit::DownloadProxy::invalidate):
+        (WebKit):
+        * UIProcess/Downloads/DownloadProxy.h:
+        (DownloadProxy):
+        * UIProcess/WebContext.cpp:
+        (WebKit::WebContext::createDownloadProxy):
+        (WebKit::WebContext::downloadFinished):
+        (WebKit::WebContext::didReceiveMessage):
+        (WebKit::WebContext::didReceiveSyncMessage):
+        * UIProcess/WebContext.h:
+        (WebKit):
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::WebPageProxy):
+        (WebKit::WebPageProxy::~WebPageProxy):
+        (WebKit::WebPageProxy::didReceiveMessage):
+        (WebKit::WebPageProxy::didReceiveSyncMessage):
+        * UIProcess/WebPageProxy.h:
+        (CoreIPC):
+        (WebPageProxy):
+        * UIProcess/WebProcessProxy.cpp:
+        (WebKit::WebProcessProxy::didReceiveMessage):
+        (WebKit::WebProcessProxy::didReceiveSyncMessage):
+        * UIProcess/WebProcessProxy.h:
+        (WebProcessProxy):
+        * WebProcess/WebPage/WebPageGroupProxy.cpp:
+        (WebKit::WebPageGroupProxy::~WebPageGroupProxy):
+        (WebKit):
+        (WebKit::WebPageGroupProxy::didReceiveMessage):
+        (WebKit::WebPageGroupProxy::WebPageGroupProxy):
+        * WebProcess/WebPage/WebPageGroupProxy.h:
+        (CoreIPC):
+        (WebPageGroupProxy):
+        * WebProcess/WebProcess.cpp:
+        (WebKit::WebProcess::didReceiveSyncMessage):
+        (WebKit::WebProcess::didReceiveMessage):
+
 2012-10-27  Noam Rosenthal  <[email protected]>
 
         Coordinated Graphics: Animation jerkiness when rAF is enabled

Modified: trunk/Source/WebKit2/UIProcess/Downloads/DownloadProxy.cpp (132742 => 132743)


--- trunk/Source/WebKit2/UIProcess/Downloads/DownloadProxy.cpp	2012-10-28 01:32:58 UTC (rev 132742)
+++ trunk/Source/WebKit2/UIProcess/Downloads/DownloadProxy.cpp	2012-10-28 05:49:45 UTC (rev 132743)
@@ -28,7 +28,6 @@
 
 #include "AuthenticationChallengeProxy.h"
 #include "DataReference.h"
-#include "DownloadProxyMessages.h"
 #include "WebContext.h"
 #include "WebData.h"
 #include "WebProcessMessages.h"
@@ -54,7 +53,6 @@
     : m_webContext(webContext)
     , m_downloadID(generateDownloadID())
 {
-    m_webContext->addMessageReceiver(Messages::DownloadProxy::messageReceiverName(), m_downloadID, this);
 }
 
 DownloadProxy::~DownloadProxy()
@@ -74,8 +72,6 @@
 void DownloadProxy::invalidate()
 {
     ASSERT(m_webContext);
-
-    m_webContext->removeMessageReceiver(Messages::DownloadProxy::messageReceiverName(), m_downloadID);
     m_webContext = 0;
 }
 
@@ -204,15 +200,5 @@
 }
 #endif
 
-void DownloadProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder)
-{
-    didReceiveDownloadProxyMessage(connection, messageID, decoder);
-}
-
-void DownloadProxy::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder, OwnPtr<CoreIPC::MessageEncoder>& replyEncoder)
-{
-    didReceiveSyncDownloadProxyMessage(connection, messageID, decoder, replyEncoder);
-}
-
 } // namespace WebKit
 

Modified: trunk/Source/WebKit2/UIProcess/Downloads/DownloadProxy.h (132742 => 132743)


--- trunk/Source/WebKit2/UIProcess/Downloads/DownloadProxy.h	2012-10-28 01:32:58 UTC (rev 132742)
+++ trunk/Source/WebKit2/UIProcess/Downloads/DownloadProxy.h	2012-10-28 05:49:45 UTC (rev 132743)
@@ -45,7 +45,7 @@
 class WebData;
 class WebPageProxy;
 
-class DownloadProxy : public APIObject, private CoreIPC::MessageReceiver {
+class DownloadProxy : public APIObject {
 public:
     static const Type APIType = TypeDownload;
 
@@ -61,6 +61,9 @@
     void invalidate();
     void processDidClose();
 
+    void didReceiveDownloadProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
+    void didReceiveSyncDownloadProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&, OwnPtr<CoreIPC::MessageEncoder>&);
+
 #if PLATFORM(QT)
     void startTransfer(const String& filename);
 #endif
@@ -70,14 +73,6 @@
 
     virtual Type type() const { return APIType; }
 
-    // CoreIPC::MessageReceiver
-    void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&) OVERRIDE;
-    void didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&, OwnPtr<CoreIPC::MessageEncoder>&) OVERRIDE;
-
-    // Implemented in generated DownloadProxyMessageReceiver.cpp
-    void didReceiveDownloadProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
-    void didReceiveSyncDownloadProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&, OwnPtr<CoreIPC::MessageEncoder>&);
-
     // Message handlers.
     void didStart(const WebCore::ResourceRequest&);
     void didReceiveAuthenticationChallenge(const WebCore::AuthenticationChallenge&, uint64_t challengeID);

Modified: trunk/Source/WebKit2/UIProcess/WebContext.cpp (132742 => 132743)


--- trunk/Source/WebKit2/UIProcess/WebContext.cpp	2012-10-28 01:32:58 UTC (rev 132742)
+++ trunk/Source/WebKit2/UIProcess/WebContext.cpp	2012-10-28 05:49:45 UTC (rev 132743)
@@ -761,6 +761,7 @@
 {
     RefPtr<DownloadProxy> downloadProxy = DownloadProxy::create(this);
     m_downloads.set(downloadProxy->downloadID(), downloadProxy);
+    addMessageReceiver(Messages::DownloadProxy::messageReceiverName(), downloadProxy->downloadID(), this);
     return downloadProxy.get();
 }
 
@@ -769,6 +770,7 @@
     ASSERT(m_downloads.contains(downloadProxy->downloadID()));
 
     downloadProxy->invalidate();
+    removeMessageReceiver(Messages::DownloadProxy::messageReceiverName(), downloadProxy->downloadID());
     m_downloads.remove(downloadProxy->downloadID());
 }
 
@@ -816,6 +818,13 @@
         return;
     }
 
+    if (messageID.is<CoreIPC::MessageClassDownloadProxy>()) {
+        if (DownloadProxy* downloadProxy = m_downloads.get(decoder.destinationID()).get())
+            downloadProxy->didReceiveDownloadProxyMessage(connection, messageID, decoder);
+        
+        return;
+    }
+
     switch (messageID.get<WebContextLegacyMessage::Kind>()) {
         case WebContextLegacyMessage::PostMessage: {
             String messageName;
@@ -843,6 +852,12 @@
         return;
     }
 
+    if (messageID.is<CoreIPC::MessageClassDownloadProxy>()) {
+        if (DownloadProxy* downloadProxy = m_downloads.get(decoder.destinationID()).get())
+            downloadProxy->didReceiveSyncDownloadProxyMessage(connection, messageID, decoder, replyEncoder);
+        return;
+    }
+
     switch (messageID.get<WebContextLegacyMessage::Kind>()) {
         case WebContextLegacyMessage::PostSynchronousMessage: {
             // FIXME: We should probably encode something in the case that the arguments do not decode correctly.

Modified: trunk/Source/WebKit2/UIProcess/WebContext.h (132742 => 132743)


--- trunk/Source/WebKit2/UIProcess/WebContext.h	2012-10-28 01:32:58 UTC (rev 132742)
+++ trunk/Source/WebKit2/UIProcess/WebContext.h	2012-10-28 05:49:45 UTC (rev 132743)
@@ -50,31 +50,30 @@
 
 class DownloadProxy;
 class WebApplicationCacheManagerProxy;
+#if ENABLE(BATTERY_STATUS)
+class WebBatteryManagerProxy;
+#endif
 class WebCookieManagerProxy;
 class WebDatabaseManagerProxy;
 class WebGeolocationManagerProxy;
 class WebIconDatabase;
 class WebKeyValueStorageManagerProxy;
 class WebMediaCacheManagerProxy;
+#if ENABLE(NETWORK_INFO)
+class WebNetworkInfoManagerProxy;
+#endif
 class WebNotificationManagerProxy;
 class WebPageGroup;
 class WebPageProxy;
 class WebResourceCacheManagerProxy;
-struct StatisticsData;
-struct WebProcessCreationParameters;
-
-#if ENABLE(BATTERY_STATUS)
-class WebBatteryManagerProxy;
-#endif
-#if ENABLE(NETWORK_INFO)
-class WebNetworkInfoManagerProxy;
-#endif
 #if USE(SOUP)
 class WebSoupRequestManagerProxy;
 #endif
 #if ENABLE(VIBRATION)
 class WebVibrationProxy;
 #endif
+struct StatisticsData;
+struct WebProcessCreationParameters;
     
 typedef GenericCallback<WKDictionaryRef> DictionaryCallback;
 

Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (132742 => 132743)


--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp	2012-10-28 01:32:58 UTC (rev 132742)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp	2012-10-28 05:49:45 UTC (rev 132743)
@@ -32,7 +32,6 @@
 #include "DataReference.h"
 #include "DownloadProxy.h"
 #include "DrawingAreaProxy.h"
-#include "DrawingAreaProxyMessages.h"
 #include "EventDispatcherMessages.h"
 #include "FindIndicator.h"
 #include "Logging.h"
@@ -70,7 +69,6 @@
 #include "WebPageGroup.h"
 #include "WebPageGroupData.h"
 #include "WebPageMessages.h"
-#include "WebPageProxyMessages.h"
 #include "WebPopupItem.h"
 #include "WebPopupMenuProxy.h"
 #include "WebPreferences.h"
@@ -90,14 +88,6 @@
 #include <WebCore/WindowFeatures.h>
 #include <stdio.h>
 
-#if ENABLE(INSPECTOR)
-#include "WebInspectorProxyMessages.h"
-#endif
-
-#if ENABLE(FULLSCREEN_API)
-#include "WebFullScreenManagerProxyMessages.h"
-#endif
-
 #if ENABLE(WEB_INTENTS)
 #include "IntentData.h"
 #include "IntentServiceInfo.h"
@@ -254,20 +244,6 @@
 
     WebContext::statistics().wkPageCount++;
 
-    m_process->addMessageReceiver(Messages::WebPageProxy::messageReceiverName(), m_pageID, this);
-
-    // FIXME: This should be done in the object constructors, and the objects themselves should be message receivers.
-    m_process->addMessageReceiver(Messages::DrawingAreaProxy::messageReceiverName(), m_pageID, this);
-#if USE(COORDINATED_GRAPHICS)
-    m_process->addMessageReceiver(Messages::LayerTreeCoordinatorProxy::messageReceiverName(), m_pageID, this);
-#endif
-#if ENABLE(INSPECTOR)
-    m_process->addMessageReceiver(Messages::WebInspectorProxy::messageReceiverName(), m_pageID, this);
-#endif
-#if ENABLE(FULLSCREEN_API)
-    m_process->addMessageReceiver(Messages::WebFullScreenManagerProxy::messageReceiverName(), m_pageID, this);
-#endif
-
     m_pageGroup->addPage(this);
 }
 
@@ -283,20 +259,6 @@
 
     m_pageGroup->removePage(this);
 
-    m_process->removeMessageReceiver(Messages::WebPageProxy::messageReceiverName(), m_pageID);
-
-    // FIXME: This should be done in the object destructors, and the objects themselves should be message receivers.
-    m_process->removeMessageReceiver(Messages::DrawingAreaProxy::messageReceiverName(), m_pageID);
-#if USE(COORDINATED_GRAPHICS)
-    m_process->removeMessageReceiver(Messages::LayerTreeCoordinatorProxy::messageReceiverName(), m_pageID);
-#endif
-#if ENABLE(INSPECTOR)
-    m_process->removeMessageReceiver(Messages::WebInspectorProxy::messageReceiverName(), m_pageID);
-#endif
-#if ENABLE(FULLSCREEN_API)
-    m_process->removeMessageReceiver(Messages::WebFullScreenManagerProxy::messageReceiverName(), m_pageID);
-#endif
-
 #ifndef NDEBUG
     webPageProxyCounter.decrement();
 #endif
@@ -1903,7 +1865,6 @@
     }
 #endif
 
-    ASSERT(messageID.is<CoreIPC::MessageClassWebPageProxy>());
     didReceiveWebPageProxyMessage(connection, messageID, decoder);
 }
 
@@ -1925,7 +1886,6 @@
 #endif
 
     // FIXME: Do something with reply.
-    ASSERT(messageID.is<CoreIPC::MessageClassWebPageProxy>());
     didReceiveSyncWebPageProxyMessage(connection, messageID, decoder, replyEncoder);
 }
 

Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (132742 => 132743)


--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h	2012-10-28 01:32:58 UTC (rev 132742)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h	2012-10-28 05:49:45 UTC (rev 132743)
@@ -32,9 +32,14 @@
 #include "DrawingAreaProxy.h"
 #include "EditorState.h"
 #include "GeolocationPermissionRequestManagerProxy.h"
+#if ENABLE(TOUCH_EVENTS)
+#include "NativeWebTouchEvent.h"
+#endif
+#if PLATFORM(QT)
+#include "QtNetworkRequestData.h"
+#endif
 #include "LayerTreeContext.h"
 #include "NotificationPermissionRequestManagerProxy.h"
-#include "MessageReceiver.h"
 #include "PlatformProcessIdentifier.h"
 #include "SandboxExtension.h"
 #include "ShareableBitmap.h"
@@ -77,17 +82,16 @@
 #include <WebCore/DragSession.h>
 #endif
 
-#if ENABLE(TOUCH_EVENTS)
-#include "NativeWebTouchEvent.h"
-#endif
-#if PLATFORM(QT)
-#include "QtNetworkRequestData.h"
-#endif
-
 #if PLATFORM(EFL)
 #include <Evas.h>
 #endif
 
+namespace CoreIPC {
+    class ArgumentDecoder;
+    class Connection;
+    class MessageID;
+}
+
 namespace WebCore {
     class AuthenticationChallenge;
     class Cursor;
@@ -240,7 +244,7 @@
 #if ENABLE(INPUT_TYPE_COLOR)
     , public WebColorChooserProxy::Client
 #endif
-    , public WebPopupMenuProxy::Client, private CoreIPC::MessageReceiver {
+    , public WebPopupMenuProxy::Client {
 public:
     static const Type APIType = TypePage;
 
@@ -595,6 +599,9 @@
 #endif
 #endif
 
+    void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
+    void didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&, OwnPtr<CoreIPC::MessageEncoder>&);
+
     void processDidBecomeUnresponsive();
     void interactionOccurredWhileProcessUnresponsive();
     void processDidBecomeResponsive();
@@ -741,10 +748,6 @@
 
     virtual Type type() const { return APIType; }
 
-    // CoreIPC::MessageReceiver
-    void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&) OVERRIDE;
-    void didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&, OwnPtr<CoreIPC::MessageEncoder>&) OVERRIDE;
-
     // WebPopupMenuProxy::Client
     virtual void valueChangedForPopupMenu(WebPopupMenuProxy*, int32_t newSelectedIndex);
     virtual void setTextFromItemForPopupMenu(WebPopupMenuProxy*, int32_t index);

Modified: trunk/Source/WebKit2/UIProcess/WebProcessProxy.cpp (132742 => 132743)


--- trunk/Source/WebKit2/UIProcess/WebProcessProxy.cpp	2012-10-28 01:32:58 UTC (rev 132742)
+++ trunk/Source/WebKit2/UIProcess/WebProcessProxy.cpp	2012-10-28 05:49:45 UTC (rev 132743)
@@ -121,21 +121,6 @@
     return webProcessProxy;
 }
 
-void WebProcessProxy::addMessageReceiver(CoreIPC::StringReference messageReceiverName, CoreIPC::MessageReceiver* messageReceiver)
-{
-    m_messageReceiverMap.addMessageReceiver(messageReceiverName, messageReceiver);
-}
-
-void WebProcessProxy::addMessageReceiver(CoreIPC::StringReference messageReceiverName, uint64_t destinationID, CoreIPC::MessageReceiver* messageReceiver)
-{
-    m_messageReceiverMap.addMessageReceiver(messageReceiverName, destinationID, messageReceiver);
-}
-
-void WebProcessProxy::removeMessageReceiver(CoreIPC::StringReference messageReceiverName, uint64_t destinationID)
-{
-    m_messageReceiverMap.removeMessageReceiver(messageReceiverName, destinationID);
-}
-
 void WebProcessProxy::connect()
 {
     ASSERT(!m_processLauncher);
@@ -431,27 +416,44 @@
 
 void WebProcessProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder)
 {
-    if (m_messageReceiverMap.dispatchMessage(connection, messageID, decoder))
+    if (m_context->dispatchMessage(connection, messageID, decoder))
         return;
 
-    if (m_context->dispatchMessage(connection, messageID, decoder))
+    if (messageID.is<CoreIPC::MessageClassWebProcessProxy>()) {
+        didReceiveWebProcessProxyMessage(connection, messageID, decoder);
         return;
+    }
 
-    ASSERT(messageID.is<CoreIPC::MessageClassWebProcessProxy>());
-    didReceiveWebProcessProxyMessage(connection, messageID, decoder);
+    uint64_t pageID = decoder.destinationID();
+    if (!pageID)
+        return;
+
+    WebPageProxy* pageProxy = webPage(pageID);
+    if (!pageProxy)
+        return;
+    
+    pageProxy->didReceiveMessage(connection, messageID, decoder);
 }
 
 void WebProcessProxy::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder, OwnPtr<CoreIPC::MessageEncoder>& replyEncoder)
 {
-    if (m_messageReceiverMap.dispatchSyncMessage(connection, messageID, decoder, replyEncoder))
+    if (m_context->dispatchSyncMessage(connection, messageID, decoder, replyEncoder))
         return;
 
-    if (m_context->dispatchSyncMessage(connection, messageID, decoder, replyEncoder))
+    if (messageID.is<CoreIPC::MessageClassWebProcessProxy>()) {
+        didReceiveSyncWebProcessProxyMessage(connection, messageID, decoder, replyEncoder);
         return;
+    }
 
+    uint64_t pageID = decoder.destinationID();
+    if (!pageID)
+        return;
     
-    ASSERT(messageID.is<CoreIPC::MessageClassWebProcessProxy>());
-    didReceiveSyncWebProcessProxyMessage(connection, messageID, decoder, replyEncoder);
+    WebPageProxy* pageProxy = webPage(pageID);
+    if (!pageProxy)
+        return;
+    
+    pageProxy->didReceiveSyncMessage(connection, messageID, decoder, replyEncoder);
 }
 
 void WebProcessProxy::didReceiveMessageOnConnectionWorkQueue(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder, bool& didHandleMessage)

Modified: trunk/Source/WebKit2/UIProcess/WebProcessProxy.h (132742 => 132743)


--- trunk/Source/WebKit2/UIProcess/WebProcessProxy.h	2012-10-28 01:32:58 UTC (rev 132742)
+++ trunk/Source/WebKit2/UIProcess/WebProcessProxy.h	2012-10-28 05:49:45 UTC (rev 132743)
@@ -26,7 +26,6 @@
 #ifndef WebProcessProxy_h
 #define WebProcessProxy_h
 
-#include "MessageReceiverMap.h"
 #include "PlatformProcessIdentifier.h"
 #include "PluginInfoStore.h"
 #include "ProcessLauncher.h"
@@ -64,10 +63,6 @@
     static PassRefPtr<WebProcessProxy> create(PassRefPtr<WebContext>);
     ~WebProcessProxy();
 
-    void addMessageReceiver(CoreIPC::StringReference messageReceiverName, CoreIPC::MessageReceiver*);
-    void addMessageReceiver(CoreIPC::StringReference messageReceiverName, uint64_t destinationID, CoreIPC::MessageReceiver*);
-    void removeMessageReceiver(CoreIPC::StringReference messageReceiverName, uint64_t destinationID);
-
     static WebProcessProxy* fromConnection(CoreIPC::Connection*);
 
     void terminate();
@@ -206,7 +201,6 @@
     // This is not a CoreIPC::Connection so that we can wrap the CoreIPC::Connection in
     // an API object.
     RefPtr<WebConnectionToWebProcess> m_connection;
-    CoreIPC::MessageReceiverMap m_messageReceiverMap;
 
     Vector<std::pair<CoreIPC::Connection::OutgoingMessage, unsigned> > m_pendingMessages;
     RefPtr<ProcessLauncher> m_processLauncher;

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPageGroupProxy.cpp (132742 => 132743)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebPageGroupProxy.cpp	2012-10-28 01:32:58 UTC (rev 132742)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPageGroupProxy.cpp	2012-10-28 05:49:45 UTC (rev 132743)
@@ -26,9 +26,8 @@
 #include "config.h"
 #include "WebPageGroupProxy.h"
 
-#include "InjectedBundle.h"
-#include "WebPageGroupProxyMessages.h"
 #include "WebProcess.h"
+#include "InjectedBundle.h"
 #include <WebCore/DOMWrapperWorld.h>
 #include <WebCore/PageGroup.h>
 
@@ -44,28 +43,25 @@
     return pageGroup.release();
 }
 
+WebPageGroupProxy::~WebPageGroupProxy()
+{
+}
+    
+void WebPageGroupProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder)
+{
+    didReceiveWebPageGroupProxyMessage(connection, messageID, decoder);
+}
+    
 WebPageGroupProxy::WebPageGroupProxy(const WebPageGroupData& data)
     : m_data(data)
     , m_pageGroup(WebCore::PageGroup::pageGroup(m_data.identifer))
 {
-    WebProcess::shared().addMessageReceiver(Messages::WebPageGroupProxy::messageReceiverName(), m_data.pageGroupID, this);
-
     for (size_t i = 0; i < data.userStyleSheets.size(); ++i)
         addUserStyleSheet(data.userStyleSheets[i]);
     for (size_t i = 0; i < data.userScripts.size(); ++i)
         addUserScript(data.userScripts[i]);
 }
 
-WebPageGroupProxy::~WebPageGroupProxy()
-{
-    WebProcess::shared().removeMessageReceiver(Messages::WebPageGroupProxy::messageReceiverName(), m_data.pageGroupID);
-}
-
-void WebPageGroupProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder)
-{
-    didReceiveWebPageGroupProxyMessage(connection, messageID, decoder);
-}
-
 void WebPageGroupProxy::addUserStyleSheet(const WebCore::UserStyleSheet& userStyleSheet)
 {
     m_pageGroup->addUserStyleSheetToWorld(WebCore::mainThreadNormalWorld(), userStyleSheet.source(), userStyleSheet.url(), userStyleSheet.whitelist(), userStyleSheet.blacklist(), userStyleSheet.injectedFrames(), userStyleSheet.level());

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPageGroupProxy.h (132742 => 132743)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebPageGroupProxy.h	2012-10-28 01:32:58 UTC (rev 132742)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPageGroupProxy.h	2012-10-28 05:49:45 UTC (rev 132743)
@@ -27,17 +27,22 @@
 #define WebPageGroupProxy_h
 
 #include "APIObject.h"
-#include "MessageReceiver.h"
 #include "WebPageGroupData.h"
 #include <wtf/PassRefPtr.h>
 
+namespace CoreIPC {
+class Connection;
+class MessageDecoder;
+class MessageID;
+}
+
 namespace WebCore {
 class PageGroup;
 }
 
 namespace WebKit {
 
-class WebPageGroupProxy : public APIObject, private CoreIPC::MessageReceiver {
+class WebPageGroupProxy : public APIObject {
 public:
     static const Type APIType = TypeBundlePageGroup;
 
@@ -48,16 +53,14 @@
     uint64_t pageGroupID() const { return m_data.pageGroupID; }
     bool isVisibleToInjectedBundle() const { return m_data.visibleToInjectedBundle; }
     bool isVisibleToHistoryClient() const { return m_data.visibleToHistoryClient; }
+    
+    void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
 
 private:
     WebPageGroupProxy(const WebPageGroupData&);
 
     virtual Type type() const { return APIType; }
     
-    // CoreIPC::MessageReceiver
-    void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&) OVERRIDE;
-
-    // Implemented in generated WebPageGroupProxyMessageReceiver.cpp
     void didReceiveWebPageGroupProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&);
     
     void addUserStyleSheet(const WebCore::UserStyleSheet&);

Modified: trunk/Source/WebKit2/WebProcess/WebProcess.cpp (132742 => 132743)


--- trunk/Source/WebKit2/WebProcess/WebProcess.cpp	2012-10-28 01:32:58 UTC (rev 132742)
+++ trunk/Source/WebKit2/WebProcess/WebProcess.cpp	2012-10-28 05:49:45 UTC (rev 132743)
@@ -661,6 +661,7 @@
 void WebProcess::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder, OwnPtr<CoreIPC::MessageEncoder>& replyEncoder)
 {
     m_messageReceiverMap.dispatchSyncMessage(connection, messageID, decoder, replyEncoder);
+        return;
 }
 
 void WebProcess::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::MessageDecoder& decoder)
@@ -704,6 +705,18 @@
         WebResourceCacheManager::shared().didReceiveMessage(connection, messageID, decoder);
         return;
     }
+    
+    if (messageID.is<CoreIPC::MessageClassWebPageGroupProxy>()) {
+        uint64_t pageGroupID = decoder.destinationID();
+        if (!pageGroupID)
+            return;
+        
+        WebPageGroupProxy* pageGroupProxy = webPageGroup(pageGroupID);
+        if (!pageGroupProxy)
+            return;
+        
+        pageGroupProxy->didReceiveMessage(connection, messageID, decoder);
+    }
 }
 
 void WebProcess::didClose(CoreIPC::Connection*)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to