[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:59 UTC 2010


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

    Change WebProcess initialization to be done with an
    auxiliary struct.
    
    Reviewed by Anders Carlsson.
    
    * Platform/CoreIPC/mac/MachPort.h:
    * Shared/WebProcessCreationParameters.cpp: Added.
    (WebKit::WebProcessCreationParameters::WebProcessCreationParameters):
    (WebKit::WebProcessCreationParameters::encode):
    (WebKit::WebProcessCreationParameters::decode):
    * Shared/WebProcessCreationParameters.h: Added.
    * UIProcess/WebContext.cpp:
    (WebKit::WebContext::ensureWebProcess):
    * UIProcess/WebContext.h:
    * UIProcess/WebProcessProxy.cpp:
    (WebKit::WebProcessProxy::WebProcessProxy):
    * UIProcess/WebProcessProxy.h:
    * UIProcess/mac/WebContextMac.mm:
    (WebKit::WebContext::platformInitializeWebProcess):
    * UIProcess/mac/WebProcessProxyMac.mm: Removed.
    * UIProcess/qt/WebContextQt.cpp:
    (WebKit::WebContext::applicationCacheDirectory):
    (WebKit::WebContext::platformInitializeWebProcess):
    * UIProcess/win/WebContextWin.cpp:
    (WebKit::WebContext::platformInitializeWebProcess):
    * WebKit2.pro:
    * WebKit2.xcodeproj/project.pbxproj:
    * WebProcess/WebProcess.cpp:
    (WebKit::WebProcess::initializeWebProcess):
    * WebProcess/WebProcess.h:
    * WebProcess/WebProcess.messages.in:
    * win/WebKit2.vcproj:
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@69037 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 2725ceb..ac3164b 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,38 @@
+2010-10-04  Sam Weinig  <sam at webkit.org>
+
+        Reviewed by Anders Carlsson.
+
+        Change WebProcess initialization to be done with an
+        auxiliary struct.
+
+        * Platform/CoreIPC/mac/MachPort.h:
+        * Shared/WebProcessCreationParameters.cpp: Added.
+        (WebKit::WebProcessCreationParameters::WebProcessCreationParameters):
+        (WebKit::WebProcessCreationParameters::encode):
+        (WebKit::WebProcessCreationParameters::decode):
+        * Shared/WebProcessCreationParameters.h: Added.
+        * UIProcess/WebContext.cpp:
+        (WebKit::WebContext::ensureWebProcess):
+        * UIProcess/WebContext.h:
+        * UIProcess/WebProcessProxy.cpp:
+        (WebKit::WebProcessProxy::WebProcessProxy):
+        * UIProcess/WebProcessProxy.h:
+        * UIProcess/mac/WebContextMac.mm:
+        (WebKit::WebContext::platformInitializeWebProcess):
+        * UIProcess/mac/WebProcessProxyMac.mm: Removed.
+        * UIProcess/qt/WebContextQt.cpp:
+        (WebKit::WebContext::applicationCacheDirectory):
+        (WebKit::WebContext::platformInitializeWebProcess):
+        * UIProcess/win/WebContextWin.cpp:
+        (WebKit::WebContext::platformInitializeWebProcess):
+        * WebKit2.pro:
+        * WebKit2.xcodeproj/project.pbxproj:
+        * WebProcess/WebProcess.cpp:
+        (WebKit::WebProcess::initializeWebProcess):
+        * WebProcess/WebProcess.h:
+        * WebProcess/WebProcess.messages.in:
+        * win/WebKit2.vcproj:
+
 2010-10-04  Brent Fulgham  <bfulgham at webkit.org>
 
         Unreviewed build fixes after r68260 and r68686.
diff --git a/WebKit2/Platform/CoreIPC/mac/MachPort.h b/WebKit2/Platform/CoreIPC/mac/MachPort.h
index 0fe7917..ecce16e 100644
--- a/WebKit2/Platform/CoreIPC/mac/MachPort.h
+++ b/WebKit2/Platform/CoreIPC/mac/MachPort.h
@@ -26,6 +26,8 @@
 #ifndef MachPort_h
 #define MachPort_h
 
+#include "ArgumentDecoder.h"
+#include "ArgumentEncoder.h"
 #include "Attachment.h"
 
 namespace CoreIPC {
diff --git a/WebKit2/Shared/WebProcessCreationParameters.cpp b/WebKit2/Shared/WebProcessCreationParameters.cpp
new file mode 100644
index 0000000..3e5a746
--- /dev/null
+++ b/WebKit2/Shared/WebProcessCreationParameters.cpp
@@ -0,0 +1,92 @@
+/*
+ * 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.
+ */
+
+#include "WebProcessCreationParameters.h"
+
+#include "ArgumentCoders.h"
+
+namespace WebKit {
+
+WebProcessCreationParameters::WebProcessCreationParameters()
+    : shouldTrackVisitedLinks(false)
+#if PLATFORM(WIN)
+    , shouldPaintNativeControls(false)
+#endif
+{
+}
+
+void WebProcessCreationParameters::encode(CoreIPC::ArgumentEncoder* encoder) const
+{
+    encoder->encode(injectedBundlePath);
+#if ENABLE(WEB_PROCESS_SANDBOX)
+    encoder->encode(injectedBundlePathToken);
+#endif
+
+    encoder->encode(applicationCacheDirectory);
+    encoder->encode(urlSchemesRegistererdAsEmptyDocument);
+    encoder->encode(static_cast<uint32_t>(cacheModel));
+    encoder->encode(shouldTrackVisitedLinks);
+
+#if PLATFORM(MAC)
+    encoder->encode(acceleratedCompositingPort);
+#elif PLATFORM(WIN)
+    encoder->encode(shouldPaintNativeControls);
+#endif
+}
+
+bool WebProcessCreationParameters::decode(CoreIPC::ArgumentDecoder* decoder, WebProcessCreationParameters& parameters)
+{
+    if (!decoder->decode(parameters.injectedBundlePath))
+        return false;
+#if ENABLE(WEB_PROCESS_SANDBOX)
+    if (!decoder->decode(parameters.injectedBundlePathToken))
+        return false;
+#endif
+
+    if (!decoder->decode(parameters.applicationCacheDirectory))
+        return false;
+    if (!decoder->decode(parameters.urlSchemesRegistererdAsEmptyDocument))
+        return false;
+
+    uint32_t cacheModel;
+    if (!decoder->decode(cacheModel))
+        return false;
+    parameters.cacheModel = static_cast<CacheModel>(cacheModel);
+
+    if (!decoder->decode(parameters.shouldTrackVisitedLinks))
+        return false;
+
+#if PLATFORM(MAC)
+    if (!decoder->decode(parameters.acceleratedCompositingPort))
+        return false;
+#elif PLATFORM(WIN)
+    if (!decoder->decode(parameters.shouldPaintNativeControls))
+        return false;
+#endif
+
+    return true;
+}
+
+} // namespace WebKit
diff --git a/WebKit2/Shared/WebProcessCreationParameters.h b/WebKit2/Shared/WebProcessCreationParameters.h
new file mode 100644
index 0000000..93e3131
--- /dev/null
+++ b/WebKit2/Shared/WebProcessCreationParameters.h
@@ -0,0 +1,70 @@
+/*
+ * 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 WebProcessCreationParameters_h
+#define WebProcessCreationParameters_h
+
+#include "CacheModel.h"
+#include <wtf/Vector.h>
+#include <wtf/text/WTFString.h>
+
+#if PLATFORM(MAC)
+#include "MachPort.h"
+#endif
+
+namespace CoreIPC {
+    class ArgumentDecoder;
+    class ArgumentEncoder;
+}
+
+namespace WebKit {
+
+struct WebProcessCreationParameters {
+    WebProcessCreationParameters();
+
+    void encode(CoreIPC::ArgumentEncoder*) const;
+    static bool decode(CoreIPC::ArgumentDecoder*, WebProcessCreationParameters&);
+
+    String injectedBundlePath;
+#if ENABLE(WEB_PROCESS_SANDBOX)
+    String injectedBundlePathToken;
+#endif
+
+    String applicationCacheDirectory;
+    Vector<String> urlSchemesRegistererdAsEmptyDocument;
+
+    CacheModel cacheModel;
+    bool shouldTrackVisitedLinks;
+
+#if PLATFORM(MAC)
+    CoreIPC::MachPort acceleratedCompositingPort;
+#elif PLATFORM(WIN)
+    bool shouldPaintNativeControls;
+#endif
+};
+
+} // namespace WebKit
+
+#endif // WebProcessCreationParameters_h
diff --git a/WebKit2/UIProcess/WebContext.cpp b/WebKit2/UIProcess/WebContext.cpp
index 609f75a..a9d7f97 100644
--- a/WebKit2/UIProcess/WebContext.cpp
+++ b/WebKit2/UIProcess/WebContext.cpp
@@ -34,6 +34,7 @@
 #include "WebCoreArgumentCoders.h"
 #include "WebPageNamespace.h"
 #include "WebPreferences.h"
+#include "WebProcessCreationParameters.h"
 #include "WebProcessManager.h"
 #include "WebProcessMessages.h"
 #include "WebProcessProxy.h"
@@ -124,19 +125,40 @@ void WebContext::ensureWebProcess()
 
     m_process = WebProcessManager::shared().getWebProcess(this);
 
-    m_process->send(Messages::WebProcess::SetShouldTrackVisitedLinks(m_historyClient.shouldTrackVisitedLinks()), 0);
-    m_process->send(Messages::WebProcess::SetCacheModel(static_cast<uint32_t>(m_cacheModel)), 0);
+    WebProcessCreationParameters parameters;
+
+    parameters.applicationCacheDirectory = applicationCacheDirectory();
+
+    if (!injectedBundlePath().isEmpty()) {
+        parameters.injectedBundlePath = injectedBundlePath();
+
+#if ENABLE(WEB_PROCESS_SANDBOX)
+        char* sandboxBundleTokenUTF8 = 0;
+        CString injectedBundlePath = context->injectedBundlePath().utf8();
+        sandbox_issue_extension(injectedBundlePath.data(), &sandboxBundleToken);
+        String sandboxBundleToken = String::fromUTF8(sandboxBundleTokenUTF8)
+        if (sandboxBundleToken)
+            free(sandboxBundleToken);
+
+        parameters.injectedBundlePathToken = sandboxBundleToken;
+#endif
+    }
+
+    parameters.shouldTrackVisitedLinks = m_historyClient.shouldTrackVisitedLinks();
+    parameters.cacheModel = m_cacheModel;
+    
+    copyToVector(m_schemesToRegisterAsEmptyDocument, parameters.urlSchemesRegistererdAsEmptyDocument);
+
+    // Add any platform specific parameters
+    platformInitializeWebProcess(parameters);
 
-    for (HashSet<String>::iterator it = m_schemesToRegisterAsEmptyDocument.begin(), end = m_schemesToRegisterAsEmptyDocument.end(); it != end; ++it)
-        m_process->send(Messages::WebProcess::RegisterURLSchemeAsEmptyDocument(*it), 0);
+    m_process->send(Messages::WebProcess::InitializeWebProcess(parameters), 0);
 
     for (size_t i = 0; i != m_pendingMessagesToPostToInjectedBundle.size(); ++i) {
         pair<String, RefPtr<APIObject> >* message = &m_pendingMessagesToPostToInjectedBundle[i];
         m_process->send(InjectedBundleMessage::PostMessage, 0, CoreIPC::In(message->first, WebContextUserMessageEncoder(message->second.get())));
     }
     m_pendingMessagesToPostToInjectedBundle.clear();
-
-    platformSetUpWebProcess();
 }
 
 void WebContext::processDidFinishLaunching(WebProcessProxy* process)
diff --git a/WebKit2/UIProcess/WebContext.h b/WebKit2/UIProcess/WebContext.h
index 046f1ec..369e333 100644
--- a/WebKit2/UIProcess/WebContext.h
+++ b/WebKit2/UIProcess/WebContext.h
@@ -48,6 +48,7 @@ namespace WebKit {
 class WebPageNamespace;
 class WebPageProxy;
 class WebPreferences;
+class WebProcessCreationParameters;
 
 class WebContext : public APIObject {
 public:
@@ -122,7 +123,7 @@ private:
 
     void ensureWebProcess();
     bool hasValidProcess() const { return m_process && m_process->isValid(); }
-    void platformSetUpWebProcess();
+    void platformInitializeWebProcess(WebProcessCreationParameters&);
 
     ProcessModel m_processModel;
     
diff --git a/WebKit2/UIProcess/WebProcessProxy.cpp b/WebKit2/UIProcess/WebProcessProxy.cpp
index 98e8672..75cbbed 100644
--- a/WebKit2/UIProcess/WebProcessProxy.cpp
+++ b/WebKit2/UIProcess/WebProcessProxy.cpp
@@ -63,32 +63,6 @@ WebProcessProxy::WebProcessProxy(WebContext* context)
     , m_context(context)
 {
     connect();
-
-    // FIXME: Instead of sending three separate initialization related messages here, we should just send a
-    // single "Initialize" messages with a struct that has all the needed information.
-    String applicationCacheDirectory = m_context->applicationCacheDirectory();
-    if (!applicationCacheDirectory.isEmpty())
-        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?
-    if (!context->injectedBundlePath().isEmpty()) {
-#if ENABLE(WEB_PROCESS_SANDBOX)
-        char *sandboxBundleToken = NULL;
-        CString injectedBundlePath = context->injectedBundlePath().utf8();
-        sandbox_issue_extension(injectedBundlePath.data(), &sandboxBundleToken);
-        send(Messages::WebProcess::LoadInjectedBundle(context->injectedBundlePath(), String::fromUTF8(sandboxBundleToken)), 0);
-        if (sandboxBundleToken)
-            free(sandboxBundleToken);
-#else
-        send(Messages::WebProcess::LoadInjectedBundle(context->injectedBundlePath(), String()), 0);
-#endif
-    }
-
-#if USE(ACCELERATED_COMPOSITING)
-    setUpAcceleratedCompositing();
-#endif
-
 }
 
 WebProcessProxy::~WebProcessProxy()
diff --git a/WebKit2/UIProcess/WebProcessProxy.h b/WebKit2/UIProcess/WebProcessProxy.h
index 41987be..ff8abd0 100644
--- a/WebKit2/UIProcess/WebProcessProxy.h
+++ b/WebKit2/UIProcess/WebProcessProxy.h
@@ -101,9 +101,6 @@ private:
     explicit WebProcessProxy(WebContext*);
 
     void connect();
-#if USE(ACCELERATED_COMPOSITING)
-    void setUpAcceleratedCompositing();
-#endif
 
     bool sendMessage(CoreIPC::MessageID, PassOwnPtr<CoreIPC::ArgumentEncoder>);
 
diff --git a/WebKit2/UIProcess/mac/WebContextMac.mm b/WebKit2/UIProcess/mac/WebContextMac.mm
index b0b7c43..3beaa53 100644
--- a/WebKit2/UIProcess/mac/WebContextMac.mm
+++ b/WebKit2/UIProcess/mac/WebContextMac.mm
@@ -25,6 +25,8 @@
 
 #include "WebContext.h"
 
+#include "WebKitSystemInterface.h"
+#include "WebProcessCreationParameters.h"
 #include <sys/param.h>
 
 using namespace WebCore;
@@ -59,8 +61,14 @@ String WebContext::applicationCacheDirectory()
     return [cacheDir stringByAppendingPathComponent:appName];
 }
 
-void WebContext::platformSetUpWebProcess()
+
+void WebContext::platformInitializeWebProcess(WebProcessCreationParameters& parameters)
 {
+#if USE(ACCELERATED_COMPOSITING) && HAVE(HOSTED_CORE_ANIMATION)
+    mach_port_t renderServerPort = WKInitializeRenderServer();
+    if (renderServerPort != MACH_PORT_NULL)
+        parameters.acceleratedCompositingPort = CoreIPC::MachPort(renderServerPort, MACH_MSG_TYPE_COPY_SEND);
+#endif
 }
 
 } // namespace WebKit
diff --git a/WebKit2/UIProcess/mac/WebProcessProxyMac.mm b/WebKit2/UIProcess/mac/WebProcessProxyMac.mm
deleted file mode 100644
index c6c1913..0000000
--- a/WebKit2/UIProcess/mac/WebProcessProxyMac.mm
+++ /dev/null
@@ -1,47 +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.
- */
-
-#include "WebProcessProxy.h"
-
-#include "MachPort.h"
-#include "WebKitSystemInterface.h"
-#include "WebProcessMessages.h"
-
-using namespace WebCore;
-
-namespace WebKit {
-
-#if USE(ACCELERATED_COMPOSITING)
-void WebProcessProxy::setUpAcceleratedCompositing()
-{
-#if HAVE(HOSTED_CORE_ANIMATION)
-    mach_port_t renderServerPort = WKInitializeRenderServer();
-    if (renderServerPort != MACH_PORT_NULL)
-        send(Messages::WebProcess::SetUpAcceleratedCompositingPort(CoreIPC::MachPort(renderServerPort, MACH_MSG_TYPE_COPY_SEND)), 0);
-#endif
-}
-#endif
-
-} // namespace WebKit
diff --git a/WebKit2/UIProcess/qt/WebContextQt.cpp b/WebKit2/UIProcess/qt/WebContextQt.cpp
index d0ef335..396c6e3 100644
--- a/WebKit2/UIProcess/qt/WebContextQt.cpp
+++ b/WebKit2/UIProcess/qt/WebContextQt.cpp
@@ -27,15 +27,16 @@
 #include "WebContext.h"
 
 #include "ApplicationCacheStorage.h"
+#include "WebProcessCreationParameters.h"
 
 namespace WebKit {
 
-WTF::String WebContext::applicationCacheDirectory()
+String WebContext::applicationCacheDirectory()
 {
     return WebCore::cacheStorage().cacheDirectory();
 }
 
-void WebContext::platformSetUpWebProcess()
+void WebContext::platformInitializeWebProcess(WebProcessCreationParameters&)
 {
 }
 
diff --git a/WebKit2/UIProcess/win/WebContextWin.cpp b/WebKit2/UIProcess/win/WebContextWin.cpp
index 326d132..83b586d 100644
--- a/WebKit2/UIProcess/win/WebContextWin.cpp
+++ b/WebKit2/UIProcess/win/WebContextWin.cpp
@@ -25,6 +25,7 @@
 
 #include "WebContext.h"
 
+#include "WebProcessCreationParameters.h"
 #include "WebProcessMessages.h"
 #include <WebCore/FileSystem.h>
 
@@ -46,9 +47,9 @@ void WebContext::setShouldPaintNativeControls(bool b)
     m_process->send(Messages::WebProcess::SetShouldPaintNativeControls(m_shouldPaintNativeControls), 0);
 }
 
-void WebContext::platformSetUpWebProcess()
+void WebContext::platformInitializeWebProcess(WebProcessCreationParameters& parameters)
 {
-    m_process->send(Messages::WebProcess::SetShouldPaintNativeControls(m_shouldPaintNativeControls), 0);
+    parameters.shouldPaintNativeControls = m_shouldPaintNativeControls;
 }
 
 } // namespace WebKit
diff --git a/WebKit2/WebKit2.pro b/WebKit2/WebKit2.pro
index 6780ed5..064fae6 100644
--- a/WebKit2/WebKit2.pro
+++ b/WebKit2/WebKit2.pro
@@ -197,6 +197,7 @@ HEADERS += \
     Shared/WebNavigationDataStore.h \
     Shared/WebNumber.h \
     Shared/WebPageCreationParameters.h \
+    Shared/WebProcessCreationParameters.h \
     Shared/WebPreferencesStore.h \
     Shared/WebURLRequest.h \
     Shared/WebURLResponse.h \
@@ -326,6 +327,7 @@ SOURCES += \
     Shared/VisitedLinkTable.cpp \
     Shared/WebEventConversion.cpp \
     Shared/WebPageCreationParameters.cpp \
+    Shared/WebProcessCreationParameters.cpp \
     Shared/WebPreferencesStore.cpp \
     Shared/WebURLRequest.cpp \
     Shared/WebURLResponse.cpp \
diff --git a/WebKit2/WebKit2.xcodeproj/project.pbxproj b/WebKit2/WebKit2.xcodeproj/project.pbxproj
index 8cb0984..e842727 100644
--- a/WebKit2/WebKit2.xcodeproj/project.pbxproj
+++ b/WebKit2/WebKit2.xcodeproj/project.pbxproj
@@ -41,7 +41,6 @@
 		0F5265B911DD377F0006D33C /* LayerBackedDrawingAreaProxy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F5265B711DD377F0006D33C /* LayerBackedDrawingAreaProxy.cpp */; };
 		0F5265BA11DD377F0006D33C /* LayerBackedDrawingAreaProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F5265B811DD377F0006D33C /* LayerBackedDrawingAreaProxy.h */; };
 		0F5265BC11DD37860006D33C /* LayerBackedDrawingAreaProxyMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0F5265BB11DD37860006D33C /* LayerBackedDrawingAreaProxyMac.mm */; };
