Title: [230293] trunk/Source/WebKit
Revision
230293
Author
ryanhad...@apple.com
Date
2018-04-04 20:15:46 -0700 (Wed, 04 Apr 2018)

Log Message

Unreviewed, rolling out r230283.

Caused webkitpy test failures.

Reverted changeset:

"Use CompletionHandlers for DelayedReplies"
https://bugs.webkit.org/show_bug.cgi?id=182269
https://trac.webkit.org/changeset/230283

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (230292 => 230293)


--- trunk/Source/WebKit/ChangeLog	2018-04-05 02:40:49 UTC (rev 230292)
+++ trunk/Source/WebKit/ChangeLog	2018-04-05 03:15:46 UTC (rev 230293)
@@ -1,3 +1,15 @@
+2018-04-04  Ryan Haddad  <ryanhad...@apple.com>
+
+        Unreviewed, rolling out r230283.
+
+        Caused webkitpy test failures.
+
+        Reverted changeset:
+
+        "Use CompletionHandlers for DelayedReplies"
+        https://bugs.webkit.org/show_bug.cgi?id=182269
+        https://trac.webkit.org/changeset/230283
+
 2018-04-04  Youenn Fablet  <you...@apple.com>
 
         webrtc/video-update-often.html is flakily crashing on iOS simulator Debug

Modified: trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp (230292 => 230293)


--- trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp	2018-04-05 02:40:49 UTC (rev 230292)
+++ trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp	2018-04-05 03:15:46 UTC (rev 230293)
@@ -228,16 +228,16 @@
 #endif
 }
 
-void NetworkConnectionToWebProcess::scheduleResourceLoad(NetworkResourceLoadParameters&& loadParameters)
+void NetworkConnectionToWebProcess::scheduleResourceLoad(const NetworkResourceLoadParameters& loadParameters)
 {
-    auto loader = NetworkResourceLoader::create(WTFMove(loadParameters), *this);
+    auto loader = NetworkResourceLoader::create(loadParameters, *this);
     m_networkResourceLoaders.add(loadParameters.identifier, loader.ptr());
     loader->start();
 }
 
-void NetworkConnectionToWebProcess::performSynchronousLoad(NetworkResourceLoadParameters&& loadParameters, Messages::NetworkConnectionToWebProcess::PerformSynchronousLoad::DelayedReply&& reply)
+void NetworkConnectionToWebProcess::performSynchronousLoad(const NetworkResourceLoadParameters& loadParameters, Ref<Messages::NetworkConnectionToWebProcess::PerformSynchronousLoad::DelayedReply>&& reply)
 {
-    auto loader = NetworkResourceLoader::create(WTFMove(loadParameters), *this, WTFMove(reply));
+    auto loader = NetworkResourceLoader::create(loadParameters, *this, WTFMove(reply));
     m_networkResourceLoaders.add(loadParameters.identifier, loader.ptr());
     loader->start();
 }

Modified: trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h (230292 => 230293)


--- trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h	2018-04-05 02:40:49 UTC (rev 230292)
+++ trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h	2018-04-05 03:15:46 UTC (rev 230293)
@@ -90,8 +90,8 @@
     void didReceiveNetworkConnectionToWebProcessMessage(IPC::Connection&, IPC::Decoder&);
     void didReceiveSyncNetworkConnectionToWebProcessMessage(IPC::Connection&, IPC::Decoder&, std::unique_ptr<IPC::Encoder>&);
 
-    void scheduleResourceLoad(NetworkResourceLoadParameters&&);
-    void performSynchronousLoad(NetworkResourceLoadParameters&&, Messages::NetworkConnectionToWebProcess::PerformSynchronousLoad::DelayedReply&&);
+    void scheduleResourceLoad(const NetworkResourceLoadParameters&);
+    void performSynchronousLoad(const NetworkResourceLoadParameters&, Ref<Messages::NetworkConnectionToWebProcess::PerformSynchronousLoad::DelayedReply>&&);
     void loadPing(NetworkResourceLoadParameters&&, WebCore::HTTPHeaderMap&& originalRequestHeaders);
     void prefetchDNS(const String&);
     void preconnectTo(uint64_t preconnectionIdentifier, NetworkLoadParameters&&);

Modified: trunk/Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp (230292 => 230293)


--- trunk/Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp	2018-04-05 02:40:49 UTC (rev 230292)
+++ trunk/Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp	2018-04-05 03:15:46 UTC (rev 230293)
@@ -62,13 +62,13 @@
 namespace WebKit {
 
 struct NetworkResourceLoader::SynchronousLoadData {
-    SynchronousLoadData(Messages::NetworkConnectionToWebProcess::PerformSynchronousLoad::DelayedReply&& reply)
+    SynchronousLoadData(RefPtr<Messages::NetworkConnectionToWebProcess::PerformSynchronousLoad::DelayedReply>&& reply)
         : delayedReply(WTFMove(reply))
     {
         ASSERT(delayedReply);
     }
     ResourceRequest currentRequest;
-    Messages::NetworkConnectionToWebProcess::PerformSynchronousLoad::DelayedReply delayedReply;
+    RefPtr<Messages::NetworkConnectionToWebProcess::PerformSynchronousLoad::DelayedReply> delayedReply;
     ResourceResponse response;
     ResourceError error;
 };
@@ -82,15 +82,15 @@
     if (buffer && buffer->size())
         responseBuffer.append(buffer->data(), buffer->size());
 
-    data.delayedReply(data.error, data.response, responseBuffer);
+    data.delayedReply->send(data.error, data.response, responseBuffer);
     data.delayedReply = nullptr;
 }
 
-NetworkResourceLoader::NetworkResourceLoader(NetworkResourceLoadParameters&& parameters, NetworkConnectionToWebProcess& connection, Messages::NetworkConnectionToWebProcess::PerformSynchronousLoad::DelayedReply&& synchronousReply)
-    : m_parameters { WTFMove(parameters) }
+NetworkResourceLoader::NetworkResourceLoader(const NetworkResourceLoadParameters& parameters, NetworkConnectionToWebProcess& connection, RefPtr<Messages::NetworkConnectionToWebProcess::PerformSynchronousLoad::DelayedReply>&& synchronousReply)
+    : m_parameters { parameters }
     , m_connection { connection }
-    , m_defersLoading { m_parameters.defersLoading }
-    , m_isAllowedToAskUserForCredentials { m_parameters.clientCredentialPolicy == ClientCredentialPolicy::MayAskClientForCredentials }
+    , m_defersLoading { parameters.defersLoading }
+    , m_isAllowedToAskUserForCredentials { parameters.clientCredentialPolicy == ClientCredentialPolicy::MayAskClientForCredentials }
     , m_bufferingTimer { *this, &NetworkResourceLoader::bufferingTimerFired }
     , m_cache { sessionID().isEphemeral() ? nullptr : NetworkProcess::singleton().cache() }
 {

Modified: trunk/Source/WebKit/NetworkProcess/NetworkResourceLoader.h (230292 => 230293)


--- trunk/Source/WebKit/NetworkProcess/NetworkResourceLoader.h	2018-04-05 02:40:49 UTC (rev 230292)
+++ trunk/Source/WebKit/NetworkProcess/NetworkResourceLoader.h	2018-04-05 03:15:46 UTC (rev 230293)
@@ -23,7 +23,8 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#pragma once
+#ifndef NetworkResourceLoader_h
+#define NetworkResourceLoader_h
 
 #include "DownloadID.h"
 #include "MessageSender.h"
@@ -51,9 +52,9 @@
 
 class NetworkResourceLoader final : public RefCounted<NetworkResourceLoader>, public NetworkLoadClient, public IPC::MessageSender {
 public:
-    static Ref<NetworkResourceLoader> create(NetworkResourceLoadParameters&& parameters, NetworkConnectionToWebProcess& connection, Messages::NetworkConnectionToWebProcess::PerformSynchronousLoad::DelayedReply&& reply = nullptr)
+    static Ref<NetworkResourceLoader> create(const NetworkResourceLoadParameters& parameters, NetworkConnectionToWebProcess& connection, RefPtr<Messages::NetworkConnectionToWebProcess::PerformSynchronousLoad::DelayedReply>&& reply = nullptr)
     {
-        return adoptRef(*new NetworkResourceLoader(WTFMove(parameters), connection, WTFMove(reply)));
+        return adoptRef(*new NetworkResourceLoader(parameters, connection, WTFMove(reply)));
     }
     virtual ~NetworkResourceLoader();
 
@@ -110,7 +111,7 @@
 #endif
 
 private:
-    NetworkResourceLoader(NetworkResourceLoadParameters&&, NetworkConnectionToWebProcess&, Messages::NetworkConnectionToWebProcess::PerformSynchronousLoad::DelayedReply&&);
+    NetworkResourceLoader(const NetworkResourceLoadParameters&, NetworkConnectionToWebProcess&, RefPtr<Messages::NetworkConnectionToWebProcess::PerformSynchronousLoad::DelayedReply>&&);
 
     // IPC::MessageSender
     IPC::Connection* messageSenderConnection() override;
@@ -180,3 +181,5 @@
 };
 
 } // namespace WebKit
+
+#endif // NetworkResourceLoader_h

Modified: trunk/Source/WebKit/Platform/IPC/Connection.h (230292 => 230293)


