Web Inspector: Include Beacon and Ping requests in Network tab
[WebKit-https.git] / Source / WebKit / WebProcess / Network / NetworkProcessConnection.cpp
index 08666ab..8c615f0 100644 (file)
@@ -29,6 +29,9 @@
 #include "DataReference.h"
 #include "LibWebRTCNetwork.h"
 #include "NetworkConnectionToWebProcessMessages.h"
+#include "WebCacheStorageConnection.h"
+#include "WebCacheStorageConnectionMessages.h"
+#include "WebCacheStorageProvider.h"
 #include "WebCoreArgumentCoders.h"
 #include "WebLoaderStrategy.h"
 #include "WebProcess.h"
@@ -56,6 +59,7 @@ NetworkProcessConnection::NetworkProcessConnection(IPC::Connection::Identifier c
 
 NetworkProcessConnection::~NetworkProcessConnection()
 {
+    m_connection->invalidate();
 }
 
 void NetworkProcessConnection::didReceiveMessage(IPC::Connection& connection, IPC::Decoder& decoder)
@@ -85,6 +89,10 @@ void NetworkProcessConnection::didReceiveMessage(IPC::Connection& connection, IP
         return;
     }
 #endif
+    if (decoder.messageReceiverName() == Messages::WebCacheStorageConnection::messageReceiverName()) {
+        WebProcess::singleton().cacheStorageProvider().process(connection, decoder);
+        return;
+    }
 
     didReceiveNetworkProcessConnectionMessage(connection, decoder);
 }
@@ -128,6 +136,16 @@ void NetworkProcessConnection::didWriteBlobsToTemporaryFiles(uint64_t requestIde
         handler(filenames);
 }
 
+void NetworkProcessConnection::didFinishPingLoad(uint64_t pingLoadIdentifier, ResourceError&& error, ResourceResponse&& response)
+{
+    WebProcess::singleton().webLoaderStrategy().didFinishPingLoad(pingLoadIdentifier, WTFMove(error), WTFMove(response));
+}
+
+void NetworkProcessConnection::didFinishPreconnection(uint64_t preconnectionIdentifier, ResourceError&& error)
+{
+    WebProcess::singleton().webLoaderStrategy().didFinishPreconnection(preconnectionIdentifier, WTFMove(error));
+}
+
 #if ENABLE(SHAREABLE_RESOURCE)
 void NetworkProcessConnection::didCacheResource(const ResourceRequest& request, const ShareableResource::Handle& handle, PAL::SessionID sessionID)
 {