[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

weinig at apple.com weinig at apple.com
Wed Dec 22 14:06:41 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit d498210935298dc319aa1e14f8c33fd5ecb168a0
Author: weinig at apple.com <weinig at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Oct 4 20:06:49 2010 +0000

    Generate messages sent to the WebProcess class.
    https://bugs.webkit.org/show_bug.cgi?id=47097
    
    Reviewed by Adam Roben.
    
    * DerivedSources.make:
    Add new file to generate and new directory to search.
    
    * Scripts/webkit2/messages.py:
    (forward_declarations_and_headers): Special case class templates.
    (headers_for_type): Special case Vector.
    * Scripts/webkit2/messages_unittest.py:
    Make this script work for passing a templated type.
    
    * Shared/CoreIPCSupport/WebProcessMessageKinds.h: Removed.
    
    * UIProcess/VisitedLinkProvider.cpp:
    (WebKit::VisitedLinkProvider::pendingVisitedLinksTimerFired):
    * UIProcess/WebContext.cpp:
    (WebKit::WebContext::initializeHistoryClient):
    (WebKit::WebContext::ensureWebProcess):
    (WebKit::WebContext::registerURLSchemeAsEmptyDocument):
    (WebKit::WebContext::setCacheModel):
    * UIProcess/WebPageProxy.cpp:
    (WebKit::WebPageProxy::initializeWebPage):
    (WebKit::WebPageProxy::reinitializeWebPage):
    * UIProcess/WebProcessProxy.cpp:
    (WebKit::WebProcessProxy::WebProcessProxy): Always pass both
    the bundle path and a key, even if the key is null, which it will be for
    all non-mac builds for now.
    * UIProcess/mac/WebProcessProxyMac.mm:
    (WebKit::WebProcessProxy::setUpAcceleratedCompositing):
    * UIProcess/win/WebContextWin.cpp:
    (WebKit::WebContext::setShouldPaintNativeControls):
    (WebKit::WebContext::platformSetUpWebProcess):
    Use the new syntax for sending the messages.
    
    * WebProcess/WebProcess.cpp:
    (WebKit::WebProcess::setShouldTrackVisitedLinks):
    (WebKit::WebProcess::setCacheModel):
    (WebKit::WebProcess::setupAcceleratedCompositingPort):
    (WebKit::WebProcess::setShouldPaintNativeControls):
    (WebKit::WebProcess::didReceiveMessage):
    * WebProcess/WebProcess.h:
    Convert to using generated didReceiveWebProcessMessage.
    
    * WebProcess/WebProcess.messages.in: Added.
    
    * WebKit2.pro:
    * WebKit2.xcodeproj/project.pbxproj:
    * win/WebKit2.vcproj:
    Update projects.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@69029 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 14e1c7f..aca06cb 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,5 +1,60 @@
 2010-10-04  Sam Weinig  <sam at webkit.org>
 
+        Reviewed by Adam Roben.
+
+        Generate messages sent to the WebProcess class.
+        https://bugs.webkit.org/show_bug.cgi?id=47097
+
+        * DerivedSources.make:
+        Add new file to generate and new directory to search.
+
+        * Scripts/webkit2/messages.py:
+        (forward_declarations_and_headers): Special case class templates.
+        (headers_for_type): Special case Vector.
+        * Scripts/webkit2/messages_unittest.py:
+        Make this script work for passing a templated type.
+
+        * Shared/CoreIPCSupport/WebProcessMessageKinds.h: Removed.
+
+        * UIProcess/VisitedLinkProvider.cpp:
+        (WebKit::VisitedLinkProvider::pendingVisitedLinksTimerFired):
+        * UIProcess/WebContext.cpp:
+        (WebKit::WebContext::initializeHistoryClient):
+        (WebKit::WebContext::ensureWebProcess):
+        (WebKit::WebContext::registerURLSchemeAsEmptyDocument):
+        (WebKit::WebContext::setCacheModel):
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::initializeWebPage):
+        (WebKit::WebPageProxy::reinitializeWebPage):
+        * UIProcess/WebProcessProxy.cpp:
+        (WebKit::WebProcessProxy::WebProcessProxy): Always pass both
+        the bundle path and a key, even if the key is null, which it will be for
+        all non-mac builds for now.
+        * UIProcess/mac/WebProcessProxyMac.mm:
+        (WebKit::WebProcessProxy::setUpAcceleratedCompositing):
+        * UIProcess/win/WebContextWin.cpp:
+        (WebKit::WebContext::setShouldPaintNativeControls):
+        (WebKit::WebContext::platformSetUpWebProcess):
+        Use the new syntax for sending the messages.
+
+        * WebProcess/WebProcess.cpp:
+        (WebKit::WebProcess::setShouldTrackVisitedLinks):
+        (WebKit::WebProcess::setCacheModel):
+        (WebKit::WebProcess::setupAcceleratedCompositingPort):
+        (WebKit::WebProcess::setShouldPaintNativeControls):
+        (WebKit::WebProcess::didReceiveMessage):
+        * WebProcess/WebProcess.h:
+        Convert to using generated didReceiveWebProcessMessage.
+
+        * WebProcess/WebProcess.messages.in: Added.
+
+        * WebKit2.pro:
+        * WebKit2.xcodeproj/project.pbxproj:
+        * win/WebKit2.vcproj:
+        Update projects.
+
+2010-10-04  Sam Weinig  <sam at webkit.org>
+
         Fix the Mac build.
 
         * WebProcess/mac/WebProcessMac.mm:
diff --git a/WebKit2/DerivedSources.make b/WebKit2/DerivedSources.make
index 4c1bf98..34c9cb3 100644
--- a/WebKit2/DerivedSources.make
+++ b/WebKit2/DerivedSources.make
@@ -2,6 +2,7 @@ VPATH = \
     $(WebKit2)/PluginProcess \
     $(WebKit2)/WebProcess/Plugins \
     $(WebKit2)/WebProcess/WebPage \
+    $(WebKit2)/WebProcess \
     $(WebKit2)/UIProcess/Plugins \
 #
 
@@ -11,6 +12,7 @@ MESSAGE_RECEIVERS = \
     PluginProcessProxy \
     PluginProxy \
     WebPage \
+    WebProcess \
     WebProcessConnection \
 #
 
diff --git a/WebKit2/Scripts/webkit2/messages.py b/WebKit2/Scripts/webkit2/messages.py
index 7c6f1bb..6f2d263 100644
--- a/WebKit2/Scripts/webkit2/messages.py
+++ b/WebKit2/Scripts/webkit2/messages.py
@@ -227,6 +227,12 @@ def forward_declarations_and_headers(receiver):
 
     for parameter in receiver.iterparameters():
         type = parameter.type
+
+        if type.find('<') != -1:
+            # Don't forward declare class templates.
+            headers.update(headers_for_type(type))
+            continue
+
         split = type.split('::')
 
         if len(split) == 2:
@@ -331,6 +337,12 @@ def argument_coder_headers_for_type(type):
 
 
 def headers_for_type(type):