--- trunk/Source/WebKit/Platform/IPC/Connection.h	2018-04-05 02:40:49 UTC (rev 230292)
+++ trunk/Source/WebKit/Platform/IPC/Connection.h	2018-04-05 03:15:46 UTC (rev 230293)
@@ -54,8 +54,6 @@
 
 namespace IPC {
 
-template<typename> struct CodingType;
-
 enum class SendOption {
     // Whether this message should be dispatched when waiting for a sync reply.
     // This is the default for synchronous messages.

Modified: trunk/Source/WebKit/Platform/IPC/HandleMessage.h (230292 => 230293)


--- trunk/Source/WebKit/Platform/IPC/HandleMessage.h	2018-04-05 02:40:49 UTC (rev 230292)
+++ trunk/Source/WebKit/Platform/IPC/HandleMessage.h	2018-04-05 03:15:46 UTC (rev 230293)
@@ -26,7 +26,6 @@
 #pragma once
 
 #include "ArgumentCoders.h"
-#include <wtf/CompletionHandler.h>
 #include <wtf/StdLibExtras.h>
 
 namespace IPC {
@@ -63,16 +62,16 @@
 
 // Dispatch functions with delayed reply arguments.
 
-template <typename C, typename MF, typename CH, typename ArgsTuple, size_t... ArgsIndex>
-void callMemberFunctionImpl(C* object, MF function, CompletionHandler<CH>&& completionHandler, ArgsTuple&& args, std::index_sequence<ArgsIndex...>)
+template <typename C, typename MF, typename R, typename ArgsTuple, size_t... ArgsIndex>
+void callMemberFunctionImpl(C* object, MF function, Ref<R>&& delayedReply, ArgsTuple&& args, std::index_sequence<ArgsIndex...>)
 {
-    (object->*function)(std::get<ArgsIndex>(std::forward<ArgsTuple>(args))..., WTFMove(completionHandler));
+    (object->*function)(std::get<ArgsIndex>(std::forward<ArgsTuple>(args))..., WTFMove(delayedReply));
 }
 
-template<typename C, typename MF, typename CH, typename ArgsTuple, typename ArgsIndicies = std::make_index_sequence<std::tuple_size<ArgsTuple>::value>>
-void callMemberFunction(ArgsTuple&& args, CompletionHandler<CH>&& completionHandler, C* object, MF function)
+template<typename C, typename MF, typename R, typename ArgsTuple, typename ArgsIndicies = std::make_index_sequence<std::tuple_size<ArgsTuple>::value>>
+void callMemberFunction(ArgsTuple&& args, Ref<R>&& delayedReply, C* object, MF function)
 {
-    callMemberFunctionImpl(object, function, WTFMove(completionHandler), std::forward<ArgsTuple>(args), ArgsIndicies());
+    callMemberFunctionImpl(object, function, WTFMove(delayedReply), std::forward<ArgsTuple>(args), ArgsIndicies());
 }
 
 // Dispatch functions with connection parameter with no reply arguments.
@@ -175,11 +174,8 @@
         return;
     }
 
-    typename T::DelayedReply completionHandler = [replyEncoder = WTFMove(replyEncoder), connection = makeRef(connection)] (auto&&... args) mutable {
-        T::send(WTFMove(replyEncoder), WTFMove(connection), args...);
-    };
-    
-    callMemberFunction(WTFMove(arguments), WTFMove(completionHandler), object, function);
+    Ref<typename T::DelayedReply> delayedReply = adoptRef(*new typename T::DelayedReply(connection, WTFMove(replyEncoder)));
+    callMemberFunction(WTFMove(arguments), WTFMove(delayedReply), object, function);
 }
 
 } // namespace IPC

Modified: trunk/Source/WebKit/PluginProcess/PluginControllerProxy.cpp (230292 => 230293)


--- trunk/Source/WebKit/PluginProcess/PluginControllerProxy.cpp	2018-04-05 02:40:49 UTC (rev 230292)
+++ trunk/Source/WebKit/PluginProcess/PluginControllerProxy.cpp	2018-04-05 03:15:46 UTC (rev 230293)
@@ -91,16 +91,15 @@
         releaseNPObject(m_pluginElementNPObject);
 }
 
-void PluginControllerProxy::setInitializationReply(Messages::WebProcessConnection::CreatePlugin::DelayedReply&& reply)
+void PluginControllerProxy::setInitializationReply(Ref<Messages::WebProcessConnection::CreatePlugin::DelayedReply>&& reply)
 {
     ASSERT(!m_initializationReply);
     m_initializationReply = WTFMove(reply);
 }
 
-Messages::WebProcessConnection::CreatePlugin::DelayedReply PluginControllerProxy::takeInitializationReply()
+RefPtr<Messages::WebProcessConnection::CreatePlugin::DelayedReply> PluginControllerProxy::takeInitializationReply()
 {
-    ASSERT(m_initializationReply);
-    return WTFMove(m_initializationReply);
+    return m_initializationReply;
 }
 
 bool PluginControllerProxy::initialize(const PluginCreationParameters& creationParameters)

Modified: trunk/Source/WebKit/PluginProcess/PluginControllerProxy.h (230292 => 230293)


--- trunk/Source/WebKit/PluginProcess/PluginControllerProxy.h	2018-04-05 02:40:49 UTC (rev 230292)
+++ trunk/Source/WebKit/PluginProcess/PluginControllerProxy.h	2018-04-05 03:15:46 UTC (rev 230293)
@@ -74,8 +74,8 @@
 
     bool isInitializing() const { return m_isInitializing; }
     
-    void setInitializationReply(Messages::WebProcessConnection::CreatePlugin::DelayedReply&&);
-    Messages::WebProcessConnection::CreatePlugin::DelayedReply takeInitializationReply();
+    void setInitializationReply(Ref<Messages::WebProcessConnection::CreatePlugin::DelayedReply>&&);
+    RefPtr<Messages::WebProcessConnection::CreatePlugin::DelayedReply> takeInitializationReply();
 
 private:
     void startPaintTimer();
@@ -183,7 +183,7 @@
     bool m_isVisible;
     bool m_isWindowVisible;
 
-    Messages::WebProcessConnection::CreatePlugin::DelayedReply m_initializationReply;
+    RefPtr<Messages::WebProcessConnection::CreatePlugin::DelayedReply> m_initializationReply;
 
     RefPtr<Plugin> m_plugin;
 

Modified: trunk/Source/WebKit/PluginProcess/WebProcessConnection.cpp (230292 => 230293)


--- trunk/Source/WebKit/PluginProcess/WebProcessConnection.cpp	2018-04-05 02:40:49 UTC (rev 230292)
+++ trunk/Source/WebKit/PluginProcess/WebProcessConnection.cpp	2018-04-05 03:15:46 UTC (rev 230293)
@@ -179,11 +179,11 @@
         destroyPluginControllerProxy(pluginControllers[i]);
 }
 
-void WebProcessConnection::destroyPlugin(uint64_t pluginInstanceID, bool asynchronousCreationIncomplete, Messages::WebProcessConnection::DestroyPlugin::DelayedReply&& reply)
+void WebProcessConnection::destroyPlugin(uint64_t pluginInstanceID, bool asynchronousCreationIncomplete, Ref<Messages::WebProcessConnection::DestroyPlugin::DelayedReply>&& reply)
 {
     // We return immediately from this synchronous IPC. We want to make sure the plugin destruction is just about to start so audio playback
     // will finish soon after returning. However we don't want to wait for destruction to complete fully as that may take a while.
-    reply();
+    reply->send();
 
     // Ensure we don't clamp any timers during destruction
     ActivityAssertion activityAssertion(PluginProcess::singleton().connectionActivity());
@@ -232,7 +232,7 @@
 #endif
 }
 
-void WebProcessConnection::createPlugin(const PluginCreationParameters& creationParameters, Messages::WebProcessConnection::CreatePlugin::DelayedReply&& reply)
+void WebProcessConnection::createPlugin(const PluginCreationParameters& creationParameters, Ref<Messages::WebProcessConnection::CreatePlugin::DelayedReply>&& reply)
 {
     // Ensure we don't clamp any timers during initialization
     ActivityAssertion activityAssertion(PluginProcess::singleton().connectionActivity());
@@ -249,9 +249,9 @@
         
         // If its initialization is complete then we need to respond to this message with the correct information about its creation.
 #if PLATFORM(COCOA)
-        reply(true, pluginControllerProxy->wantsWheelEvents(), pluginControllerProxy->remoteLayerClientID());
+        reply->send(true, pluginControllerProxy->wantsWheelEvents(), pluginControllerProxy->remoteLayerClientID());
 #else
-        reply(true, pluginControllerProxy->wantsWheelEvents(), 0);
+        reply->send(true, pluginControllerProxy->wantsWheelEvents(), 0);
 #endif
         return;
     }
@@ -266,7 +266,7 @@
     uint32_t remoteLayerClientID = 0;
     createPluginInternal(creationParameters, result, wantsWheelEvents, remoteLayerClientID);
     
-    reply(result, wantsWheelEvents, remoteLayerClientID);
+    reply->send(result, wantsWheelEvents, remoteLayerClientID);
 }
 
 void WebProcessConnection::createPluginAsynchronously(const PluginCreationParameters& creationParameters)
@@ -311,8 +311,8 @@
     // synchronous reply instead of sending the asynchronous reply.
     PluginControllerProxy* pluginControllerProxy = m_pluginControllers.get(creationParameters.pluginInstanceID);
     ASSERT(pluginControllerProxy);
