[WebKit2] Add the ability to send messages to the WebPageGroupProxy
authoraestes@apple.com <aestes@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 3 Oct 2012 20:09:18 +0000 (20:09 +0000)
committeraestes@apple.com <aestes@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 3 Oct 2012 20:09:18 +0000 (20:09 +0000)
https://bugs.webkit.org/show_bug.cgi?id=98233

Reviewed by Anders Carlsson.

Add a WebPageGroupProxy.messages.in, implement a stub message receiver
in WebPageGroupProxy, and teach WebProcess how to route messages to the
appropriate WebPageGroupProxy.

* CMakeLists.txt: Tell a build system about added files.
* DerivedSources.make: Ditto.
* DerivedSources.pri: Ditto.
* GNUmakefile.list.am: Ditto.
* WebKit2.xcodeproj/project.pbxproj: Ditto.
* win/WebKit2.vcproj: Ditto.
* Platform/CoreIPC/MessageID.h: Add MessageClassWebPageGroupProxy.
* WebProcess/WebPage/WebPageGroupProxy.cpp:
(WebKit::WebPageGroupProxy::didReceiveMessage): Stub out the method
that will receive messages.
(WebKit::WebPageGroupProxy::didReceiveWebPageGroupProxyMessage): Stub
out a method that will exist in WebPageGroupProxyMessageReceiver.cpp
once WebPageGroupProxy.messages.in contains messages.
* WebProcess/WebPage/WebPageGroupProxy.h:
* WebProcess/WebPage/WebPageGroupProxy.messages.in: Added.
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::didReceiveMessage): Route messages to the
WebPageGroupProxy matching destinationID if the message is of class
MessageClassWebPageGroupProxy.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@130316 268f45cc-cd09-0410-ab3c-d52691b4dbfc

12 files changed:
Source/WebKit2/CMakeLists.txt
Source/WebKit2/ChangeLog
Source/WebKit2/DerivedSources.make
Source/WebKit2/DerivedSources.pri
Source/WebKit2/GNUmakefile.list.am
Source/WebKit2/Platform/CoreIPC/MessageID.h
Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
Source/WebKit2/WebProcess/WebPage/WebPageGroupProxy.cpp
Source/WebKit2/WebProcess/WebPage/WebPageGroupProxy.h
Source/WebKit2/WebProcess/WebPage/WebPageGroupProxy.messages.in [new file with mode: 0644]
Source/WebKit2/WebProcess/WebProcess.cpp
Source/WebKit2/win/WebKit2.vcproj

index 119b541..a8d7bb3 100644 (file)
@@ -560,6 +560,7 @@ SET(WebKit2_MESSAGES_IN_FILES
     WebProcess/WebPage/EventDispatcher.messages.in
     WebProcess/WebPage/WebInspector.messages.in
     WebProcess/WebPage/WebPage.messages.in
+    WebProcess/WebPage/WebPageGroupProxy.messages.in
 
     WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.messages.in
 )
index 17a2187..9435f40 100644 (file)
@@ -1,3 +1,34 @@
+2012-10-02  Andy Estes  <aestes@apple.com>
+
+        [WebKit2] Add the ability to send messages to the WebPageGroupProxy
+        https://bugs.webkit.org/show_bug.cgi?id=98233
+
+        Reviewed by Anders Carlsson.
+
+        Add a WebPageGroupProxy.messages.in, implement a stub message receiver
+        in WebPageGroupProxy, and teach WebProcess how to route messages to the
+        appropriate WebPageGroupProxy.
+
+        * CMakeLists.txt: Tell a build system about added files.
+        * DerivedSources.make: Ditto.
+        * DerivedSources.pri: Ditto.
+        * GNUmakefile.list.am: Ditto.
+        * WebKit2.xcodeproj/project.pbxproj: Ditto.
+        * win/WebKit2.vcproj: Ditto.
+        * Platform/CoreIPC/MessageID.h: Add MessageClassWebPageGroupProxy.
+        * WebProcess/WebPage/WebPageGroupProxy.cpp:
+        (WebKit::WebPageGroupProxy::didReceiveMessage): Stub out the method
+        that will receive messages.
+        (WebKit::WebPageGroupProxy::didReceiveWebPageGroupProxyMessage): Stub
+        out a method that will exist in WebPageGroupProxyMessageReceiver.cpp
+        once WebPageGroupProxy.messages.in contains messages.
+        * WebProcess/WebPage/WebPageGroupProxy.h:
+        * WebProcess/WebPage/WebPageGroupProxy.messages.in: Added.
+        * WebProcess/WebProcess.cpp:
+        (WebKit::WebProcess::didReceiveMessage): Route messages to the
+        WebPageGroupProxy matching destinationID if the message is of class
+        MessageClassWebPageGroupProxy.
+
 2012-10-02  Anders Carlsson  <andersca@apple.com>
 
         Change most GraphicsLayer::create calls to use the version that takes a GraphicsLayerFactory
index 896c8e0..c793a55 100644 (file)
@@ -79,6 +79,7 @@ MESSAGE_RECEIVERS = \
     WebNotificationManagerProxy \
     WebNotificationManager \
     WebPage \