-		0F52667411DD4A490006D33C /* WebProcessProxyMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0F52667311DD4A490006D33C /* WebProcessProxyMac.mm */; };
 		0FB659231208B4DB0044816C /* DrawingAreaBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB659221208B4DB0044816C /* DrawingAreaBase.h */; };
 		1A043976124D034800FFBFB5 /* PluginProcess.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A043974124D034800FFBFB5 /* PluginProcess.h */; };
 		1A043977124D034800FFBFB5 /* PluginProcess.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A043975124D034800FFBFB5 /* PluginProcess.cpp */; };
@@ -227,6 +226,8 @@
 		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 */; };
+		BC306824125A6B9400E71278 /* WebProcessCreationParameters.h in Headers */ = {isa = PBXBuildFile; fileRef = BC306822125A6B9400E71278 /* WebProcessCreationParameters.h */; };
+		BC306825125A6B9400E71278 /* WebProcessCreationParameters.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC306823125A6B9400E71278 /* WebProcessCreationParameters.cpp */; };
 		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 */; };
@@ -480,7 +481,6 @@
 		0F5265B711DD377F0006D33C /* LayerBackedDrawingAreaProxy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LayerBackedDrawingAreaProxy.cpp; sourceTree = "<group>"; };
 		0F5265B811DD377F0006D33C /* LayerBackedDrawingAreaProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LayerBackedDrawingAreaProxy.h; sourceTree = "<group>"; };
 		0F5265BB11DD37860006D33C /* LayerBackedDrawingAreaProxyMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = LayerBackedDrawingAreaProxyMac.mm; sourceTree = "<group>"; };
-		0F52667311DD4A490006D33C /* WebProcessProxyMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebProcessProxyMac.mm; sourceTree = "<group>"; };
 		0FB659221208B4DB0044816C /* DrawingAreaBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DrawingAreaBase.h; sourceTree = "<group>"; };
 		1058C7B1FEA5585E11CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
 		1A043974124D034800FFBFB5 /* PluginProcess.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PluginProcess.h; sourceTree = "<group>"; };
@@ -679,6 +679,8 @@
 		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>"; };
+		BC306822125A6B9400E71278 /* WebProcessCreationParameters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebProcessCreationParameters.h; sourceTree = "<group>"; };
+		BC306823125A6B9400E71278 /* WebProcessCreationParameters.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebProcessCreationParameters.cpp; 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>"; };
@@ -1137,6 +1139,8 @@
 				BC33DD671238464600360F3F /* WebNumber.h */,
 				C06C6093124C14430001682F /* WebPageCreationParameters.cpp */,
 				C06C6094124C14430001682F /* WebPageCreationParameters.h */,