-    if (auto delayedSyncReply = pluginControllerProxy->takeInitializationReply()) {
-        delayedSyncReply(result, wantsWheelEvents, remoteLayerClientID);
+    if (RefPtr<Messages::WebProcessConnection::CreatePlugin::DelayedReply> delayedSyncReply = pluginControllerProxy->takeInitializationReply()) {
+        delayedSyncReply->send(result, wantsWheelEvents, remoteLayerClientID);
         return;
     }
 

Modified: trunk/Source/WebKit/PluginProcess/WebProcessConnection.h (230292 => 230293)


--- trunk/Source/WebKit/PluginProcess/WebProcessConnection.h	2018-04-05 02:40:49 UTC (rev 230292)
+++ trunk/Source/WebKit/PluginProcess/WebProcessConnection.h	2018-04-05 03:15:46 UTC (rev 230293)
@@ -69,9 +69,9 @@
     // Message handlers.
     void didReceiveWebProcessConnectionMessage(IPC::Connection&, IPC::Decoder&);
     void didReceiveSyncWebProcessConnectionMessage(IPC::Connection&, IPC::Decoder&, std::unique_ptr<IPC::Encoder>&);
-    void createPlugin(const PluginCreationParameters&, Messages::WebProcessConnection::CreatePlugin::DelayedReply&&);
+    void createPlugin(const PluginCreationParameters&, Ref<Messages::WebProcessConnection::CreatePlugin::DelayedReply>&&);
     void createPluginAsynchronously(const PluginCreationParameters&);
-    void destroyPlugin(uint64_t pluginInstanceID, bool asynchronousCreationIncomplete, Messages::WebProcessConnection::DestroyPlugin::DelayedReply&&);
+    void destroyPlugin(uint64_t pluginInstanceID, bool asynchronousCreationIncomplete, Ref<Messages::WebProcessConnection::DestroyPlugin::DelayedReply>&&);
     
     void createPluginInternal(const PluginCreationParameters&, bool& result, bool& wantsWheelEvents, uint32_t& remoteLayerClientID);
 

Modified: trunk/Source/WebKit/Scripts/webkit/messages.py (230292 => 230293)


--- trunk/Source/WebKit/Scripts/webkit/messages.py	2018-04-05 02:40:49 UTC (rev 230292)
+++ trunk/Source/WebKit/Scripts/webkit/messages.py	2018-04-05 03:15:46 UTC (rev 230293)
@@ -118,14 +118,16 @@
     if message.reply_parameters != None:
         if message.has_attribute(DELAYED_ATTRIBUTE):
             send_parameters = [(function_parameter_type(x.type, x.kind), x.name) for x in message.reply_parameters]
-            result.append('    using DelayedReply = CompletionHandler<void(')
-            if len(send_parameters):
-                result.append('%s' % ', '.join([' '.join(x) for x in send_parameters]))
-            result.append(')>;')
-            result.append('    static void send(std::unique_ptr<IPC::Encoder>&&, IPC::Connection&')
-            if len(send_parameters):
-                result.append(', %s' % ', '.join([' '.join(x) for x in send_parameters]))
-            result.append(');\n')
+            result.append('    struct DelayedReply : public ThreadSafeRefCounted<DelayedReply> {\n')
+            result.append('        DelayedReply(Ref<IPC::Connection>&&, std::unique_ptr<IPC::Encoder>);\n')
+            result.append('        ~DelayedReply();\n')
+            result.append('\n')
+            result.append('        bool send(%s);\n' % ', '.join([' '.join(x) for x in send_parameters]))
+            result.append('\n')
+            result.append('    private:\n')
+            result.append('        RefPtr<IPC::Connection> m_connection;\n')
+            result.append('        std::unique_ptr<IPC::Encoder> m_encoder;\n')
+            result.append('    };\n\n')
 
         result.append('    typedef %s Reply;\n' % reply_type(message))
 
@@ -528,14 +530,26 @@
             if message.condition:
                 result.append('#if %s\n\n' % message.condition)
 
-            result.append('void %s::send(std::unique_ptr<IPC::Encoder>&& encoder, IPC::Connection& connection' % (message.name))
-            if len(send_parameters):
-                result.append(', %s' % ', '.join([' '.join(x) for x in send_parameters]))
-            result.append(')\n{\n')
-            result += ['    *encoder << %s;\n' % x.name for x in message.reply_parameters]
-            result.append('    connection.sendSyncReply(WTFMove(encoder));\n')
+            result.append('%s::DelayedReply::DelayedReply(Ref<IPC::Connection>&& connection, std::unique_ptr<IPC::Encoder> encoder)\n' % message.name)
+            result.append('    : m_connection(WTFMove(connection))\n')
+            result.append('    , m_encoder(WTFMove(encoder))\n')
+            result.append('{\n')
             result.append('}\n')
             result.append('\n')
+            result.append('%s::DelayedReply::~DelayedReply()\n' % message.name)
+            result.append('{\n')
+            result.append('    ASSERT(!m_connection);\n')
+            result.append('}\n')
+            result.append('\n')
+            result.append('bool %s::DelayedReply::send(%s)\n' % (message.name, ', '.join([' '.join(x) for x in send_parameters])))
+            result.append('{\n')
+            result.append('    ASSERT(m_encoder);\n')
+            result += ['    *m_encoder << %s;\n' % x.name for x in message.reply_parameters]
+            result.append('    bool _result = m_connection->sendSyncReply(WTFMove(m_encoder));\n')
+            result.append('    m_connection = nullptr;\n')
+            result.append('    return _result;\n')
+            result.append('}\n')
+            result.append('\n')
 
             if message.condition:
                 result.append('#endif\n\n')

Modified: trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp (230292 => 230293)


--- trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp	2018-04-05 02:40:49 UTC (rev 230292)
+++ trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp	2018-04-05 03:15:46 UTC (rev 230293)
@@ -115,7 +115,7 @@
     ASSERT_UNUSED(connection, this->connection() == &connection);
 }
 