+    WebPageGroupProxy \
     WebPageProxy \
     WebProcess \
     WebProcessConnection \
index ad0288b..0b3b342 100644 (file)
@@ -100,6 +100,7 @@ MESSAGE_RECEIVERS = \
     LayerTreeCoordinator.messages.in \
     WebInspector.messages.in \
     WebPage.messages.in \
+    WebPageGroupProxy.messages.in \
     WebPageProxy.messages.in \
     WebProcess.messages.in \
     WebProcessConnection.messages.in \
index 5b09bfd..2543203 100644 (file)
@@ -205,6 +205,8 @@ webkit2_built_sources += \
        DerivedSources/WebKit2/WebNotificationManagerMessages.h \
        DerivedSources/WebKit2/WebNotificationManagerProxyMessageReceiver.cpp \
        DerivedSources/WebKit2/WebNotificationManagerProxyMessages.h \
+       DerivedSources/WebKit2/WebPageGroupProxyMessageReceiver.cpp \
+       DerivedSources/WebKit2/WebPageGroupProxyMessages.h \
        DerivedSources/WebKit2/WebPageProxyMessageReceiver.cpp \
        DerivedSources/WebKit2/WebPageProxyMessages.h \
        DerivedSources/WebKit2/WebPageMessageReceiver.cpp \
index 18d2d79..e45b3bb 100644 (file)
@@ -52,6 +52,7 @@ enum MessageClass {
     MessageClassWebNetworkInfoManagerProxy,
     MessageClassWebNotificationManager,
     MessageClassWebPage,
+    MessageClassWebPageGroupProxy,
     MessageClassWebProcess,
     MessageClassWebResourceCacheManager,
     MessageClassEventDispatcher,
index 77cfa34..4fad184 100644 (file)
                296BD85E15019BC30071F424 /* StringUtilities.mm in Sources */ = {isa = PBXBuildFile; fileRef = 296BD85C15019BC30071F424 /* StringUtilities.mm */; };
                29CD55AA128E294F00133C85 /* WKAccessibilityWebPageObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 29CD55A8128E294F00133C85 /* WKAccessibilityWebPageObject.h */; };
                29CD55AB128E294F00133C85 /* WKAccessibilityWebPageObject.mm in Sources */ = {isa = PBXBuildFile; fileRef = 29CD55A9128E294F00133C85 /* WKAccessibilityWebPageObject.mm */; };
+               29D55DF1161BF9F10031A2E3 /* WebPageGroupProxyMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29D55DEF161BF9F10031A2E3 /* WebPageGroupProxyMessageReceiver.cpp */; };
+               29D55DF2161BF9F10031A2E3 /* WebPageGroupProxyMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 29D55DF0161BF9F10031A2E3 /* WebPageGroupProxyMessages.h */; };
                31099973146C75A20029DEB9 /* WebNotificationClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 31099971146C759B0029DEB9 /* WebNotificationClient.cpp */; };
                310999C7146C9E3D0029DEB9 /* WebNotificationClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 31099968146C71F50029DEB9 /* WebNotificationClient.h */; };
                312C0C4A146DDC8A0016C911 /* WKNotificationProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 312C0C49146DDC8A0016C911 /* WKNotificationProvider.h */; settings = {ATTRIBUTES = (Private, ); }; };
                296BD85C15019BC30071F424 /* StringUtilities.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = StringUtilities.mm; sourceTree = "<group>"; };
                29CD55A8128E294F00133C85 /* WKAccessibilityWebPageObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKAccessibilityWebPageObject.h; sourceTree = "<group>"; };
                29CD55A9128E294F00133C85 /* WKAccessibilityWebPageObject.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKAccessibilityWebPageObject.mm; sourceTree = "<group>"; };
+               29D55DEE161BF8780031A2E3 /* WebPageGroupProxy.messages.in */ = {isa = PBXFileReference; lastKnownFileType = text; path = WebPageGroupProxy.messages.in; sourceTree = "<group>"; };
+               29D55DEF161BF9F10031A2E3 /* WebPageGroupProxyMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebPageGroupProxyMessageReceiver.cpp; path = WebPageGroupProxyMessageReceiver.cpp; sourceTree = "<group>"; };
+               29D55DF0161BF9F10031A2E3 /* WebPageGroupProxyMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebPageGroupProxyMessages.h; path = WebPageGroupProxyMessages.h; sourceTree = "<group>"; };
                31099968146C71F50029DEB9 /* WebNotificationClient.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebNotificationClient.h; sourceTree = "<group>"; };
                31099971146C759B0029DEB9 /* WebNotificationClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebNotificationClient.cpp; sourceTree = "<group>"; };
                312C0C49146DDC8A0016C911 /* WKNotificationProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKNotificationProvider.h; sourceTree = "<group>"; };
                                C0CE72581247E4DA00BC0EC4 /* WebPage.messages.in */,
                                BC7B621412A4219A00D174A4 /* WebPageGroupProxy.cpp */,
                                BC7B621312A4219A00D174A4 /* WebPageGroupProxy.h */,