+				BC306823125A6B9400E71278 /* WebProcessCreationParameters.cpp */,
+				BC306822125A6B9400E71278 /* WebProcessCreationParameters.h */,
 				BCD598AB112B7FDF00EC8C23 /* WebPreferencesStore.cpp */,
 				BCD598AA112B7FDF00EC8C23 /* WebPreferencesStore.h */,
 				A72D5D7F1236CBA800A88B15 /* WebSerializedScriptValue.h */,
@@ -1631,7 +1635,6 @@
 			children = (
 				BC2651F511825EF800243E12 /* ChunkedUpdateDrawingAreaProxyMac.mm */,
 				0F5265BB11DD37860006D33C /* LayerBackedDrawingAreaProxyMac.mm */,
-				0F52667311DD4A490006D33C /* WebProcessProxyMac.mm */,
 				1A1C648611F415B700553C19 /* WebContextMac.mm */,
 			);
 			path = mac;
@@ -1934,6 +1937,7 @@
 				BC9099801256A98200083756 /* WKStringPrivate.h in Headers */,
 				BC3065FA1259344E00E71278 /* CacheModel.h in Headers */,
 				BC3066BF125A442100E71278 /* WebProcessMessages.h in Headers */,
+				BC306824125A6B9400E71278 /* WebProcessCreationParameters.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -2127,7 +2131,6 @@
 				1A6FA01E11E1526300DB1371 /* WebProcessMainMac.mm in Sources */,
 				BC111B10112F5E4F00337BAB /* WebProcessManager.cpp in Sources */,
 				BC111B11112F5E4F00337BAB /* WebProcessProxy.cpp in Sources */,