+    # Check for Vector.
+    match = re.search(r'Vector<(.+)>', type)
+    if match:
+        element_type = match.groups()[0].strip()
+        return ['<wtf/Vector.h>'] + headers_for_type(element_type)
+
     special_cases = {
         'WTF::String': '<wtf/text/WTFString.h>',
         'WebKit::WebKeyboardEvent': '"WebEvent.h"',
diff --git a/WebKit2/Scripts/webkit2/messages_unittest.py b/WebKit2/Scripts/webkit2/messages_unittest.py
index f4ed5fc..3b45680 100644
--- a/WebKit2/Scripts/webkit2/messages_unittest.py
+++ b/WebKit2/Scripts/webkit2/messages_unittest.py
@@ -238,6 +238,7 @@ _expected_header = """/*
 #include "Arguments.h"
 #include "MessageID.h"
 #include "Plugin.h"
+#include <wtf/Vector.h>
 
 namespace CoreIPC {
     class MachPort;
diff --git a/WebKit2/Shared/CoreIPCSupport/WebProcessMessageKinds.h b/WebKit2/Shared/CoreIPCSupport/WebProcessMessageKinds.h
deleted file mode 100644
index 20dbd4e..0000000
--- a/WebKit2/Shared/CoreIPCSupport/WebProcessMessageKinds.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (C) 2010 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 WebProcessMessageKinds_h
-#define WebProcessMessageKinds_h
-
-// Messages sent from WebKit to the web process.
-
-#include "MessageID.h"
-
-namespace WebProcessMessage {
-
-enum Kind {
-    SetVisitedLinkTable,
-    VisitedLinkStateChanged,
-    AllVisitedLinkStateChanged,
-    
-    LoadInjectedBundle,
-    SetApplicationCacheDirectory,
-    SetShouldTrackVisitedLinks,
-    SetCacheModel,
-    Create,
-    RegisterURLSchemeAsEmptyDocument,
-#if PLATFORM(MAC)
-    SetupAcceleratedCompositingPort,
-#endif
-#if PLATFORM(WIN)
-    SetShouldPaintNativeControls,
-#endif
-};
-
-}
-
-namespace CoreIPC {
-
-template<> struct MessageKindTraits<WebProcessMessage::Kind> { 
-    static const MessageClass messageClass = MessageClassWebProcess;
-};
-
-}
-
-#endif // WebProcessMessageKinds_h
diff --git a/WebKit2/UIProcess/VisitedLinkProvider.cpp b/WebKit2/UIProcess/VisitedLinkProvider.cpp
index e8a1244..83b5414 100644
--- a/WebKit2/UIProcess/VisitedLinkProvider.cpp
+++ b/WebKit2/UIProcess/VisitedLinkProvider.cpp
@@ -28,7 +28,7 @@
 #include "SharedMemory.h"
 #include "VisitedLinkTable.h"
 #include "WebContext.h"
-#include "WebProcessMessageKinds.h"
+#include "WebProcessMessages.h"
 
 using namespace WebCore;
 
@@ -151,18 +151,17 @@ void VisitedLinkProvider::pendingVisitedLinksTimerFired()
         if (!m_table.sharedMemory()->createHandle(handle, SharedMemory::ReadOnly))
             return;
 
-        m_context->process()->send(WebProcessMessage::SetVisitedLinkTable, 0, CoreIPC::In(handle));
+        m_context->process()->send(Messages::WebProcess::SetVisitedLinkTable(handle), 0);
     }
     
     // We now need to let the web process know that we've added links.
     if (addedVisitedLinks.size() <= 20) {
-        m_context->process()->send(WebProcessMessage::VisitedLinkStateChanged, 0, CoreIPC::In(addedVisitedLinks));
+        m_context->process()->send(Messages::WebProcess::VisitedLinkStateChanged(addedVisitedLinks), 0);
         return;
     }
     
     // Just recalculate all the visited links.
-    m_context->process()->send(WebProcessMessage::AllVisitedLinkStateChanged, 0, CoreIPC::In());
-    return;
+    m_context->process()->send(Messages::WebProcess::AllVisitedLinkStateChanged(), 0);
 }
 
 } // namespace WebKit
diff --git a/WebKit2/UIProcess/WebContext.cpp b/WebKit2/UIProcess/WebContext.cpp
index 137facd..609f75a 100644
--- a/WebKit2/UIProcess/WebContext.cpp
+++ b/WebKit2/UIProcess/WebContext.cpp
@@ -28,21 +28,19 @@
 #include "ImmutableArray.h"
 #include "InjectedBundleMessageKinds.h"
 #include "RunLoop.h"
+#include "WKContextPrivate.h"
 #include "WebContextMessageKinds.h"
 #include "WebContextUserMessageCoders.h"
 #include "WebCoreArgumentCoders.h"
 #include "WebPageNamespace.h"
 #include "WebPreferences.h"
 #include "WebProcessManager.h"
-#include "WebProcessMessageKinds.h"
+#include "WebProcessMessages.h"
 #include "WebProcessProxy.h"
+#include <WebCore/LinkHash.h>
 #include <wtf/OwnArrayPtr.h>
 #include <wtf/PassOwnArrayPtr.h>
 
-#include "WKContextPrivate.h"
-
-#include <WebCore/LinkHash.h>
-
 #ifndef NDEBUG
 #include <wtf/RefCountedLeakCounter.h>
 #endif
@@ -116,7 +114,7 @@ void WebContext::initializeHistoryClient(const WKContextHistoryClient* client)
     if (!hasValidProcess())
         return;
         
-    m_process->send(WebProcessMessage::SetShouldTrackVisitedLinks, 0, CoreIPC::In(m_historyClient.shouldTrackVisitedLinks()));
+    m_process->send(Messages::WebProcess::SetShouldTrackVisitedLinks(m_historyClient.shouldTrackVisitedLinks()), 0);
 }
 
 void WebContext::ensureWebProcess()
@@ -126,11 +124,11 @@ void WebContext::ensureWebProcess()
 
     m_process = WebProcessManager::shared().getWebProcess(this);
 
-    m_process->send(WebProcessMessage::SetShouldTrackVisitedLinks, 0, CoreIPC::In(m_historyClient.shouldTrackVisitedLinks()));
-    m_process->send(WebProcessMessage::SetCacheModel, 0, CoreIPC::In(static_cast<uint32_t>(m_cacheModel)));
+    m_process->send(Messages::WebProcess::SetShouldTrackVisitedLinks(m_historyClient.shouldTrackVisitedLinks()), 0);
+    m_process->send(Messages::WebProcess::SetCacheModel(static_cast<uint32_t>(m_cacheModel)), 0);
 
     for (HashSet<String>::iterator it = m_schemesToRegisterAsEmptyDocument.begin(), end = m_schemesToRegisterAsEmptyDocument.end(); it != end; ++it)
-        m_process->send(WebProcessMessage::RegisterURLSchemeAsEmptyDocument, 0, CoreIPC::In(*it));
+        m_process->send(Messages::WebProcess::RegisterURLSchemeAsEmptyDocument(*it), 0);
 
     for (size_t i = 0; i != m_pendingMessagesToPostToInjectedBundle.size(); ++i) {
         pair<String, RefPtr<APIObject> >* message = &m_pendingMessagesToPostToInjectedBundle[i];
@@ -283,7 +281,7 @@ void WebContext::registerURLSchemeAsEmptyDocument(const String& urlScheme)
     if (!hasValidProcess())
         return;
 
-    m_process->send(WebProcessMessage::RegisterURLSchemeAsEmptyDocument, 0, CoreIPC::In(urlScheme));
+    m_process->send(Messages::WebProcess::RegisterURLSchemeAsEmptyDocument(urlScheme), 0);
 }
 
 void WebContext::addVisitedLink(const String& visitedURL)
@@ -306,7 +304,7 @@ void WebContext::setCacheModel(CacheModel cacheModel)
 
     if (!hasValidProcess())
         return;
-    m_process->send(WebProcessMessage::SetCacheModel, 0, CoreIPC::In(static_cast<uint32_t>(m_cacheModel)));
+    m_process->send(Messages::WebProcess::SetCacheModel(static_cast<uint32_t>(m_cacheModel)), 0);
 }
 
 void WebContext::didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
diff --git a/WebKit2/UIProcess/WebPageProxy.cpp b/WebKit2/UIProcess/WebPageProxy.cpp
index b6fe5a6..b92bd53 100644
--- a/WebKit2/UIProcess/WebPageProxy.cpp
+++ b/WebKit2/UIProcess/WebPageProxy.cpp
@@ -46,7 +46,7 @@
 #include "WebPageProxyMessageKinds.h"
 #include "WebPreferences.h"
 #include "WebProcessManager.h"
-#include "WebProcessMessageKinds.h"
+#include "WebProcessMessages.h"
 #include "WebProcessProxy.h"
 #include "WebURLRequest.h"
 
@@ -155,8 +155,7 @@ void WebPageProxy::initializeWebPage(const IntSize& size)
     }
 
     ASSERT(m_drawingArea);
-
-    process()->send(WebProcessMessage::Create, m_pageID, CoreIPC::In(creationParameters(size)));
+    process()->send(Messages::WebProcess::CreateWebPage(m_pageID, creationParameters(size)), 0);
 }
 
 void WebPageProxy::reinitializeWebPage(const WebCore::IntSize& size)
@@ -165,8 +164,7 @@ void WebPageProxy::reinitializeWebPage(const WebCore::IntSize& size)
         return;
 
     ASSERT(m_drawingArea);
-
-    process()->send(WebProcessMessage::Create, m_pageID, CoreIPC::In(creationParameters(size)));
+    process()->send(Messages::WebProcess::CreateWebPage(m_pageID, creationParameters(size)), 0);
 }
 
 void WebPageProxy::close()
diff --git a/WebKit2/UIProcess/WebProcessProxy.cpp b/WebKit2/UIProcess/WebProcessProxy.cpp
index e12f102..98e8672 100644
--- a/WebKit2/UIProcess/WebProcessProxy.cpp
+++ b/WebKit2/UIProcess/WebProcessProxy.cpp
@@ -33,7 +33,7 @@
 #include "WebPageNamespace.h"
 #include "WebPageProxy.h"
 #include "WebProcessManager.h"
-#include "WebProcessMessageKinds.h"
+#include "WebProcessMessages.h"
 #include "WebProcessProxyMessageKinds.h"
 #include <WebCore/KURL.h>
 #include <wtf/text/CString.h>
@@ -68,7 +68,7 @@ WebProcessProxy::WebProcessProxy(WebContext* context)
     // single "Initialize" messages with a struct that has all the needed information.
     String applicationCacheDirectory = m_context->applicationCacheDirectory();
     if (!applicationCacheDirectory.isEmpty())
-        send(WebProcessMessage::SetApplicationCacheDirectory, 0, CoreIPC::In(applicationCacheDirectory));
+        send(Messages::WebProcess::SetApplicationCacheDirectory(applicationCacheDirectory), 0);
 
     // FIXME: We could instead send the bundle path as part of the arguments to process creation?
     // Would that be better than sending a connection?
@@ -77,11 +77,11 @@ WebProcessProxy::WebProcessProxy(WebContext* context)
         char *sandboxBundleToken = NULL;
         CString injectedBundlePath = context->injectedBundlePath().utf8();
         sandbox_issue_extension(injectedBundlePath.data(), &sandboxBundleToken);
-        send(WebProcessMessage::LoadInjectedBundle, 0, CoreIPC::In(context->injectedBundlePath(), String::fromUTF8(sandboxBundleToken)));
+        send(Messages::WebProcess::LoadInjectedBundle(context->injectedBundlePath(), String::fromUTF8(sandboxBundleToken)), 0);
         if (sandboxBundleToken)
             free(sandboxBundleToken);
 #else
-        send(WebProcessMessage::LoadInjectedBundle, 0, CoreIPC::In(context->injectedBundlePath()));
+        send(Messages::WebProcess::LoadInjectedBundle(context->injectedBundlePath(), String()), 0);
 #endif
     }
 
diff --git a/WebKit2/UIProcess/mac/WebProcessProxyMac.mm b/WebKit2/UIProcess/mac/WebProcessProxyMac.mm
index ed5cdd5..c6c1913 100644
--- a/WebKit2/UIProcess/mac/WebProcessProxyMac.mm
+++ b/WebKit2/UIProcess/mac/WebProcessProxyMac.mm
@@ -27,7 +27,7 @@
 
 #include "MachPort.h"
 #include "WebKitSystemInterface.h"
-#include "WebProcessMessageKinds.h"
+#include "WebProcessMessages.h"
 
 using namespace WebCore;
 
@@ -39,7 +39,7 @@ void WebProcessProxy::setUpAcceleratedCompositing()
 #if HAVE(HOSTED_CORE_ANIMATION)
     mach_port_t renderServerPort = WKInitializeRenderServer();
     if (renderServerPort != MACH_PORT_NULL)
-        send(WebProcessMessage::SetupAcceleratedCompositingPort, 0, CoreIPC::In(CoreIPC::MachPort(renderServerPort, MACH_MSG_TYPE_COPY_SEND)));
+        send(Messages::WebProcess::SetUpAcceleratedCompositingPort(CoreIPC::MachPort(renderServerPort, MACH_MSG_TYPE_COPY_SEND)), 0);
 #endif
 }
 #endif
diff --git a/WebKit2/UIProcess/win/WebContextWin.cpp b/WebKit2/UIProcess/win/WebContextWin.cpp
index f813190..326d132 100644
--- a/WebKit2/UIProcess/win/WebContextWin.cpp
+++ b/WebKit2/UIProcess/win/WebContextWin.cpp
@@ -25,7 +25,7 @@
 
 #include "WebContext.h"
 
-#include "WebProcessMessageKinds.h"
+#include "WebProcessMessages.h"
 #include <WebCore/FileSystem.h>
 
 using namespace WebCore;
@@ -43,13 +43,12 @@ void WebContext::setShouldPaintNativeControls(bool b)
 
     if (!hasValidProcess())
         return;
-
-    m_process->send(WebProcessMessage::SetShouldPaintNativeControls, 0, CoreIPC::In(m_shouldPaintNativeControls));
+    m_process->send(Messages::WebProcess::SetShouldPaintNativeControls(m_shouldPaintNativeControls), 0);
 }
 
 void WebContext::platformSetUpWebProcess()
 {
-    m_process->send(WebProcessMessage::SetShouldPaintNativeControls, 0, CoreIPC::In(m_shouldPaintNativeControls));
+    m_process->send(Messages::WebProcess::SetShouldPaintNativeControls(m_shouldPaintNativeControls), 0);
 }
 
 } // namespace WebKit
diff --git a/WebKit2/WebKit2.pro b/WebKit2/WebKit2.pro
index 611ccfc..6780ed5 100644
--- a/WebKit2/WebKit2.pro
+++ b/WebKit2/WebKit2.pro
@@ -140,10 +140,12 @@ QMAKE_CXXFLAGS += "-include $$PREFIX_HEADER"
 DEFINES += BUILDING_QT__
 
 WEBKIT2_GENERATED_HEADERS = \
-    $$OUTPUT_DIR/WebKit2/generated/WebPageMessages.h
+    $$OUTPUT_DIR/WebKit2/generated/WebPageMessages.h \
+    $$OUTPUT_DIR/WebKit2/generated/WebProcessMessages.h
 
 WEBKIT2_GENERATED_SOURCES = \
-    $$OUTPUT_DIR/WebKit2/generated/WebPageMessageReceiver.cpp
+    $$OUTPUT_DIR/WebKit2/generated/WebPageMessageReceiver.cpp \
+    $$OUTPUT_DIR/WebKit2/generated/WebProcessMessageReceiver.cpp
 
 HEADERS += \
     Platform/CoreIPC/ArgumentDecoder.h \
@@ -175,7 +177,6 @@ HEADERS += \
     Shared/CoreIPCSupport/DrawingAreaMessageKinds.h \
     Shared/CoreIPCSupport/DrawingAreaProxyMessageKinds.h \
     Shared/CoreIPCSupport/WebPageProxyMessageKinds.h \
-    Shared/CoreIPCSupport/WebProcessMessageKinds.h \
     Shared/CacheModel.h \
     Shared/DrawingAreaBase.h \
     Shared/ImmutableArray.h \
diff --git a/WebKit2/WebKit2.xcodeproj/project.pbxproj b/WebKit2/WebKit2.xcodeproj/project.pbxproj
index 7499e34..8cb0984 100644
--- a/WebKit2/WebKit2.xcodeproj/project.pbxproj
+++ b/WebKit2/WebKit2.xcodeproj/project.pbxproj
@@ -225,6 +225,8 @@
 		BC2E6E8E1141971500A63B1E /* WorkQueue.h in Headers */ = {isa = PBXBuildFile; fileRef = BC2E6E7E1141970C00A63B1E /* WorkQueue.h */; };
 		BC3065C412592F8900E71278 /* WebProcessMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC3065C312592F8900E71278 /* WebProcessMac.mm */; };
 		BC3065FA1259344E00E71278 /* CacheModel.h in Headers */ = {isa = PBXBuildFile; fileRef = BC3065F91259344E00E71278 /* CacheModel.h */; };
+		BC3066BE125A442100E71278 /* WebProcessMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC3066BC125A442100E71278 /* WebProcessMessageReceiver.cpp */; };
+		BC3066BF125A442100E71278 /* WebProcessMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = BC3066BD125A442100E71278 /* WebProcessMessages.h */; };
 		BC33DD681238464600360F3F /* WebNumber.h in Headers */ = {isa = PBXBuildFile; fileRef = BC33DD671238464600360F3F /* WebNumber.h */; };
 		BC33E0D112408E8600360F3F /* InjectedBundleRangeHandle.h in Headers */ = {isa = PBXBuildFile; fileRef = BC33E0CF12408E8600360F3F /* InjectedBundleRangeHandle.h */; };
 		BC33E0D212408E8600360F3F /* InjectedBundleRangeHandle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC33E0D012408E8600360F3F /* InjectedBundleRangeHandle.cpp */; };
@@ -674,6 +676,9 @@
 		BC2E6E7E1141970C00A63B1E /* WorkQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WorkQueue.h; sourceTree = "<group>"; };
 		BC3065C312592F8900E71278 /* WebProcessMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebProcessMac.mm; sourceTree = "<group>"; };
 		BC3065F91259344E00E71278 /* CacheModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CacheModel.h; sourceTree = "<group>"; };
+		BC3066B9125A436300E71278 /* WebProcess.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebProcess.messages.in; sourceTree = "<group>"; };
+		BC3066BC125A442100E71278 /* WebProcessMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebProcessMessageReceiver.cpp; sourceTree = "<group>"; };
+		BC3066BD125A442100E71278 /* WebProcessMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebProcessMessages.h; sourceTree = "<group>"; };
 		BC33DD671238464600360F3F /* WebNumber.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebNumber.h; sourceTree = "<group>"; };
 		BC33E0CF12408E8600360F3F /* InjectedBundleRangeHandle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedBundleRangeHandle.h; sourceTree = "<group>"; };
 		BC33E0D012408E8600360F3F /* InjectedBundleRangeHandle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedBundleRangeHandle.cpp; sourceTree = "<group>"; };
@@ -1213,6 +1218,7 @@
 				BC111AE3112F5C2600337BAB /* WebProcess.cpp */,
 				BC032D9110F437AF0058C15A /* WebProcess.h */,
 				1A6FA01F11E1528700DB1371 /* WebProcessMain.h */,
+				BC3066B9125A436300E71278 /* WebProcess.messages.in */,
 			);
 			path = WebProcess;
 			sourceTree = "<group>";
@@ -1695,6 +1701,8 @@
 				C0CE729F1247E71D00BC0EC4 /* WebPageMessages.h */,
 				1A043F6712514D8B00FFBFB5 /* WebProcessConnectionMessageReceiver.cpp */,
 				1A043F6812514D8B00FFBFB5 /* WebProcessConnectionMessages.h */,
+				BC3066BC125A442100E71278 /* WebProcessMessageReceiver.cpp */,
+				BC3066BD125A442100E71278 /* WebProcessMessages.h */,
 			);
 			name = "Derived Sources";
 			path = DerivedSources/WebKit2;
@@ -1925,6 +1933,7 @@
 				1A8EFDFA1253CAA200F7067F /* DataReference.h in Headers */,
 				BC9099801256A98200083756 /* WKStringPrivate.h in Headers */,
 				BC3065FA1259344E00E71278 /* CacheModel.h in Headers */,
+				BC3066BF125A442100E71278 /* WebProcessMessages.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -2220,6 +2229,7 @@
 				1A8EFA701252B84100F7067F /* PluginProxyMessageReceiver.cpp in Sources */,
 				1A8EFDFE1253CB6E00F7067F /* DataReference.cpp in Sources */,
 				BC3065C412592F8900E71278 /* WebProcessMac.mm in Sources */,
+				BC3066BE125A442100E71278 /* WebProcessMessageReceiver.cpp in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
diff --git a/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp b/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
index 93c419d..88338c8 100644
--- a/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
+++ b/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
@@ -121,8 +121,8 @@ Page* WebChromeClient::createWindow(Frame*, const FrameLoadRequest&, const Windo
     if (!newPageID)
         return 0;
 
-    WebPage* newWebPage = WebProcess::shared().createWebPage(newPageID, parameters);
-    return newWebPage->corePage();
+    WebProcess::shared().createWebPage(newPageID, parameters);
+    return WebProcess::shared().webPage(newPageID)->corePage();
 }
 
 void WebChromeClient::show()
diff --git a/WebKit2/WebProcess/WebProcess.cpp b/WebKit2/WebProcess/WebProcess.cpp
index 7545dc3..0b5ba93 100644
--- a/WebKit2/WebProcess/WebProcess.cpp
+++ b/WebKit2/WebProcess/WebProcess.cpp
@@ -34,8 +34,8 @@
 #include "WebPageCreationParameters.h"
 #include "WebPlatformStrategies.h"
 #include "WebPreferencesStore.h"
+#include "WebProcessMessages.h"
 #include "WebProcessProxyMessageKinds.h"
-#include "WebProcessMessageKinds.h"
 #include <WebCore/ApplicationCacheStorage.h>
 #include <WebCore/Page.h>
 #include <WebCore/PageGroup.h>
@@ -44,10 +44,6 @@
 #include <wtf/PassRefPtr.h>
 #include <wtf/RandomNumber.h>
 
-#if PLATFORM(MAC)
-#include "MachPort.h"
-#endif
-
 #ifndef NDEBUG
 #include <WebCore/Cache.h>
 #include <WebCore/GCController.h>
@@ -140,6 +136,11 @@ void WebProcess::setApplicationCacheDirectory(const String& directory)
     cacheStorage().setCacheDirectory(directory);
 }
 
+void WebProcess::setShouldTrackVisitedLinks(bool shouldTrackVisitedLinks)
+{
+    PageGroup::setShouldTrackVisitedLinks(shouldTrackVisitedLinks);
+}
+
 void WebProcess::registerURLSchemeAsEmptyDocument(const String& urlScheme)
 {
     SchemeRegistry::registerURLSchemeAsEmptyDocument(urlScheme);
@@ -183,8 +184,10 @@ void WebProcess::addVisitedLink(WebCore::LinkHash linkHash)
     m_connection->send(WebProcessProxyMessage::AddVisitedLink, 0, CoreIPC::In(linkHash));
 }
 
-void WebProcess::setCacheModel(CacheModel cacheModel)
+void WebProcess::setCacheModel(uint32_t cm)
 {
+    CacheModel cacheModel = static_cast<CacheModel>(cm);
+
     if (!m_hasSetCacheModel || cacheModel != m_cacheModel) {
         m_hasSetCacheModel = true;
         m_cacheModel = cacheModel;
@@ -192,12 +195,28 @@ void WebProcess::setCacheModel(CacheModel cacheModel)
     }
 }
 
+#if USE(ACCELERATED_COMPOSITING) && PLATFORM(MAC)
+void WebProcess::setUpAcceleratedCompositingPort(CoreIPC::MachPort port)
+{
+    m_compositingRenderServerPort = port.port();
+}
+#endif
+
+#if PLATFORM(WIN)
+void WebProcess::setShouldPaintNativeControls(bool shouldPaintNativeControls)
+{
+#if USE(SAFARI_THEME)
+    Settings::setShouldPaintNativeControls(shouldPaintNativeControls);
+#endif
+}
+#endif
+
 WebPage* WebProcess::webPage(uint64_t pageID) const
 {
     return m_pageMap.get(pageID).get();
 }
 
-WebPage* WebProcess::createWebPage(uint64_t pageID, const WebPageCreationParameters& parameters)
+void WebProcess::createWebPage(uint64_t pageID, const WebPageCreationParameters& parameters)
 {
     // It is necessary to check for page existence here since during a window.open() (or targeted
     // link) the WebPage gets created both in the synchronous handler and through the normal way. 
@@ -208,7 +227,6 @@ WebPage* WebProcess::createWebPage(uint64_t pageID, const WebPageCreationParamet
     }
 
     ASSERT(result.first->second);
-    return result.first->second.get();
 }
 
 void WebProcess::removeWebPage(uint64_t pageID)
@@ -247,107 +265,8 @@ void WebProcess::shutdown()
 void WebProcess::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
 {
     if (messageID.is<CoreIPC::MessageClassWebProcess>()) {
-        switch (messageID.get<WebProcessMessage::Kind>()) {
-            case WebProcessMessage::SetVisitedLinkTable: {
-                SharedMemory::Handle handle;
-                if (!arguments->decode(CoreIPC::Out(handle)))
-                    return;
-                
-                setVisitedLinkTable(handle);
-                return;
-            }
-            case WebProcessMessage::VisitedLinkStateChanged: {
-                Vector<LinkHash> linkHashes;
-                if (!arguments->decode(CoreIPC::Out(linkHashes)))
-                    return;
-                visitedLinkStateChanged(linkHashes);
-                return;
-            }
-            case WebProcessMessage::AllVisitedLinkStateChanged:
-                allVisitedLinkStateChanged();
-                return;
-            
-            case WebProcessMessage::LoadInjectedBundle: {
-                String path;
-
-#if ENABLE(WEB_PROCESS_SANDBOX)
-                String token;
-                if (!arguments->decode(CoreIPC::Out(path, token)))
-                    return;
-
-                loadInjectedBundle(path, token);
-                return;
-#else
-                if (!arguments->decode(CoreIPC::Out(path)))
-                    return;
-
-                loadInjectedBundle(path);
-                return;
-#endif
-            }
-            case WebProcessMessage::SetApplicationCacheDirectory: {
-                String directory;
-                if (!arguments->decode(CoreIPC::Out(directory)))
-                    return;
-                
-                setApplicationCacheDirectory(directory);
-                return;
-            }
-            case WebProcessMessage::SetShouldTrackVisitedLinks: {
-                bool shouldTrackVisitedLinks;
-                if (!arguments->decode(CoreIPC::Out(shouldTrackVisitedLinks)))
-                    return;
-                
-                PageGroup::setShouldTrackVisitedLinks(shouldTrackVisitedLinks);
-                return;
-            }
-            case WebProcessMessage::SetCacheModel: {
-                uint32_t cacheModel;
-                if (!arguments->decode(CoreIPC::Out(cacheModel)))
-                    return;
-                
-                setCacheModel(static_cast<CacheModel>(cacheModel));
-                return;
-            }
-            case WebProcessMessage::Create: {
-                uint64_t pageID = arguments->destinationID();
-                WebPageCreationParameters parameters;
-                if (!arguments->decode(CoreIPC::Out(parameters)))
-                    return;
-
-                createWebPage(pageID, parameters);
-                return;
-            }
-            case WebProcessMessage::RegisterURLSchemeAsEmptyDocument: {
-                String message;
-                if (!arguments->decode(CoreIPC::Out(message)))
-                    return;
-
-                registerURLSchemeAsEmptyDocument(message);
-                return;
-            }
-#if USE(ACCELERATED_COMPOSITING) && PLATFORM(MAC)
-            case WebProcessMessage::SetupAcceleratedCompositingPort: {
-                CoreIPC::MachPort port;
-                if (!arguments->decode(port))
-                    return;
-
-                m_compositingRenderServerPort = port.port();
-                return;
-            }
-#endif
-#if PLATFORM(WIN)
-            case WebProcessMessage::SetShouldPaintNativeControls: {
-                bool b;
-                if (!arguments->decode(b))
-                    return;
-#if USE(SAFARI_THEME)
-                Settings::setShouldPaintNativeControls(b);
-#endif
-                return;
-            }
-#endif
-        }
+        didReceiveWebProcessMessage(connection, messageID, arguments);
+        return;
     }
 
     if (messageID.is<CoreIPC::MessageClassInjectedBundle>()) {
diff --git a/WebKit2/WebProcess/WebProcess.h b/WebKit2/WebProcess/WebProcess.h
index 8364f8e..a136764 100644
--- a/WebKit2/WebProcess/WebProcess.h
+++ b/WebKit2/WebProcess/WebProcess.h
@@ -35,6 +35,10 @@
 #include <wtf/Forward.h>
 #include <wtf/HashMap.h>
 
+#if PLATFORM(MAC)
+#include "MachPort.h"
+#endif
+
 namespace WebCore {
     class IntSize;
     class PageGroup;
@@ -58,7 +62,7 @@ public:
     RunLoop* runLoop() const { return m_runLoop; }
 
     WebPage* webPage(uint64_t pageID) const;
-    WebPage* createWebPage(uint64_t pageID, const WebPageCreationParameters&);
+    void createWebPage(uint64_t pageID, const WebPageCreationParameters&);
     void removeWebPage(uint64_t pageID);
 
     InjectedBundle* injectedBundle() const { return m_injectedBundle.get(); }
@@ -88,13 +92,22 @@ private:
     void loadInjectedBundle(const String&);
 #endif
     void setApplicationCacheDirectory(const String&);
+    void setShouldTrackVisitedLinks(bool);
     void registerURLSchemeAsEmptyDocument(const String&);
 
+#if USE(ACCELERATED_COMPOSITING) && PLATFORM(MAC)
+    void setUpAcceleratedCompositingPort(CoreIPC::MachPort);
+#endif
+#if PLATFORM(WIN)
+    void setShouldPaintNativeControls(bool);
+#endif
+
+
     void setVisitedLinkTable(const SharedMemory::Handle&);
     void visitedLinkStateChanged(const Vector<WebCore::LinkHash>& linkHashes);
     void allVisitedLinkStateChanged();
 
-    void setCacheModel(CacheModel cacheModel);
+    void setCacheModel(uint32_t);
     void platformSetCacheModel(CacheModel);
 
     // CoreIPC::Connection::Client
@@ -102,6 +115,9 @@ private:
     void didClose(CoreIPC::Connection*);
     void didReceiveInvalidMessage(CoreIPC::Connection*, CoreIPC::MessageID);
 
+    // Implemented in generated WebProcessMessageReceiver.cpp
+    void didReceiveWebProcessMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+    
     RefPtr<CoreIPC::Connection> m_connection;
     HashMap<uint64_t, RefPtr<WebPage> > m_pageMap;
     RefPtr<InjectedBundle> m_injectedBundle;
diff --git a/WebKit2/WebProcess/WebProcess.messages.in b/WebKit2/WebProcess/WebProcess.messages.in
new file mode 100644
index 0000000..83d4f41
--- /dev/null
+++ b/WebKit2/WebProcess/WebProcess.messages.in
@@ -0,0 +1,44 @@
+# Copyright (C) 2010 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 -> WebProcess {
+    # Visited link tracking.
+    SetVisitedLinkTable(WebKit::SharedMemory::Handle handle)
+    VisitedLinkStateChanged(Vector<WebCore::LinkHash> linkHashes)
+    AllVisitedLinkStateChanged()
+
+    # Create a new page.
+    CreateWebPage(uint64_t newPageID, WebKit::WebPageCreationParameters pageCreationParameters)
+
+    # Process initialization.
+    LoadInjectedBundle(WTF::String bundlePath, WTF::String token)
+    SetApplicationCacheDirectory(WTF::String applicationCacheDirectory)
+    SetShouldTrackVisitedLinks(bool shouldTrackVisitedLinks)
+    SetCacheModel(uint32_t cacheModel)
+    RegisterURLSchemeAsEmptyDocument(WTF::String scheme)
+#if PLATFORM(MAC)
+    SetUpAcceleratedCompositingPort(CoreIPC::MachPort port)
+#endif
+#if PLATFORM(WIN)
+    SetShouldPaintNativeControls(bool shouldPaintNativeControls)
+#endif
+}
diff --git a/WebKit2/win/WebKit2.vcproj b/WebKit2/win/WebKit2.vcproj
index 761fbf9..6615eb0 100755
--- a/WebKit2/win/WebKit2.vcproj
+++ b/WebKit2/win/WebKit2.vcproj
@@ -760,10 +760,6 @@
 					>
 				</File>
 				<File
-					RelativePath="..\Shared\CoreIPCSupport\WebProcessMessageKinds.h"
-					>
-				</File>
-				<File
 					RelativePath="..\Shared\CoreIPCSupport\WebProcessProxyMessageKinds.h"
 					>
 				</File>
@@ -2024,6 +2020,14 @@
 				RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\WebPageMessages.h"
 				>
 			</File>
+			<File
+				RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\WebProcessMessageReceiver.cpp"
+				>
+			</File>
+			<File
+				RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\WebProcessMessages.h"
+				>
+			</File>
 		</Filter>
 		<Filter
 			Name="Scripts"

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list