-void NetworkProcessProxy::getNetworkProcessConnection(Messages::WebProcessProxy::GetNetworkProcessConnection::DelayedReply&& reply)
+void NetworkProcessProxy::getNetworkProcessConnection(Ref<Messages::WebProcessProxy::GetNetworkProcessConnection::DelayedReply>&& reply)
 {
     m_pendingConnectionReplies.append(WTFMove(reply));
 
@@ -193,7 +193,7 @@
 {
     clearCallbackStates();
 
-    Vector<Messages::WebProcessProxy::GetNetworkProcessConnection::DelayedReply> pendingReplies;
+    Vector<Ref<Messages::WebProcessProxy::GetNetworkProcessConnection::DelayedReply>> pendingReplies;
     pendingReplies.reserveInitialCapacity(m_pendingConnectionReplies.size());
     for (auto& reply : m_pendingConnectionReplies)
         pendingReplies.append(WTFMove(reply));
@@ -206,12 +206,12 @@
 {
     // The network process must have crashed or exited, send any pending sync replies we might have.
     while (!m_pendingConnectionReplies.isEmpty()) {
-        auto reply = m_pendingConnectionReplies.takeFirst();
+        Ref<Messages::WebProcessProxy::GetNetworkProcessConnection::DelayedReply> reply = m_pendingConnectionReplies.takeFirst();
 
 #if USE(UNIX_DOMAIN_SOCKETS)
-        reply(IPC::Attachment());
+        reply->send(IPC::Attachment());
 #elif OS(DARWIN)
-        reply(IPC::Attachment(0, MACH_MSG_TYPE_MOVE_SEND));
+        reply->send(IPC::Attachment(0, MACH_MSG_TYPE_MOVE_SEND));
 #else
         notImplemented();
 #endif
@@ -282,12 +282,12 @@
     ASSERT(!m_pendingConnectionReplies.isEmpty());
 
     // Grab the first pending connection reply.
-    auto reply = m_pendingConnectionReplies.takeFirst();
+    RefPtr<Messages::WebProcessProxy::GetNetworkProcessConnection::DelayedReply> reply = m_pendingConnectionReplies.takeFirst();
 
 #if USE(UNIX_DOMAIN_SOCKETS)
-    reply(connectionIdentifier);
+    reply->send(connectionIdentifier);
 #elif OS(DARWIN)
-    reply(IPC::Attachment(connectionIdentifier.port(), MACH_MSG_TYPE_MOVE_SEND));
+    reply->send(IPC::Attachment(connectionIdentifier.port(), MACH_MSG_TYPE_MOVE_SEND));
 #else
     notImplemented();
 #endif

Modified: trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.h (230292 => 230293)


--- trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.h	2018-04-05 02:40:49 UTC (rev 230292)
+++ trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.h	2018-04-05 03:15:46 UTC (rev 230293)
@@ -68,7 +68,7 @@
     static Ref<NetworkProcessProxy> create(WebProcessPool&);
     ~NetworkProcessProxy();
 
-    void getNetworkProcessConnection(Messages::WebProcessProxy::GetNetworkProcessConnection::DelayedReply&&);
+    void getNetworkProcessConnection(Ref<Messages::WebProcessProxy::GetNetworkProcessConnection::DelayedReply>&&);
 
     DownloadProxy* createDownloadProxy(const WebCore::ResourceRequest&);
 
@@ -155,7 +155,7 @@
     WebProcessPool& m_processPool;
     
     unsigned m_numPendingConnectionRequests;
-    Deque<Messages::WebProcessProxy::GetNetworkProcessConnection::DelayedReply> m_pendingConnectionReplies;
+    Deque<Ref<Messages::WebProcessProxy::GetNetworkProcessConnection::DelayedReply>> m_pendingConnectionReplies;
 
     HashMap<uint64_t, WTF::Function<void (WebsiteData)>> m_pendingFetchWebsiteDataCallbacks;
     HashMap<uint64_t, WTF::Function<void ()>> m_pendingDeleteWebsiteDataCallbacks;

Modified: trunk/Source/WebKit/UIProcess/Plugins/PluginProcessManager.cpp (230292 => 230293)


--- trunk/Source/WebKit/UIProcess/Plugins/PluginProcessManager.cpp	2018-04-05 02:40:49 UTC (rev 230292)
+++ trunk/Source/WebKit/UIProcess/Plugins/PluginProcessManager.cpp	2018-04-05 03:15:46 UTC (rev 230293)
@@ -81,7 +81,7 @@
     return token;
 }
 
-void PluginProcessManager::getPluginProcessConnection(uint64_t pluginProcessToken, Messages::WebProcessProxy::GetPluginProcessConnection::DelayedReply&& reply)
+void PluginProcessManager::getPluginProcessConnection(uint64_t pluginProcessToken, Ref<Messages::WebProcessProxy::GetPluginProcessConnection::DelayedReply>&& reply)
 {
     ASSERT(pluginProcessToken);
 

Modified: trunk/Source/WebKit/UIProcess/Plugins/PluginProcessManager.h (230292 => 230293)


--- trunk/Source/WebKit/UIProcess/Plugins/PluginProcessManager.h	2018-04-05 02:40:49 UTC (rev 230292)
+++ trunk/Source/WebKit/UIProcess/Plugins/PluginProcessManager.h	2018-04-05 03:15:46 UTC (rev 230293)
@@ -57,7 +57,7 @@
 
     uint64_t pluginProcessToken(const PluginModuleInfo&, PluginProcessType, PluginProcessSandboxPolicy);
 
-    void getPluginProcessConnection(uint64_t pluginProcessToken, Messages::WebProcessProxy::GetPluginProcessConnection::DelayedReply&&);
+    void getPluginProcessConnection(uint64_t pluginProcessToken, Ref<Messages::WebProcessProxy::GetPluginProcessConnection::DelayedReply>&&);
     void removePluginProcessProxy(PluginProcessProxy*);
 
     void fetchWebsiteData(const PluginModuleInfo&, OptionSet<WebsiteDataFetchOption>, WTF::Function<void (Vector<String>)>&& completionHandler);

Modified: trunk/Source/WebKit/UIProcess/Plugins/PluginProcessProxy.cpp (230292 => 230293)


--- trunk/Source/WebKit/UIProcess/Plugins/PluginProcessProxy.cpp	2018-04-05 02:40:49 UTC (rev 230292)
+++ trunk/Source/WebKit/UIProcess/Plugins/PluginProcessProxy.cpp	2018-04-05 03:15:46 UTC (rev 230293)
@@ -102,7 +102,7 @@
 
 // Asks the plug-in process to create a new connection to a web process. The connection identifier will be 
 // encoded in the given argument encoder and sent back to the connection of the given web process.
-void PluginProcessProxy::getPluginProcessConnection(Messages::WebProcessProxy::GetPluginProcessConnection::DelayedReply&& reply)
+void PluginProcessProxy::getPluginProcessConnection(Ref<Messages::WebProcessProxy::GetPluginProcessConnection::DelayedReply>&& reply)
 {
     m_pendingConnectionReplies.append(WTFMove(reply));
 
@@ -159,12 +159,12 @@
 {
     // The plug-in process must have crashed or exited, send any pending sync replies we might have.
     while (!m_pendingConnectionReplies.isEmpty()) {
-        auto reply = m_pendingConnectionReplies.takeFirst();
+        RefPtr<Messages::WebProcessProxy::GetPluginProcessConnection::DelayedReply> reply = m_pendingConnectionReplies.takeFirst();
 
 #if USE(UNIX_DOMAIN_SOCKETS)
-        reply(IPC::Attachment(), false);
+        reply->send(IPC::Attachment(), false);
 #elif OS(DARWIN)
-        reply(IPC::Attachment(0, MACH_MSG_TYPE_MOVE_SEND), false);
+        reply->send(IPC::Attachment(0, MACH_MSG_TYPE_MOVE_SEND), false);
 #else
         notImplemented();
 #endif
@@ -276,12 +276,12 @@
     ASSERT(!m_pendingConnectionReplies.isEmpty());
 
     // Grab the first pending connection reply.
-    auto reply = m_pendingConnectionReplies.takeFirst();
+    RefPtr<Messages::WebProcessProxy::GetPluginProcessConnection::DelayedReply> reply = m_pendingConnectionReplies.takeFirst();
 
 #if USE(UNIX_DOMAIN_SOCKETS)
-    reply(connectionIdentifier, supportsAsynchronousPluginInitialization);
+    reply->send(connectionIdentifier, supportsAsynchronousPluginInitialization);
 #elif OS(DARWIN)
-    reply(IPC::Attachment(connectionIdentifier.port(), MACH_MSG_TYPE_MOVE_SEND), supportsAsynchronousPluginInitialization);
+    reply->send(IPC::Attachment(connectionIdentifier.port(), MACH_MSG_TYPE_MOVE_SEND), supportsAsynchronousPluginInitialization);
 #else
     notImplemented();
 #endif

Modified: trunk/Source/WebKit/UIProcess/Plugins/PluginProcessProxy.h (230292 => 230293)


--- trunk/Source/WebKit/UIProcess/Plugins/PluginProcessProxy.h	2018-04-05 02:40:49 UTC (rev 230292)
+++ trunk/Source/WebKit/UIProcess/Plugins/PluginProcessProxy.h	2018-04-05 03:15:46 UTC (rev 230293)
@@ -76,7 +76,7 @@
 
     // Asks the plug-in process to create a new connection to a web process. The connection identifier will be
     // encoded in the given argument encoder and sent back to the connection of the given web process.
-    void getPluginProcessConnection(Messages::WebProcessProxy::GetPluginProcessConnection::DelayedReply&&);
+    void getPluginProcessConnection(Ref<Messages::WebProcessProxy::GetPluginProcessConnection::DelayedReply>&&);
 
     void fetchWebsiteData(WTF::Function<void (Vector<String>)>&& completionHandler);
     void deleteWebsiteData(WallTime modifiedSince, WTF::Function<void ()>&& completionHandler);
@@ -149,7 +149,7 @@
     // The connection to the plug-in host process.
     RefPtr<IPC::Connection> m_connection;
 
-    Deque<Messages::WebProcessProxy::GetPluginProcessConnection::DelayedReply> m_pendingConnectionReplies;
+    Deque<RefPtr<Messages::WebProcessProxy::GetPluginProcessConnection::DelayedReply>> m_pendingConnectionReplies;
 
     Vector<uint64_t> m_pendingFetchWebsiteDataRequests;
     HashMap<uint64_t, WTF::Function<void (Vector<String>)>> m_pendingFetchWebsiteDataCallbacks;

Modified: trunk/Source/WebKit/UIProcess/Storage/StorageProcessProxy.cpp (230292 => 230293)


--- trunk/Source/WebKit/UIProcess/Storage/StorageProcessProxy.cpp	2018-04-05 02:40:49 UTC (rev 230292)
+++ trunk/Source/WebKit/UIProcess/Storage/StorageProcessProxy.cpp	2018-04-05 03:15:46 UTC (rev 230293)
@@ -112,7 +112,7 @@
     send(Messages::StorageProcess::DeleteWebsiteDataForOrigins(sessionID, dataTypes, origins, callbackID), 0);
 }
 
-void StorageProcessProxy::getStorageProcessConnection(WebProcessProxy& webProcessProxy, Messages::WebProcessProxy::GetStorageProcessConnection::DelayedReply&& reply)
+void StorageProcessProxy::getStorageProcessConnection(WebProcessProxy& webProcessProxy, Ref<Messages::WebProcessProxy::GetStorageProcessConnection::DelayedReply>&& reply)
 {
     m_pendingConnectionReplies.append(WTFMove(reply));
 
@@ -140,9 +140,9 @@
         auto reply = m_pendingConnectionReplies.takeFirst();
 
 #if USE(UNIX_DOMAIN_SOCKETS)
-        reply(IPC::Attachment());
+        reply->send(IPC::Attachment());
 #elif OS(DARWIN)
-        reply(IPC::Attachment(0, MACH_MSG_TYPE_MOVE_SEND));
+        reply->send(IPC::Attachment(0, MACH_MSG_TYPE_MOVE_SEND));
 #else
         notImplemented();
 #endif
@@ -172,12 +172,12 @@
 {
     ASSERT(!m_pendingConnectionReplies.isEmpty());
 
-    auto reply = m_pendingConnectionReplies.takeFirst();
+    RefPtr<Messages::WebProcessProxy::GetStorageProcessConnection::DelayedReply> reply = m_pendingConnectionReplies.takeFirst();
 
 #if USE(UNIX_DOMAIN_SOCKETS)
-    reply(connectionIdentifier);
+    reply->send(connectionIdentifier);
 #elif OS(DARWIN)
-    reply(IPC::Attachment(connectionIdentifier.port(), MACH_MSG_TYPE_MOVE_SEND));
+    reply->send(IPC::Attachment(connectionIdentifier.port(), MACH_MSG_TYPE_MOVE_SEND));
 #else
     notImplemented();
 #endif

Modified: trunk/Source/WebKit/UIProcess/Storage/StorageProcessProxy.h (230292 => 230293)


--- trunk/Source/WebKit/UIProcess/Storage/StorageProcessProxy.h	2018-04-05 02:40:49 UTC (rev 230292)
+++ trunk/Source/WebKit/UIProcess/Storage/StorageProcessProxy.h	2018-04-05 03:15:46 UTC (rev 230293)
@@ -56,7 +56,7 @@
     void deleteWebsiteData(PAL::SessionID, OptionSet<WebsiteDataType>, WallTime modifiedSince, WTF::Function<void()>&& completionHandler);
     void deleteWebsiteDataForOrigins(PAL::SessionID, OptionSet<WebsiteDataType>, const Vector<WebCore::SecurityOriginData>&, WTF::Function<void()>&& completionHandler);
 
-    void getStorageProcessConnection(WebProcessProxy&, Messages::WebProcessProxy::GetStorageProcessConnection::DelayedReply&&);
+    void getStorageProcessConnection(WebProcessProxy&, Ref<Messages::WebProcessProxy::GetStorageProcessConnection::DelayedReply>&&);
 
 private:
     StorageProcessProxy(WebProcessPool&);
@@ -91,7 +91,7 @@
     WebProcessPool& m_processPool;
 
     unsigned m_numPendingConnectionRequests;
-    Deque<Messages::WebProcessProxy::GetStorageProcessConnection::DelayedReply> m_pendingConnectionReplies;
+    Deque<Ref<Messages::WebProcessProxy::GetStorageProcessConnection::DelayedReply>> m_pendingConnectionReplies;
 
     HashMap<uint64_t, WTF::Function<void (WebsiteData)>> m_pendingFetchWebsiteDataCallbacks;
     HashMap<uint64_t, WTF::Function<void ()>> m_pendingDeleteWebsiteDataCallbacks;

Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.cpp (230292 => 230293)


--- trunk/Source/WebKit/UIProcess/WebPageProxy.cpp	2018-04-05 02:40:49 UTC (rev 230292)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.cpp	2018-04-05 03:15:46 UTC (rev 230293)
@@ -231,7 +231,7 @@
         uint64_t currentOriginUsage;
         uint64_t currentDatabaseUsage;
         uint64_t expectedUsage;
-        Messages::WebPageProxy::ExceededDatabaseQuota::DelayedReply reply;
+        RefPtr<Messages::WebPageProxy::ExceededDatabaseQuota::DelayedReply> reply;
     };
 
     static ExceededDatabaseQuotaRecords& singleton();
@@ -239,7 +239,7 @@
     std::unique_ptr<Record> createRecord(uint64_t frameID, String originIdentifier,
         String databaseName, String displayName, uint64_t currentQuota,
         uint64_t currentOriginUsage, uint64_t currentDatabaseUsage, uint64_t expectedUsage, 
-        Messages::WebPageProxy::ExceededDatabaseQuota::DelayedReply&&);
+        Ref<Messages::WebPageProxy::ExceededDatabaseQuota::DelayedReply>&&);
 
     void add(std::unique_ptr<Record>);
     bool areBeingProcessed() const { return !!m_currentRecord; }
@@ -262,7 +262,7 @@
 std::unique_ptr<ExceededDatabaseQuotaRecords::Record> ExceededDatabaseQuotaRecords::createRecord(
     uint64_t frameID, String originIdentifier, String databaseName, String displayName,
     uint64_t currentQuota, uint64_t currentOriginUsage, uint64_t currentDatabaseUsage,
-    uint64_t expectedUsage, Messages::WebPageProxy::ExceededDatabaseQuota::DelayedReply&& reply)
+    uint64_t expectedUsage, Ref<Messages::WebPageProxy::ExceededDatabaseQuota::DelayedReply>&& reply)
 {
     auto record = std::make_unique<Record>();
     record->frameID = frameID;
@@ -4042,7 +4042,7 @@
 
 // UIClient
 
-void WebPageProxy::createNewPage(const FrameInfoData& originatingFrameInfoData, uint64_t originatingPageID, ResourceRequest&& request, WindowFeatures&& windowFeatures, NavigationActionData&& navigationActionData, Messages::WebPageProxy::CreateNewPage::DelayedReply&& reply)
+void WebPageProxy::createNewPage(const FrameInfoData& originatingFrameInfoData, uint64_t originatingPageID, ResourceRequest&& request, WindowFeatures&& windowFeatures, NavigationActionData&& navigationActionData, Ref<Messages::WebPageProxy::CreateNewPage::DelayedReply>&& reply)
 {
     MESSAGE_CHECK(m_process->webFrame(originatingFrameInfoData.frameID));
     auto originatingFrameInfo = API::FrameInfo::create(originatingFrameInfoData, m_process->webPage(originatingPageID));
@@ -4049,13 +4049,13 @@
 
     auto mainFrameURL = m_mainFrame->url();
 
-    m_uiClient->createNewPage(*this, WTFMove(originatingFrameInfo), WTFMove(request), WTFMove(windowFeatures), WTFMove(navigationActionData), [this, protectedThis = makeRef(*this), mainFrameURL, request, reply = WTFMove(reply)](RefPtr<WebPageProxy> newPage) {
+    m_uiClient->createNewPage(*this, WTFMove(originatingFrameInfo), WTFMove(request), WTFMove(windowFeatures), WTFMove(navigationActionData), [this, protectedThis = RefPtr<WebPageProxy>(this), mainFrameURL, request, reply = WTFMove(reply)](RefPtr<WebPageProxy> newPage) {
         if (!newPage) {
-            reply(0, { });
+            reply->send(0, { });
             return;
         }
 
-        reply(newPage->pageID(), newPage->creationParameters());
+        reply->send(newPage->pageID(), newPage->creationParameters());
 
         WebsiteDataStore::cloneSessionData(*this, *newPage);
         newPage->m_shouldSuppressAppLinksInNextNavigationPolicyDecision = hostsAreEqual(URL(ParsedURLString, mainFrameURL), request.url());
@@ -4091,7 +4091,7 @@
     m_uiClient->close(this);
 }
 
-void WebPageProxy::runJavaScriptAlert(uint64_t frameID, const SecurityOriginData& securityOrigin, const String& message, Messages::WebPageProxy::RunJavaScriptAlert::DelayedReply&& reply)
+void WebPageProxy::runJavaScriptAlert(uint64_t frameID, const SecurityOriginData& securityOrigin, const String& message, Ref<Messages::WebPageProxy::RunJavaScriptAlert::DelayedReply>&& reply)
 {
     WebFrameProxy* frame = m_process->webFrame(frameID);
     MESSAGE_CHECK(frame);
@@ -4104,11 +4104,11 @@
             automationSession->willShowJavaScriptDialog(*this);
     }
     m_uiClient->runJavaScriptAlert(this, message, frame, securityOrigin, [reply = WTFMove(reply)] {
-        reply();
+        reply->send();
     });
 }
 
-void WebPageProxy::runJavaScriptConfirm(uint64_t frameID, const SecurityOriginData& securityOrigin, const String& message, Messages::WebPageProxy::RunJavaScriptConfirm::DelayedReply&& reply)
+void WebPageProxy::runJavaScriptConfirm(uint64_t frameID, const SecurityOriginData& securityOrigin, const String& message, Ref<Messages::WebPageProxy::RunJavaScriptConfirm::DelayedReply>&& reply)
 {
     WebFrameProxy* frame = m_process->webFrame(frameID);
     MESSAGE_CHECK(frame);
@@ -4122,11 +4122,11 @@
     }
 
     m_uiClient->runJavaScriptConfirm(this, message, frame, securityOrigin, [reply = WTFMove(reply)](bool result) {
-        reply(result);
+        reply->send(result);
     });
 }
 
-void WebPageProxy::runJavaScriptPrompt(uint64_t frameID, const SecurityOriginData& securityOrigin, const String& message, const String& defaultValue, Messages::WebPageProxy::RunJavaScriptPrompt::DelayedReply&& reply)
+void WebPageProxy::runJavaScriptPrompt(uint64_t frameID, const SecurityOriginData& securityOrigin, const String& message, const String& defaultValue, Ref<Messages::WebPageProxy::RunJavaScriptPrompt::DelayedReply>&& reply)
 {
     WebFrameProxy* frame = m_process->webFrame(frameID);
     MESSAGE_CHECK(frame);
@@ -4140,7 +4140,7 @@
     }
 
     m_uiClient->runJavaScriptPrompt(this, message, defaultValue, frame, securityOrigin, [reply = WTFMove(reply)](const String& result) {
-        reply(result);
+        reply->send(result);
     });
 }
 
@@ -4209,24 +4209,24 @@
 #endif // ENABLE(NETSCAPE_PLUGIN_API)
 
 #if ENABLE(WEBGL)
-void WebPageProxy::webGLPolicyForURL(URL&& url, Messages::WebPageProxy::WebGLPolicyForURL::DelayedReply&& reply)
+void WebPageProxy::webGLPolicyForURL(URL&& url, Ref<Messages::WebPageProxy::WebGLPolicyForURL::DelayedReply>&& reply)
 {
     if (m_navigationClient) {
         m_navigationClient->webGLLoadPolicy(*this, url, [reply = WTFMove(reply)](WebGLLoadPolicy policy) {
-            reply(static_cast<uint32_t>(policy));
+            reply->send(static_cast<uint32_t>(policy));
         });
     } else
-        reply(static_cast<uint32_t>(m_loaderClient->webGLLoadPolicy(*this, url)));
+        reply->send(static_cast<uint32_t>(m_loaderClient->webGLLoadPolicy(*this, url)));
 }
 
-void WebPageProxy::resolveWebGLPolicyForURL(URL&& url, Messages::WebPageProxy::ResolveWebGLPolicyForURL::DelayedReply&& reply)
+void WebPageProxy::resolveWebGLPolicyForURL(URL&& url, Ref<Messages::WebPageProxy::ResolveWebGLPolicyForURL::DelayedReply>&& reply)
 {
     if (m_navigationClient) {
         m_navigationClient->resolveWebGLLoadPolicy(*this, url, [reply = WTFMove(reply)](WebGLLoadPolicy policy) {
-            reply(static_cast<uint32_t>(policy));
+            reply->send(static_cast<uint32_t>(policy));
         });
     } else
-        reply(static_cast<uint32_t>(m_loaderClient->resolveWebGLLoadPolicy(*this, url)));
+        reply->send(static_cast<uint32_t>(m_loaderClient->resolveWebGLLoadPolicy(*this, url)));
 }
 #endif // ENABLE(WEBGL)
 
@@ -4235,10 +4235,10 @@
     m_uiClient->setToolbarsAreVisible(*this, toolbarsAreVisible);
 }
 
-void WebPageProxy::getToolbarsAreVisible(Messages::WebPageProxy::GetToolbarsAreVisible::DelayedReply&& reply)
+void WebPageProxy::getToolbarsAreVisible(Ref<Messages::WebPageProxy::GetToolbarsAreVisible::DelayedReply>&& reply)
 {
     m_uiClient->toolbarsAreVisible(*this, [reply = WTFMove(reply)](bool visible) {
-        reply(visible);
+        reply->send(visible);
     });
 }
 
@@ -4247,10 +4247,10 @@
     m_uiClient->setMenuBarIsVisible(*this, menuBarIsVisible);
 }
 
-void WebPageProxy::getMenuBarIsVisible(Messages::WebPageProxy::GetMenuBarIsVisible::DelayedReply&& reply)
+void WebPageProxy::getMenuBarIsVisible(Ref<Messages::WebPageProxy::GetMenuBarIsVisible::DelayedReply>&& reply)
 {
     m_uiClient->menuBarIsVisible(*this, [reply = WTFMove(reply)] (bool visible) {
-        reply(visible);
+        reply->send(visible);
     });
 }
 
@@ -4259,10 +4259,10 @@
     m_uiClient->setStatusBarIsVisible(*this, statusBarIsVisible);
 }
 
-void WebPageProxy::getStatusBarIsVisible(Messages::WebPageProxy::GetStatusBarIsVisible::DelayedReply&& reply)
+void WebPageProxy::getStatusBarIsVisible(Ref<Messages::WebPageProxy::GetStatusBarIsVisible::DelayedReply>&& reply)
 {
     m_uiClient->statusBarIsVisible(*this, [reply = WTFMove(reply)] (bool visible) {
-        reply(visible);
+        reply->send(visible);
     });
 }
 
@@ -4276,10 +4276,10 @@
     m_uiClient->setWindowFrame(*this, m_pageClient.convertToDeviceSpace(newWindowFrame));
 }
 
-void WebPageProxy::getWindowFrame(Messages::WebPageProxy::GetWindowFrame::DelayedReply&& reply)
+void WebPageProxy::getWindowFrame(Ref<Messages::WebPageProxy::GetWindowFrame::DelayedReply>&& reply)
 {
     m_uiClient->windowFrame(*this, [this, protectedThis = makeRef(*this), reply = WTFMove(reply)] (FloatRect frame) {
-        reply(m_pageClient.convertToUserSpace(frame));
+        reply->send(m_pageClient.convertToUserSpace(frame));
     });
 }
 
@@ -4288,14 +4288,14 @@
     m_uiClient->windowFrame(*this, WTFMove(completionHandler));
 }
 
-void WebPageProxy::screenToRootView(const IntPoint& screenPoint, Messages::WebPageProxy::ScreenToRootView::DelayedReply&& reply)
+void WebPageProxy::screenToRootView(const IntPoint& screenPoint, Ref<Messages::WebPageProxy::ScreenToRootView::DelayedReply>&& reply)
 {
-    reply(m_pageClient.screenToRootView(screenPoint));
+    reply->send(m_pageClient.screenToRootView(screenPoint));
 }
     
-void WebPageProxy::rootViewToScreen(const IntRect& viewRect, Messages::WebPageProxy::RootViewToScreen::DelayedReply&& reply)
+void WebPageProxy::rootViewToScreen(const IntRect& viewRect, Ref<Messages::WebPageProxy::RootViewToScreen::DelayedReply>&& reply)
 {
-    reply(m_pageClient.rootViewToScreen(viewRect));
+    reply->send(m_pageClient.rootViewToScreen(viewRect));
 }
     
 #if PLATFORM(IOS)
@@ -4310,7 +4310,7 @@
 }
 #endif
 
-void WebPageProxy::runBeforeUnloadConfirmPanel(uint64_t frameID, const SecurityOriginData& securityOrigin, const String& message, Messages::WebPageProxy::RunBeforeUnloadConfirmPanel::DelayedReply reply)
+void WebPageProxy::runBeforeUnloadConfirmPanel(uint64_t frameID, const SecurityOriginData& securityOrigin, const String& message, RefPtr<Messages::WebPageProxy::RunBeforeUnloadConfirmPanel::DelayedReply> reply)
 {
     WebFrameProxy* frame = m_process->webFrame(frameID);
     MESSAGE_CHECK(frame);
@@ -4323,7 +4323,7 @@
             automationSession->willShowJavaScriptDialog(*this);
     }
 
-    m_uiClient->runBeforeUnloadConfirmPanel(this, message, frame, securityOrigin, [reply = WTFMove(reply)](bool result) { reply(result); });
+    m_uiClient->runBeforeUnloadConfirmPanel(this, message, frame, securityOrigin, [reply](bool result) { reply->send(result); });
 }
 
 void WebPageProxy::didChangeViewportProperties(const ViewportAttributes& attr)