-				0F52667411DD4A490006D33C /* WebProcessProxyMac.mm in Sources */,
 				BCC5715C115ADAEF001CCAF9 /* WebSystemInterface.mm in Sources */,
 				1A594ABA112A1FB6009DE7C7 /* WebUIClient.cpp in Sources */,
 				BC646C1A11DD399F006455B0 /* WKBackForwardList.cpp in Sources */,
@@ -2230,6 +2233,7 @@
 				1A8EFDFE1253CB6E00F7067F /* DataReference.cpp in Sources */,
 				BC3065C412592F8900E71278 /* WebProcessMac.mm in Sources */,
 				BC3066BE125A442100E71278 /* WebProcessMessageReceiver.cpp in Sources */,
+				BC306825125A6B9400E71278 /* WebProcessCreationParameters.cpp in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
diff --git a/WebKit2/WebProcess/WebProcess.cpp b/WebKit2/WebProcess/WebProcess.cpp
index 0b5ba93..9dd86ae 100644
--- a/WebKit2/WebProcess/WebProcess.cpp
+++ b/WebKit2/WebProcess/WebProcess.cpp
@@ -34,6 +34,7 @@
 #include "WebPageCreationParameters.h"
 #include "WebPlatformStrategies.h"
 #include "WebPreferencesStore.h"
+#include "WebProcessCreationParameters.h"
 #include "WebProcessMessages.h"
 #include "WebProcessProxyMessageKinds.h"
 #include <WebCore/ApplicationCacheStorage.h>
@@ -111,29 +112,34 @@ void WebProcess::initialize(CoreIPC::Connection::Identifier serverIdentifier, Ru
     startRandomCrashThreadIfRequested();
 }
 
-#if ENABLE(WEB_PROCESS_SANDBOX)
-void WebProcess::loadInjectedBundle(const String& path, const String& token)
-#else
-void WebProcess::loadInjectedBundle(const String& path)
-#endif
+void WebProcess::initializeWebProcess(const WebProcessCreationParameters& parameters)
 {
     ASSERT(m_pageMap.isEmpty());
-    ASSERT(!path.isEmpty());
 
-    m_injectedBundle = InjectedBundle::create(path);
+    cacheStorage().setCacheDirectory(parameters.applicationCacheDirectory);
+
+    if (!parameters.injectedBundlePath.isEmpty()) {
+        m_injectedBundle = InjectedBundle::create(parameters.injectedBundlePath);
 #if ENABLE(WEB_PROCESS_SANDBOX)
-    m_injectedBundle->setSandboxToken(token);
+        m_injectedBundle->setSandboxToken(parameters.injectedBundlePathToken);
 #endif
-
-    if (!m_injectedBundle->load()) {
-        // Don't keep around the InjectedBundle reference if the load fails.
-        m_injectedBundle.clear();
+        if (!m_injectedBundle->load()) {
+            // Don't keep around the InjectedBundle reference if the load fails.
+            m_injectedBundle.clear();
+        }
     }
-}
 
-void WebProcess::setApplicationCacheDirectory(const String& directory)
-{
-    cacheStorage().setCacheDirectory(directory);
+    setShouldTrackVisitedLinks(parameters.shouldTrackVisitedLinks);
+    setCacheModel(static_cast<uint32_t>(parameters.cacheModel));
+    for (size_t i = 0; i < parameters.urlSchemesRegistererdAsEmptyDocument.size(); ++i)
+        registerURLSchemeAsEmptyDocument(parameters.urlSchemesRegistererdAsEmptyDocument[i]);
+
+#if USE(ACCELERATED_COMPOSITING) && PLATFORM(MAC)
+    m_compositingRenderServerPort = parameters.acceleratedCompositingPort.port();
+#endif
+#if PLATFORM(WIN)
+    setShouldPaintNativeControls(parameters.shouldPaintNativeControls);
+#endif
 }
 
 void WebProcess::setShouldTrackVisitedLinks(bool shouldTrackVisitedLinks)
@@ -195,13 +201,6 @@ void WebProcess::setCacheModel(uint32_t cm)
     }
 }
 
-#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)
 {
diff --git a/WebKit2/WebProcess/WebProcess.h b/WebKit2/WebProcess/WebProcess.h
index a136764..dbf363b 100644
--- a/WebKit2/WebProcess/WebProcess.h
+++ b/WebKit2/WebProcess/WebProcess.h
@@ -51,6 +51,7 @@ class WebFrame;
 class WebPage;
 struct WebPageCreationParameters;
 struct WebPreferencesStore;
+struct WebProcessCreationParameters;
 
 class WebProcess : CoreIPC::Connection::Client {
 public:
@@ -86,23 +87,13 @@ private:
     WebProcess();
     void shutdown();
 
-#if ENABLE(WEB_PROCESS_SANDBOX)
-    void loadInjectedBundle(const String&, const String&);
-#else
-    void loadInjectedBundle(const String&);
-#endif
-    void setApplicationCacheDirectory(const String&);
+    void initializeWebProcess(const WebProcessCreationParameters&);
     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();
diff --git a/WebKit2/WebProcess/WebProcess.messages.in b/WebKit2/WebProcess/WebProcess.messages.in
index 83d4f41..d030513 100644
--- a/WebKit2/WebProcess/WebProcess.messages.in
+++ b/WebKit2/WebProcess/WebProcess.messages.in
@@ -21,23 +21,21 @@
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 messages -> WebProcess {
+    # Initialize the WebProcess. 
+    InitializeWebProcess(WebKit::WebProcessCreationParameters processCreationParameters)
+
+    # Create a new page.
+    CreateWebPage(uint64_t newPageID, WebKit::WebPageCreationParameters pageCreationParameters)
+
     # 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)
+    # Global preferences.
     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 6615eb0..63fe5e5 100755
--- a/WebKit2/win/WebKit2.vcproj
+++ b/WebKit2/win/WebKit2.vcproj
@@ -497,6 +497,14 @@
 				>
 			</File>
 			<File
+				RelativePath="..\Shared\WebProcessCreationParameters.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\Shared\WebProcessCreationParameters.h"
+				>
+			</File>
+			<File
 				RelativePath="..\Shared\WebPreferencesStore.cpp"
 				>
 			</File>

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list