+                               29D55DEE161BF8780031A2E3 /* WebPageGroupProxy.messages.in */,
                                BCA0EF7E12331E78007D3CFB /* WebUndoStep.cpp */,
                                BCA0EF7D12331E78007D3CFB /* WebUndoStep.h */,
                        );
                                31BA9249148830810062EDB5 /* WebNotificationManagerMessages.h */,
                                318BE1651473433700A8FBB2 /* WebNotificationManagerProxyMessageReceiver.cpp */,
                                318BE1661473433700A8FBB2 /* WebNotificationManagerProxyMessages.h */,
+                               29D55DEF161BF9F10031A2E3 /* WebPageGroupProxyMessageReceiver.cpp */,
+                               29D55DF0161BF9F10031A2E3 /* WebPageGroupProxyMessages.h */,
                                C0CE729E1247E71D00BC0EC4 /* WebPageMessageReceiver.cpp */,
                                C0CE729F1247E71D00BC0EC4 /* WebPageMessages.h */,
                                BCBD3912125BB1A800D2C29F /* WebPageProxyMessageReceiver.cpp */,
                                BC989D85161A9890000D46D3 /* WKWebProcessPlugInInternal.h in Headers */,
                                1A3EED0F161A535400AEB4F5 /* MessageReceiverMap.h in Headers */,
                                1A3EED12161A53D600AEB4F5 /* MessageReceiver.h in Headers */,
+                               29D55DF2161BF9F10031A2E3 /* WebPageGroupProxyMessages.h in Headers */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                                BCDC308B15FD6CD1006B6695 /* WebProcessServiceEntryPoints.mm in Sources */,
                                BC989D81161A7E5D000D46D3 /* WKWebProcessPlugIn.mm in Sources */,
                                1A3EED0E161A535400AEB4F5 /* MessageReceiverMap.cpp in Sources */,
+                               29D55DF1161BF9F10031A2E3 /* WebPageGroupProxyMessageReceiver.cpp in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
index 3bd20c8..8a87762 100644 (file)
@@ -44,5 +44,16 @@ PassRefPtr<WebPageGroupProxy> WebPageGroupProxy::create(const WebPageGroupData&
 WebPageGroupProxy::~WebPageGroupProxy()
 {
 }
+    
+void WebPageGroupProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
+{
+    didReceiveWebPageGroupProxyMessage(connection, messageID, arguments);
+}
+
+void WebPageGroupProxy::didReceiveWebPageGroupProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*)
+{
+    // FIXME: Remove this once WebPageGroupProxy.messages.in contains messages,
+    // in which case this method will be auto-generated.
+}
 
 } // namespace WebKit
index 91e6c5c..9a98447 100644 (file)
 #include "WebPageGroupData.h"
 #include <wtf/PassRefPtr.h>
 
+namespace CoreIPC {
+class ArgumentDecoder;
+class Connection;
+class MessageID;
+}
+
 namespace WebKit {
 
 class WebPageGroupProxy : public APIObject {
@@ -43,6 +49,8 @@ public:
     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::ArgumentDecoder*);
 
 private:
     WebPageGroupProxy(const WebPageGroupData& data)
@@ -51,6 +59,8 @@ private:
     }
 
     virtual Type type() const { return APIType; }
+    
+    void didReceiveWebPageGroupProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
 
     WebPageGroupData m_data;
 };
diff --git a/Source/WebKit2/WebProcess/WebPage/WebPageGroupProxy.messages.in b/Source/WebKit2/WebProcess/WebPage/WebPageGroupProxy.messages.in
new file mode 100644 (file)
index 0000000..4d79310
--- /dev/null
@@ -0,0 +1,24 @@
+# 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.
+
+messages -> WebPageGroupProxy {
+}
index 0061388..56066d5 100644 (file)
@@ -708,6 +708,18 @@ void WebProcess::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::Mes
         m_injectedBundle->didReceiveMessage(connection, messageID, arguments);    
         return;
     }
+    
+    if (messageID.is<CoreIPC::MessageClassWebPageGroupProxy>()) {
+        uint64_t pageGroupID = arguments->destinationID();
+        if (!pageGroupID)
+            return;
+        
+        WebPageGroupProxy* pageGroupProxy = webPageGroup(pageGroupID);
+        if (!pageGroupProxy)
+            return;
+        
+        pageGroupProxy->didReceiveMessage(connection, messageID, arguments);
+    }
 
     uint64_t pageID = arguments->destinationID();
     if (!pageID)
index bd09e08..c76ec17 100755 (executable)
                                        >
                                </File>
                                <File
+                                       RelativePath="..\WebProcess\WebPage\WebPageGroupProxy.messages.in"
+                                       >
+                               </File>
+                               <File
                                        RelativePath="..\WebProcess\WebPage\WebUndoStep.cpp"
                                        >
                                </File>
                                >
                        </File>
                        <File
+                               RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\WebPageGroupProxyMessageReceiver.cpp"
+                               >
+                       </File>
+                       <File
+                               RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\WebPageGroupProxyMessages.h"
+                               >
+                       </File>
+                       <File
                                RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\WebPageMessageReceiver.cpp"
                                >
                        </File>