@@ -6018,7 +6018,7 @@
         m_loaderClient->didReceiveAuthenticationChallengeInFrame(*this, *frame, authenticationChallenge.get());
 }
 
-void WebPageProxy::exceededDatabaseQuota(uint64_t frameID, const String& originIdentifier, const String& databaseName, const String& displayName, uint64_t currentQuota, uint64_t currentOriginUsage, uint64_t currentDatabaseUsage, uint64_t expectedUsage, Messages::WebPageProxy::ExceededDatabaseQuota::DelayedReply&& reply)
+void WebPageProxy::exceededDatabaseQuota(uint64_t frameID, const String& originIdentifier, const String& databaseName, const String& displayName, uint64_t currentQuota, uint64_t currentOriginUsage, uint64_t currentDatabaseUsage, uint64_t expectedUsage, Ref<Messages::WebPageProxy::ExceededDatabaseQuota::DelayedReply>&& reply)
 {
     ExceededDatabaseQuotaRecords& records = ExceededDatabaseQuotaRecords::singleton();
     std::unique_ptr<ExceededDatabaseQuotaRecords::Record> newRecord = records.createRecord(frameID,
@@ -6029,23 +6029,26 @@
     if (records.areBeingProcessed())
         return;
 
-    while (auto* record = records.next()) {
+    ExceededDatabaseQuotaRecords::Record* record = records.next();
+    while (record) {
         WebFrameProxy* frame = m_process->webFrame(record->frameID);
         MESSAGE_CHECK(frame);
 
-        auto origin = API::SecurityOrigin::create(SecurityOriginData::fromDatabaseIdentifier(record->originIdentifier)->securityOrigin());
-        m_uiClient->exceededDatabaseQuota(this, frame, origin.ptr(), record->databaseName, record->displayName, record->currentQuota, record->currentOriginUsage, record->currentDatabaseUsage, record->expectedUsage, [currentReply = WTFMove(record->reply)](unsigned long long newQuota) {
-            currentReply(newQuota);
-        });
+        RefPtr<API::SecurityOrigin> origin = API::SecurityOrigin::create(SecurityOriginData::fromDatabaseIdentifier(record->originIdentifier)->securityOrigin());
+        auto currentReply = record->reply;
+        m_uiClient->exceededDatabaseQuota(this, frame, origin.get(),
+            record->databaseName, record->displayName, record->currentQuota,
+            record->currentOriginUsage, record->currentDatabaseUsage, record->expectedUsage,
+            [currentReply](unsigned long long newQuota) { currentReply->send(newQuota); });
+
+        record = records.next();
     }
 }
 
-void WebPageProxy::reachedApplicationCacheOriginQuota(const String& originIdentifier, uint64_t currentQuota, uint64_t totalBytesNeeded, Messages::WebPageProxy::ReachedApplicationCacheOriginQuota::DelayedReply&& reply)
+void WebPageProxy::reachedApplicationCacheOriginQuota(const String& originIdentifier, uint64_t currentQuota, uint64_t totalBytesNeeded, Ref<Messages::WebPageProxy::ReachedApplicationCacheOriginQuota::DelayedReply>&& reply)
 {
     Ref<SecurityOrigin> securityOrigin = SecurityOriginData::fromDatabaseIdentifier(originIdentifier)->securityOrigin();
-    m_uiClient->reachedApplicationCacheOriginQuota(this, securityOrigin.get(), currentQuota, totalBytesNeeded, [reply = WTFMove(reply)](unsigned long long newQuota) {
-        reply(newQuota);
-    });
+    m_uiClient->reachedApplicationCacheOriginQuota(this, securityOrigin.get(), currentQuota, totalBytesNeeded, [reply = WTFMove(reply)](unsigned long long newQuota) { reply->send(newQuota); });
 }
 
 void WebPageProxy::requestGeolocationPermissionForFrame(uint64_t geolocationID, uint64_t frameID, String originIdentifier)

Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.h (230292 => 230293)


--- trunk/Source/WebKit/UIProcess/WebPageProxy.h	2018-04-05 02:40:49 UTC (rev 230292)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.h	2018-04-05 03:15:46 UTC (rev 230293)
@@ -1227,7 +1227,7 @@
 
     void setFocus(bool focused);
     void setWindowFrame(const WebCore::FloatRect&);
-    void getWindowFrame(Messages::WebPageProxy::GetWindowFrame::DelayedReply&&);
+    void getWindowFrame(Ref<Messages::WebPageProxy::GetWindowFrame::DelayedReply>&&);
     void getWindowFrameWithCallback(Function<void(WebCore::FloatRect)>&&);
 
     bool isResourceCachingDisabled() const { return m_isResourceCachingDisabled; }
@@ -1384,11 +1384,11 @@
     void didUpdateHistoryTitle(const String& title, const String& url, uint64_t frameID);
 
     // UI client
-    void createNewPage(const FrameInfoData&, uint64_t originatingPageID, WebCore::ResourceRequest&&, WebCore::WindowFeatures&&, NavigationActionData&&, Messages::WebPageProxy::CreateNewPage::DelayedReply&&);
+    void createNewPage(const FrameInfoData&, uint64_t originatingPageID, WebCore::ResourceRequest&&, WebCore::WindowFeatures&&, NavigationActionData&&, Ref<Messages::WebPageProxy::CreateNewPage::DelayedReply>&&);
     void showPage();
-    void runJavaScriptAlert(uint64_t frameID, const WebCore::SecurityOriginData&, const String&, Messages::WebPageProxy::RunJavaScriptAlert::DelayedReply&&);
-    void runJavaScriptConfirm(uint64_t frameID, const WebCore::SecurityOriginData&, const String&, Messages::WebPageProxy::RunJavaScriptConfirm::DelayedReply&&);
-    void runJavaScriptPrompt(uint64_t frameID, const WebCore::SecurityOriginData&, const String&, const String&, Messages::WebPageProxy::RunJavaScriptPrompt::DelayedReply&&);
+    void runJavaScriptAlert(uint64_t frameID, const WebCore::SecurityOriginData&, const String&, Ref<Messages::WebPageProxy::RunJavaScriptAlert::DelayedReply>&&);
+    void runJavaScriptConfirm(uint64_t frameID, const WebCore::SecurityOriginData&, const String&, Ref<Messages::WebPageProxy::RunJavaScriptConfirm::DelayedReply>&&);
+    void runJavaScriptPrompt(uint64_t frameID, const WebCore::SecurityOriginData&, const String&, const String&, Ref<Messages::WebPageProxy::RunJavaScriptPrompt::DelayedReply>&&);
     void setStatusText(const String&);
     void mouseDidMoveOverElement(WebHitTestResultData&&, uint32_t modifiers, UserData&&);
 
@@ -1396,29 +1396,29 @@
     void unavailablePluginButtonClicked(uint32_t opaquePluginUnavailabilityReason, const String& mimeType, const String& pluginURLString, const String& pluginsPageURLString, const String& frameURLString, const String& pageURLString);
 #endif // ENABLE(NETSCAPE_PLUGIN_API)
 #if ENABLE(WEBGL)
-    void webGLPolicyForURL(WebCore::URL&&, Messages::WebPageProxy::WebGLPolicyForURL::DelayedReply&&);
-    void resolveWebGLPolicyForURL(WebCore::URL&&, Messages::WebPageProxy::ResolveWebGLPolicyForURL::DelayedReply&&);
+    void webGLPolicyForURL(WebCore::URL&&, Ref<Messages::WebPageProxy::WebGLPolicyForURL::DelayedReply>&&);
+    void resolveWebGLPolicyForURL(WebCore::URL&&, Ref<Messages::WebPageProxy::ResolveWebGLPolicyForURL::DelayedReply>&&);
 #endif // ENABLE(WEBGL)
     void setToolbarsAreVisible(bool toolbarsAreVisible);
-    void getToolbarsAreVisible(Messages::WebPageProxy::GetToolbarsAreVisible::DelayedReply&&);
+    void getToolbarsAreVisible(Ref<Messages::WebPageProxy::GetToolbarsAreVisible::DelayedReply>&&);
     void setMenuBarIsVisible(bool menuBarIsVisible);
-    void getMenuBarIsVisible(Messages::WebPageProxy::GetMenuBarIsVisible::DelayedReply&&);
+    void getMenuBarIsVisible(Ref<Messages::WebPageProxy::GetMenuBarIsVisible::DelayedReply>&&);
     void setStatusBarIsVisible(bool statusBarIsVisible);
-    void getStatusBarIsVisible(Messages::WebPageProxy::GetStatusBarIsVisible::DelayedReply&&);
+    void getStatusBarIsVisible(Ref<Messages::WebPageProxy::GetStatusBarIsVisible::DelayedReply>&&);
     void setIsResizable(bool isResizable);
-    void screenToRootView(const WebCore::IntPoint& screenPoint, Messages::WebPageProxy::ScreenToRootView::DelayedReply&&);
-    void rootViewToScreen(const WebCore::IntRect& viewRect, Messages::WebPageProxy::RootViewToScreen::DelayedReply&&);
+    void screenToRootView(const WebCore::IntPoint& screenPoint, Ref<Messages::WebPageProxy::ScreenToRootView::DelayedReply>&&);
+    void rootViewToScreen(const WebCore::IntRect& viewRect, Ref<Messages::WebPageProxy::RootViewToScreen::DelayedReply>&&);
 #if PLATFORM(IOS)
     void accessibilityScreenToRootView(const WebCore::IntPoint& screenPoint, WebCore::IntPoint& windowPoint);
     void rootViewToAccessibilityScreen(const WebCore::IntRect& viewRect, WebCore::IntRect& result);
 #endif
-    void runBeforeUnloadConfirmPanel(uint64_t frameID, const WebCore::SecurityOriginData&, const String& message, Messages::WebPageProxy::RunBeforeUnloadConfirmPanel::DelayedReply);
+    void runBeforeUnloadConfirmPanel(uint64_t frameID, const WebCore::SecurityOriginData&, const String& message, RefPtr<Messages::WebPageProxy::RunBeforeUnloadConfirmPanel::DelayedReply>);
     void didChangeViewportProperties(const WebCore::ViewportAttributes&);
     void pageDidScroll();
     void runOpenPanel(uint64_t frameID, const WebCore::SecurityOriginData&, const WebCore::FileChooserSettings&);
     void printFrame(uint64_t frameID);
-    void exceededDatabaseQuota(uint64_t frameID, const String& originIdentifier, const String& databaseName, const String& displayName, uint64_t currentQuota, uint64_t currentOriginUsage, uint64_t currentDatabaseUsage, uint64_t expectedUsage, Messages::WebPageProxy::ExceededDatabaseQuota::DelayedReply&&);
-    void reachedApplicationCacheOriginQuota(const String& originIdentifier, uint64_t currentQuota, uint64_t totalBytesNeeded, Messages::WebPageProxy::ReachedApplicationCacheOriginQuota::DelayedReply&&);
+    void exceededDatabaseQuota(uint64_t frameID, const String& originIdentifier, const String& databaseName, const String& displayName, uint64_t currentQuota, uint64_t currentOriginUsage, uint64_t currentDatabaseUsage, uint64_t expectedUsage, Ref<Messages::WebPageProxy::ExceededDatabaseQuota::DelayedReply>&&);
+    void reachedApplicationCacheOriginQuota(const String& originIdentifier, uint64_t currentQuota, uint64_t totalBytesNeeded, Ref<Messages::WebPageProxy::ReachedApplicationCacheOriginQuota::DelayedReply>&&);
     void requestGeolocationPermissionForFrame(uint64_t geolocationID, uint64_t frameID, String originIdentifier);
 
 #if ENABLE(MEDIA_STREAM)

Modified: trunk/Source/WebKit/UIProcess/WebProcessPool.cpp (230292 => 230293)


--- trunk/Source/WebKit/UIProcess/WebProcessPool.cpp	2018-04-05 02:40:49 UTC (rev 230292)
+++ trunk/Source/WebKit/UIProcess/WebProcessPool.cpp	2018-04-05 03:15:46 UTC (rev 230293)
@@ -514,7 +514,7 @@
     return *m_networkProcess;
 }
 
-void WebProcessPool::networkProcessCrashed(NetworkProcessProxy& networkProcessProxy, Vector<Messages::WebProcessProxy::GetNetworkProcessConnection::DelayedReply>&& pendingReplies)
+void WebProcessPool::networkProcessCrashed(NetworkProcessProxy& networkProcessProxy, Vector<Ref<Messages::WebProcessProxy::GetNetworkProcessConnection::DelayedReply>>&& pendingReplies)
 {
     networkProcessFailedToLaunch(networkProcessProxy);
     ASSERT(!m_networkProcess);
@@ -540,7 +540,7 @@
     m_networkProcess = nullptr;
 }
 
-void WebProcessPool::getNetworkProcessConnection(Messages::WebProcessProxy::GetNetworkProcessConnection::DelayedReply&& reply)
+void WebProcessPool::getNetworkProcessConnection(Ref<Messages::WebProcessProxy::GetNetworkProcessConnection::DelayedReply>&& reply)
 {
     ensureNetworkProcess();
     ASSERT(m_networkProcess);
@@ -587,7 +587,7 @@
     m_storageProcess->send(Messages::StorageProcess::InitializeWebsiteDataStore(relevantDataStore->storageProcessParameters()), 0);
 }
 
-void WebProcessPool::getStorageProcessConnection(WebProcessProxy& webProcessProxy, PAL::SessionID initialSessionID, Messages::WebProcessProxy::GetStorageProcessConnection::DelayedReply&& reply)
+void WebProcessPool::getStorageProcessConnection(WebProcessProxy& webProcessProxy, PAL::SessionID initialSessionID, Ref<Messages::WebProcessProxy::GetStorageProcessConnection::DelayedReply>&& reply)
 {
     ensureStorageProcessAndWebsiteDataStore(WebsiteDataStore::existingNonDefaultDataStoreForSessionID(initialSessionID));
 

Modified: trunk/Source/WebKit/UIProcess/WebProcessPool.h (230292 => 230293)


--- trunk/Source/WebKit/UIProcess/WebProcessPool.h	2018-04-05 02:40:49 UTC (rev 230292)
+++ trunk/Source/WebKit/UIProcess/WebProcessPool.h	2018-04-05 03:15:46 UTC (rev 230293)
@@ -324,14 +324,14 @@
     // Network Process Management
     NetworkProcessProxy& ensureNetworkProcess(WebsiteDataStore* withWebsiteDataStore = nullptr);
     NetworkProcessProxy* networkProcess() { return m_networkProcess.get(); }
-    void networkProcessCrashed(NetworkProcessProxy&, Vector<Messages::WebProcessProxy::GetNetworkProcessConnection::DelayedReply>&&);
+    void networkProcessCrashed(NetworkProcessProxy&, Vector<Ref<Messages::WebProcessProxy::GetNetworkProcessConnection::DelayedReply>>&&);
     void networkProcessFailedToLaunch(NetworkProcessProxy&);
 
-    void getNetworkProcessConnection(Messages::WebProcessProxy::GetNetworkProcessConnection::DelayedReply&&);
+    void getNetworkProcessConnection(Ref<Messages::WebProcessProxy::GetNetworkProcessConnection::DelayedReply>&&);
 
     void ensureStorageProcessAndWebsiteDataStore(WebsiteDataStore* relevantDataStore);
     StorageProcessProxy* storageProcess() { return m_storageProcess.get(); }
-    void getStorageProcessConnection(WebProcessProxy&, PAL::SessionID initialSessionID, Messages::WebProcessProxy::GetStorageProcessConnection::DelayedReply&&);
+    void getStorageProcessConnection(WebProcessProxy&, PAL::SessionID initialSessionID, Ref<Messages::WebProcessProxy::GetStorageProcessConnection::DelayedReply>&&);
     void storageProcessCrashed(StorageProcessProxy*);
 #if ENABLE(SERVICE_WORKER)
     void establishWorkerContextConnectionToStorageProcess(StorageProcessProxy&, WebCore::SecurityOriginData&&, std::optional<PAL::SessionID>);

Modified: trunk/Source/WebKit/UIProcess/WebProcessProxy.cpp (230292 => 230293)


--- trunk/Source/WebKit/UIProcess/WebProcessProxy.cpp	2018-04-05 02:40:49 UTC (rev 230292)
+++ trunk/Source/WebKit/UIProcess/WebProcessProxy.cpp	2018-04-05 03:15:46 UTC (rev 230293)
@@ -594,18 +594,18 @@
 #endif // ENABLE(NETSCAPE_PLUGIN_API)
 
 #if ENABLE(NETSCAPE_PLUGIN_API)
-void WebProcessProxy::getPluginProcessConnection(uint64_t pluginProcessToken, Messages::WebProcessProxy::GetPluginProcessConnection::DelayedReply&& reply)
+void WebProcessProxy::getPluginProcessConnection(uint64_t pluginProcessToken, Ref<Messages::WebProcessProxy::GetPluginProcessConnection::DelayedReply>&& reply)
 {
     PluginProcessManager::singleton().getPluginProcessConnection(pluginProcessToken, WTFMove(reply));
 }
 #endif
 
-void WebProcessProxy::getNetworkProcessConnection(Messages::WebProcessProxy::GetNetworkProcessConnection::DelayedReply&& reply)
+void WebProcessProxy::getNetworkProcessConnection(Ref<Messages::WebProcessProxy::GetNetworkProcessConnection::DelayedReply>&& reply)
 {
     m_processPool->getNetworkProcessConnection(WTFMove(reply));
 }
 
-void WebProcessProxy::getStorageProcessConnection(PAL::SessionID initialSessionID, Messages::WebProcessProxy::GetStorageProcessConnection::DelayedReply&& reply)
+void WebProcessProxy::getStorageProcessConnection(PAL::SessionID initialSessionID, Ref<Messages::WebProcessProxy::GetStorageProcessConnection::DelayedReply>&& reply)
 {
     m_processPool->getStorageProcessConnection(*this, initialSessionID, WTFMove(reply));
 }

Modified: trunk/Source/WebKit/UIProcess/WebProcessProxy.h (230292 => 230293)


--- trunk/Source/WebKit/UIProcess/WebProcessProxy.h	2018-04-05 02:40:49 UTC (rev 230292)
+++ trunk/Source/WebKit/UIProcess/WebProcessProxy.h	2018-04-05 03:15:46 UTC (rev 230293)
@@ -244,10 +244,10 @@
     void getPlugins(bool refresh, Vector<WebCore::PluginInfo>& plugins, Vector<WebCore::PluginInfo>& applicationPlugins, std::optional<Vector<WebCore::SupportedPluginName>>&);
 #endif // ENABLE(NETSCAPE_PLUGIN_API)
 #if ENABLE(NETSCAPE_PLUGIN_API)
-    void getPluginProcessConnection(uint64_t pluginProcessToken, Messages::WebProcessProxy::GetPluginProcessConnection::DelayedReply&&);
+    void getPluginProcessConnection(uint64_t pluginProcessToken, Ref<Messages::WebProcessProxy::GetPluginProcessConnection::DelayedReply>&&);
 #endif
-    void getNetworkProcessConnection(Messages::WebProcessProxy::GetNetworkProcessConnection::DelayedReply&&);
-    void getStorageProcessConnection(PAL::SessionID initialSessionID, Messages::WebProcessProxy::GetStorageProcessConnection::DelayedReply&&);
+    void getNetworkProcessConnection(Ref<Messages::WebProcessProxy::GetNetworkProcessConnection::DelayedReply>&&);
+    void getStorageProcessConnection(PAL::SessionID initialSessionID, Ref<Messages::WebProcessProxy::GetStorageProcessConnection::DelayedReply>&&);
 
     bool platformIsBeingDebugged() const;
     bool shouldAllowNonValidInjectedCode() const;

Modified: trunk/Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.cpp (230292 => 230293)


--- trunk/Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.cpp	2018-04-05 02:40:49 UTC (rev 230292)
+++ trunk/Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.cpp	2018-04-05 03:15:46 UTC (rev 230293)
@@ -236,10 +236,10 @@
     SWContextManager::singleton().terminateWorker(identifier, asyncWorkerTerminationTimeout, nullptr);
 }
 
-void WebSWContextManagerConnection::syncTerminateWorker(ServiceWorkerIdentifier identifier, Messages::WebSWContextManagerConnection::SyncTerminateWorker::DelayedReply&& reply)
+void WebSWContextManagerConnection::syncTerminateWorker(ServiceWorkerIdentifier identifier, Ref<Messages::WebSWContextManagerConnection::SyncTerminateWorker::DelayedReply>&& reply)
 {
     SWContextManager::singleton().terminateWorker(identifier, syncWorkerTerminationTimeout, [reply = WTFMove(reply)] {
-        reply();
+        reply->send();
     });
 }
 

Modified: trunk/Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.h (230292 => 230293)


--- trunk/Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.h	2018-04-05 02:40:49 UTC (rev 230292)
+++ trunk/Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.h	2018-04-05 03:15:46 UTC (rev 230293)
@@ -81,7 +81,7 @@
     void fireInstallEvent(WebCore::ServiceWorkerIdentifier);
     void fireActivateEvent(WebCore::ServiceWorkerIdentifier);
     void terminateWorker(WebCore::ServiceWorkerIdentifier);
-    void syncTerminateWorker(WebCore::ServiceWorkerIdentifier, Messages::WebSWContextManagerConnection::SyncTerminateWorker::DelayedReply&&);
+    void syncTerminateWorker(WebCore::ServiceWorkerIdentifier, Ref<Messages::WebSWContextManagerConnection::SyncTerminateWorker::DelayedReply>&&);
     void findClientByIdentifierCompleted(uint64_t requestIdentifier, std::optional<WebCore::ServiceWorkerClientData>&&, bool hasSecurityError);
     void matchAllCompleted(uint64_t matchAllRequestIdentifier, Vector<WebCore::ServiceWorkerClientData>&&);
     void claimCompleted(uint64_t claimRequestIdentifier);

Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.h (230292 => 230293)


--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.h	2018-04-05 02:40:49 UTC (rev 230292)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.h	2018-04-05 03:15:46 UTC (rev 230293)
@@ -807,7 +807,7 @@
 #endif
 
 #if PLATFORM(IOS)
-    void computePagesForPrintingAndDrawToPDF(uint64_t frameID, const PrintInfo&, CallbackID, Messages::WebPage::ComputePagesForPrintingAndDrawToPDF::DelayedReply&&);
+    void computePagesForPrintingAndDrawToPDF(uint64_t frameID, const PrintInfo&, CallbackID, Ref<Messages::WebPage::ComputePagesForPrintingAndDrawToPDF::DelayedReply>&&);
 #endif
 
 #if PLATFORM(GTK)

Modified: trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm (230292 => 230293)


--- trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm	2018-04-05 02:40:49 UTC (rev 230292)
+++ trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm	2018-04-05 03:15:46 UTC (rev 230293)
@@ -3426,10 +3426,10 @@
 }
 #endif
 
-void WebPage::computePagesForPrintingAndDrawToPDF(uint64_t frameID, const PrintInfo& printInfo, CallbackID callbackID, Messages::WebPage::ComputePagesForPrintingAndDrawToPDF::DelayedReply&& reply)
+void WebPage::computePagesForPrintingAndDrawToPDF(uint64_t frameID, const PrintInfo& printInfo, CallbackID callbackID, Ref<Messages::WebPage::ComputePagesForPrintingAndDrawToPDF::DelayedReply>&& reply)
 {
     if (printInfo.snapshotFirstPage) {
-        reply(1);
+        reply->send(1);
         IntSize snapshotSize { FloatSize { printInfo.availablePaperWidth, printInfo.availablePaperHeight } };
         IntRect snapshotRect { {0, 0}, snapshotSize };
         auto pdfData = pdfSnapshotAtSize(snapshotRect, snapshotSize, 0);
@@ -3444,7 +3444,7 @@
     ASSERT(pageRects.size() >= 1);
     std::size_t pageCount = pageRects.size();
     ASSERT(pageCount <= std::numeric_limits<uint32_t>::max());
-    reply(pageCount);
+    reply->send(pageCount);
 
     RetainPtr<CFMutableDataRef> pdfPageData;
     drawPagesToPDFImpl(frameID, printInfo, 0, pageCount, pdfPageData);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to