Title: [225282] trunk/Source/WebKit
Revision
225282
Author
cdu...@apple.com
Date
2017-11-29 11:40:12 -0800 (Wed, 29 Nov 2017)

Log Message

ensure*Connection() methods on WebProcess should return a reference
https://bugs.webkit.org/show_bug.cgi?id=180149

Reviewed by Alex Christensen.

ensure*Connection() methods on WebProcess should return a reference instead of not returning
anything. Also get rid of the non-ensure variants which called "ensure" internally and are
no longer needed.

* Shared/mac/CookieStorageShim.mm:
(WebKit::webKitCookieStorageCopyRequestHeaderFieldsForURL):
* WebProcess/Cache/WebCacheStorageConnection.cpp:
(WebKit::WebCacheStorageConnection::connection):
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
(WebKit::WebIDBConnectionToServer::messageSenderConnection):
(WebKit::preregisterSandboxExtensionsIfNecessary):
* WebProcess/Databases/WebDatabaseProvider.cpp:
(WebKit::WebDatabaseProvider::idbConnectionToServerForSession):
* WebProcess/FileAPI/BlobRegistryProxy.cpp:
(WebKit::BlobRegistryProxy::registerFileBlobURL):
(WebKit::BlobRegistryProxy::registerBlobURL):
(WebKit::BlobRegistryProxy::registerBlobURLOptionallyFileBacked):
(WebKit::BlobRegistryProxy::unregisterBlobURL):
(WebKit::BlobRegistryProxy::registerBlobURLForSlice):
(WebKit::BlobRegistryProxy::blobSize):
(WebKit::BlobRegistryProxy::writeBlobsToTemporaryFiles):
* WebProcess/Network/NetworkProcessConnection.cpp:
(WebKit::NetworkProcessConnection::writeBlobsToTemporaryFiles):
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
(WebKit::WebLoaderStrategy::remove):
(WebKit::WebLoaderStrategy::setDefersLoading):
(WebKit::WebLoaderStrategy::loadResourceSynchronously):
(WebKit::WebLoaderStrategy::startPingLoad):
(WebKit::WebLoaderStrategy::preconnectTo):
(WebKit::WebLoaderStrategy::storeDerivedDataToCache):
(WebKit::WebLoaderStrategy::setCaptureExtraNetworkLoadMetricsEnabled):
* WebProcess/Network/WebResourceLoader.cpp:
(WebKit::WebResourceLoader::messageSenderConnection):
* WebProcess/Network/WebSocketStream.cpp:
(WebKit::WebSocketStream::WebSocketStream):
(WebKit::WebSocketStream::messageSenderConnection):
* WebProcess/Network/webrtc/LibWebRTCResolver.cpp:
(WebKit::sendOnMainThread):
* WebProcess/Network/webrtc/LibWebRTCSocket.cpp:
(WebKit::sendOnMainThread):
* WebProcess/Network/webrtc/LibWebRTCSocketFactory.cpp:
(WebKit::LibWebRTCSocketFactory::CreateServerTcpSocket):
(WebKit::LibWebRTCSocketFactory::CreateUdpSocket):
(WebKit::LibWebRTCSocketFactory::CreateClientTcpSocket):
(WebKit::LibWebRTCSocketFactory::createNewConnectionSocket):
* WebProcess/Network/webrtc/WebRTCMonitor.cpp:
(WebKit::sendOnMainThread):
* WebProcess/Storage/WebServiceWorkerProvider.cpp:
(WebKit::WebServiceWorkerProvider::serviceWorkerConnectionForSession):
(WebKit::WebServiceWorkerProvider::handleFetch):
* WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
(WebKit::WebPlatformStrategies::cookiesForDOM):
(WebKit::WebPlatformStrategies::setCookiesFromDOM):
(WebKit::WebPlatformStrategies::cookiesEnabled):
(WebKit::WebPlatformStrategies::cookieRequestHeaderFieldValue):
(WebKit::WebPlatformStrategies::getRawCookies):
(WebKit::WebPlatformStrategies::deleteCookie):
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::startDownload):
(WebKit::WebFrame::convertMainResourceLoadToDownload):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::ensureLegacyPrivateBrowsingSessionInNetworkProcess):
(WebKit::WebProcess::ensureNetworkProcessConnection):
(WebKit::WebProcess::ensureWebToStorageProcessConnection):
(WebKit::WebProcess::prefetchDNS):
* WebProcess/WebProcess.h:

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (225281 => 225282)


--- trunk/Source/WebKit/ChangeLog	2017-11-29 19:22:24 UTC (rev 225281)
+++ trunk/Source/WebKit/ChangeLog	2017-11-29 19:40:12 UTC (rev 225282)
@@ -1,3 +1,78 @@
+2017-11-29  Chris Dumez  <cdu...@apple.com>
+
+        ensure*Connection() methods on WebProcess should return a reference
+        https://bugs.webkit.org/show_bug.cgi?id=180149
+
+        Reviewed by Alex Christensen.
+
+        ensure*Connection() methods on WebProcess should return a reference instead of not returning
+        anything. Also get rid of the non-ensure variants which called "ensure" internally and are
+        no longer needed.
+
+        * Shared/mac/CookieStorageShim.mm:
+        (WebKit::webKitCookieStorageCopyRequestHeaderFieldsForURL):
+        * WebProcess/Cache/WebCacheStorageConnection.cpp:
+        (WebKit::WebCacheStorageConnection::connection):
+        * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
+        (WebKit::WebIDBConnectionToServer::messageSenderConnection):
+        (WebKit::preregisterSandboxExtensionsIfNecessary):
+        * WebProcess/Databases/WebDatabaseProvider.cpp:
+        (WebKit::WebDatabaseProvider::idbConnectionToServerForSession):
+        * WebProcess/FileAPI/BlobRegistryProxy.cpp:
+        (WebKit::BlobRegistryProxy::registerFileBlobURL):
+        (WebKit::BlobRegistryProxy::registerBlobURL):
+        (WebKit::BlobRegistryProxy::registerBlobURLOptionallyFileBacked):
+        (WebKit::BlobRegistryProxy::unregisterBlobURL):
+        (WebKit::BlobRegistryProxy::registerBlobURLForSlice):
+        (WebKit::BlobRegistryProxy::blobSize):
+        (WebKit::BlobRegistryProxy::writeBlobsToTemporaryFiles):
+        * WebProcess/Network/NetworkProcessConnection.cpp:
+        (WebKit::NetworkProcessConnection::writeBlobsToTemporaryFiles):
+        * WebProcess/Network/WebLoaderStrategy.cpp:
+        (WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
+        (WebKit::WebLoaderStrategy::remove):
+        (WebKit::WebLoaderStrategy::setDefersLoading):
+        (WebKit::WebLoaderStrategy::loadResourceSynchronously):
+        (WebKit::WebLoaderStrategy::startPingLoad):
+        (WebKit::WebLoaderStrategy::preconnectTo):
+        (WebKit::WebLoaderStrategy::storeDerivedDataToCache):
+        (WebKit::WebLoaderStrategy::setCaptureExtraNetworkLoadMetricsEnabled):
+        * WebProcess/Network/WebResourceLoader.cpp:
+        (WebKit::WebResourceLoader::messageSenderConnection):
+        * WebProcess/Network/WebSocketStream.cpp:
+        (WebKit::WebSocketStream::WebSocketStream):
+        (WebKit::WebSocketStream::messageSenderConnection):
+        * WebProcess/Network/webrtc/LibWebRTCResolver.cpp:
+        (WebKit::sendOnMainThread):
+        * WebProcess/Network/webrtc/LibWebRTCSocket.cpp:
+        (WebKit::sendOnMainThread):
+        * WebProcess/Network/webrtc/LibWebRTCSocketFactory.cpp:
+        (WebKit::LibWebRTCSocketFactory::CreateServerTcpSocket):
+        (WebKit::LibWebRTCSocketFactory::CreateUdpSocket):
+        (WebKit::LibWebRTCSocketFactory::CreateClientTcpSocket):
+        (WebKit::LibWebRTCSocketFactory::createNewConnectionSocket):
+        * WebProcess/Network/webrtc/WebRTCMonitor.cpp:
+        (WebKit::sendOnMainThread):
+        * WebProcess/Storage/WebServiceWorkerProvider.cpp:
+        (WebKit::WebServiceWorkerProvider::serviceWorkerConnectionForSession):
+        (WebKit::WebServiceWorkerProvider::handleFetch):
+        * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
+        (WebKit::WebPlatformStrategies::cookiesForDOM):
+        (WebKit::WebPlatformStrategies::setCookiesFromDOM):
+        (WebKit::WebPlatformStrategies::cookiesEnabled):
+        (WebKit::WebPlatformStrategies::cookieRequestHeaderFieldValue):
+        (WebKit::WebPlatformStrategies::getRawCookies):
+        (WebKit::WebPlatformStrategies::deleteCookie):
+        * WebProcess/WebPage/WebFrame.cpp:
+        (WebKit::WebFrame::startDownload):
+        (WebKit::WebFrame::convertMainResourceLoadToDownload):
+        * WebProcess/WebProcess.cpp:
+        (WebKit::WebProcess::ensureLegacyPrivateBrowsingSessionInNetworkProcess):
+        (WebKit::WebProcess::ensureNetworkProcessConnection):
+        (WebKit::WebProcess::ensureWebToStorageProcessConnection):
+        (WebKit::WebProcess::prefetchDNS):
+        * WebProcess/WebProcess.h:
+
 2017-11-29  Alex Christensen  <achristen...@webkit.org>
 
         Modernize API::SerializedScriptValue

Modified: trunk/Source/WebKit/Shared/mac/CookieStorageShim.mm (225281 => 225282)


--- trunk/Source/WebKit/Shared/mac/CookieStorageShim.mm	2017-11-29 19:22:24 UTC (rev 225281)
+++ trunk/Source/WebKit/Shared/mac/CookieStorageShim.mm	2017-11-29 19:40:12 UTC (rev 225282)
@@ -61,7 +61,7 @@
     String cookies;
     bool secureCookiesAccessed = false;
     URL firstPartyForCookiesURL;
-    if (!WebProcess::singleton().networkConnection().connection().sendSync(Messages::NetworkConnectionToWebProcess::CookieRequestHeaderFieldValue(PAL::SessionID::defaultSessionID(), firstPartyForCookiesURL, inRequestURL, includeSecureCookies), Messages::NetworkConnectionToWebProcess::CookieRequestHeaderFieldValue::Reply(cookies, secureCookiesAccessed), 0))
+    if (!WebProcess::singleton().ensureNetworkProcessConnection().connection().sendSync(Messages::NetworkConnectionToWebProcess::CookieRequestHeaderFieldValue(PAL::SessionID::defaultSessionID(), firstPartyForCookiesURL, inRequestURL, includeSecureCookies), Messages::NetworkConnectionToWebProcess::CookieRequestHeaderFieldValue::Reply(cookies, secureCookiesAccessed), 0))
         return 0;
 
     if (cookies.isNull())

Modified: trunk/Source/WebKit/WebProcess/Cache/WebCacheStorageConnection.cpp (225281 => 225282)


--- trunk/Source/WebKit/WebProcess/Cache/WebCacheStorageConnection.cpp	2017-11-29 19:22:24 UTC (rev 225281)
+++ trunk/Source/WebKit/WebProcess/Cache/WebCacheStorageConnection.cpp	2017-11-29 19:40:12 UTC (rev 225282)
@@ -53,7 +53,7 @@
 
 IPC::Connection& WebCacheStorageConnection::connection()
 {
-    return WebProcess::singleton().networkConnection().connection();
+    return WebProcess::singleton().ensureNetworkProcessConnection().connection();
 }
 
 void WebCacheStorageConnection::doOpen(uint64_t requestIdentifier, const String& origin, const String& cacheName)

Modified: trunk/Source/WebKit/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp (225281 => 225282)


--- trunk/Source/WebKit/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp	2017-11-29 19:22:24 UTC (rev 225281)
+++ trunk/Source/WebKit/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp	2017-11-29 19:40:12 UTC (rev 225282)
@@ -79,7 +79,7 @@
 
 IPC::Connection* WebIDBConnectionToServer::messageSenderConnection()
 {
-    return &WebProcess::singleton().webToStorageProcessConnection()->connection();
+    return &WebProcess::singleton().ensureWebToStorageProcessConnection().connection();
 }
 
 IDBClient::IDBConnectionToServer& WebIDBConnectionToServer::coreConnectionToServer()
@@ -297,7 +297,7 @@
 #endif
 
     if (!filePaths.isEmpty())
-        WebProcess::singleton().networkConnection().connection().send(Messages::NetworkConnectionToWebProcess::PreregisterSandboxExtensionsForOptionallyFileBackedBlob(filePaths, result.handles()), 0);
+        WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::PreregisterSandboxExtensionsForOptionallyFileBackedBlob(filePaths, result.handles()), 0);
 }
 
 void WebIDBConnectionToServer::didGetRecord(const WebIDBResult& result)

Modified: trunk/Source/WebKit/WebProcess/Databases/WebDatabaseProvider.cpp (225281 => 225282)


--- trunk/Source/WebKit/WebProcess/Databases/WebDatabaseProvider.cpp	2017-11-29 19:22:24 UTC (rev 225281)
+++ trunk/Source/WebKit/WebProcess/Databases/WebDatabaseProvider.cpp	2017-11-29 19:40:12 UTC (rev 225282)
@@ -79,8 +79,7 @@
         return result.iterator->value->connectionToServer();
     }
 
-    ASSERT(WebProcess::singleton().webToStorageProcessConnection());
-    return WebProcess::singleton().webToStorageProcessConnection()->idbConnectionToServerForSession(sessionID).coreConnectionToServer();
+    return WebProcess::singleton().ensureWebToStorageProcessConnection().idbConnectionToServerForSession(sessionID).coreConnectionToServer();
 }
 
 #endif

Modified: trunk/Source/WebKit/WebProcess/FileAPI/BlobRegistryProxy.cpp (225281 => 225282)


--- trunk/Source/WebKit/WebProcess/FileAPI/BlobRegistryProxy.cpp	2017-11-29 19:22:24 UTC (rev 225281)
+++ trunk/Source/WebKit/WebProcess/FileAPI/BlobRegistryProxy.cpp	2017-11-29 19:40:12 UTC (rev 225282)
@@ -44,39 +44,39 @@
     if (!file->path().isEmpty())
         SandboxExtension::createHandle(file->path(), SandboxExtension::Type::ReadOnly, extensionHandle);
 
-    WebProcess::singleton().networkConnection().connection().send(Messages::NetworkConnectionToWebProcess::RegisterFileBlobURL(url, file->path(), extensionHandle, contentType), 0);
+    WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::RegisterFileBlobURL(url, file->path(), extensionHandle, contentType), 0);
 }
 
 void BlobRegistryProxy::registerBlobURL(const URL& url, Vector<BlobPart>&& blobParts, const String& contentType)
 {
-    WebProcess::singleton().networkConnection().connection().send(Messages::NetworkConnectionToWebProcess::RegisterBlobURL(url, blobParts, contentType), 0);
+    WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::RegisterBlobURL(url, blobParts, contentType), 0);
 }
 
 void BlobRegistryProxy::registerBlobURL(const URL& url, const URL& srcURL)
 {
-    WebProcess::singleton().networkConnection().connection().send(Messages::NetworkConnectionToWebProcess::RegisterBlobURLFromURL(url, srcURL), 0);
+    WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::RegisterBlobURLFromURL(url, srcURL), 0);
 }
 
 void BlobRegistryProxy::registerBlobURLOptionallyFileBacked(const URL& url, const URL& srcURL, RefPtr<WebCore::BlobDataFileReference>&& file, const String& contentType)
 {
     ASSERT(file);
-    WebProcess::singleton().networkConnection().connection().send(Messages::NetworkConnectionToWebProcess::RegisterBlobURLOptionallyFileBacked(url, srcURL, file->path(), contentType), 0);
+    WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::RegisterBlobURLOptionallyFileBacked(url, srcURL, file->path(), contentType), 0);
 }
 
 void BlobRegistryProxy::unregisterBlobURL(const URL& url)
 {
-    WebProcess::singleton().networkConnection().connection().send(Messages::NetworkConnectionToWebProcess::UnregisterBlobURL(url), 0);
+    WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::UnregisterBlobURL(url), 0);
 }
 
 void BlobRegistryProxy::registerBlobURLForSlice(const URL& url, const URL& srcURL, long long start, long long end)
 {
-    WebProcess::singleton().networkConnection().connection().send(Messages::NetworkConnectionToWebProcess::RegisterBlobURLForSlice(url, srcURL, start, end), 0);
+    WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::RegisterBlobURLForSlice(url, srcURL, start, end), 0);
 }
 
 unsigned long long BlobRegistryProxy::blobSize(const URL& url)
 {
     uint64_t resultSize;
-    if (!WebProcess::singleton().networkConnection().connection().sendSync(Messages::NetworkConnectionToWebProcess::BlobSize(url), Messages::NetworkConnectionToWebProcess::BlobSize::Reply(resultSize), 0))
+    if (!WebProcess::singleton().ensureNetworkProcessConnection().connection().sendSync(Messages::NetworkConnectionToWebProcess::BlobSize(url), Messages::NetworkConnectionToWebProcess::BlobSize::Reply(resultSize), 0))
         return 0;
     return resultSize;
 }
@@ -83,7 +83,7 @@
 
 void BlobRegistryProxy::writeBlobsToTemporaryFiles(const Vector<String>& blobURLs, Function<void (const Vector<String>& filePaths)>&& completionHandler)
 {
-    WebProcess::singleton().networkConnection().writeBlobsToTemporaryFiles(blobURLs, WTFMove(completionHandler));
+    WebProcess::singleton().ensureNetworkProcessConnection().writeBlobsToTemporaryFiles(blobURLs, WTFMove(completionHandler));
 }
 
 }

Modified: trunk/Source/WebKit/WebProcess/Network/NetworkProcessConnection.cpp (225281 => 225282)


--- trunk/Source/WebKit/WebProcess/Network/NetworkProcessConnection.cpp	2017-11-29 19:22:24 UTC (rev 225281)
+++ trunk/Source/WebKit/WebProcess/Network/NetworkProcessConnection.cpp	2017-11-29 19:40:12 UTC (rev 225282)
@@ -126,7 +126,7 @@
 
     m_writeBlobToFileCompletionHandlers.set(requestIdentifier, WTFMove(completionHandler));
 
-    WebProcess::singleton().networkConnection().connection().send(Messages::NetworkConnectionToWebProcess::WriteBlobsToTemporaryFiles(blobURLs, requestIdentifier), 0);
+    WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::WriteBlobsToTemporaryFiles(blobURLs, requestIdentifier), 0);
 }
 
 void NetworkProcessConnection::didWriteBlobsToTemporaryFiles(uint64_t requestIdentifier, const Vector<String>& filenames)

Modified: trunk/Source/WebKit/WebProcess/Network/WebLoaderStrategy.cpp (225281 => 225282)


--- trunk/Source/WebKit/WebProcess/Network/WebLoaderStrategy.cpp	2017-11-29 19:22:24 UTC (rev 225281)
+++ trunk/Source/WebKit/WebProcess/Network/WebLoaderStrategy.cpp	2017-11-29 19:40:12 UTC (rev 225282)
@@ -271,7 +271,7 @@
     ASSERT((loadParameters.webPageID && loadParameters.webFrameID) || loadParameters.clientCredentialPolicy == ClientCredentialPolicy::CannotAskClientForCredentials);
 
     RELEASE_LOG_IF_ALLOWED(resourceLoader, "scheduleLoad: Resource is being scheduled with the NetworkProcess (frame = %p, priority = %d, pageID = %" PRIu64 ", frameID = %" PRIu64 ", resourceID = %" PRIu64 ")", resourceLoader.frame(), static_cast<int>(resourceLoader.request().priority()), loadParameters.webPageID, loadParameters.webFrameID, loadParameters.identifier);
-    if (!WebProcess::singleton().networkConnection().connection().send(Messages::NetworkConnectionToWebProcess::ScheduleResourceLoad(loadParameters), 0)) {
+    if (!WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::ScheduleResourceLoad(loadParameters), 0)) {
         RELEASE_LOG_ERROR_IF_ALLOWED(resourceLoader, "scheduleLoad: Unable to schedule resource with the NetworkProcess (frame = %p, priority = %d, pageID = %" PRIu64 ", frameID = %" PRIu64 ", resourceID = %" PRIu64 ")", resourceLoader.frame(), static_cast<int>(resourceLoader.request().priority()), loadParameters.webPageID, loadParameters.webFrameID, loadParameters.identifier);
         // We probably failed to schedule this load with the NetworkProcess because it had crashed.
         // This load will never succeed so we will schedule it to fail asynchronously.
@@ -343,7 +343,7 @@
     if (!loader)
         return;
 
-    WebProcess::singleton().networkConnection().connection().send(Messages::NetworkConnectionToWebProcess::RemoveLoadIdentifier(identifier), 0);
+    WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::RemoveLoadIdentifier(identifier), 0);
 
     // It's possible that this WebResourceLoader might be just about to message back to the NetworkProcess (e.g. ContinueWillSendRequest)
     // but there's no point in doing so anymore.
@@ -353,7 +353,7 @@
 void WebLoaderStrategy::setDefersLoading(ResourceLoader* resourceLoader, bool defers)
 {
     ResourceLoadIdentifier identifier = resourceLoader->identifier();
-    WebProcess::singleton().networkConnection().connection().send(Messages::NetworkConnectionToWebProcess::SetDefersLoading(identifier, defers), 0);
+    WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::SetDefersLoading(identifier, defers), 0);
 }
 
 void WebLoaderStrategy::crossOriginRedirectReceived(ResourceLoader*, const URL&)
@@ -422,7 +422,7 @@
 
     HangDetectionDisabler hangDetectionDisabler;
 
-    if (!WebProcess::singleton().networkConnection().connection().sendSync(Messages::NetworkConnectionToWebProcess::PerformSynchronousLoad(loadParameters), Messages::NetworkConnectionToWebProcess::PerformSynchronousLoad::Reply(error, response, data), 0)) {
+    if (!WebProcess::singleton().ensureNetworkProcessConnection().connection().sendSync(Messages::NetworkConnectionToWebProcess::PerformSynchronousLoad(loadParameters), Messages::NetworkConnectionToWebProcess::PerformSynchronousLoad::Reply(error, response, data), 0)) {
         RELEASE_LOG_ERROR_IF_ALLOWED(loadParameters.sessionID, "loadResourceSynchronously: failed sending synchronous network process message (pageID = %" PRIu64 ", frameID = %" PRIu64 ", resourceID = %" PRIu64 ")", loadParameters.webPageID, loadParameters.webFrameID, loadParameters.identifier);
         if (auto* page = webPage->corePage())
             page->diagnosticLoggingClient().logDiagnosticMessage(WebCore::DiagnosticLoggingKeys::internalErrorKey(), WebCore::DiagnosticLoggingKeys::synchronousMessageFailedKey(), WebCore::ShouldSample::No);
@@ -487,7 +487,7 @@
     if (completionHandler)
         m_pingLoadCompletionHandlers.add(loadParameters.identifier, WTFMove(completionHandler));
 
-    WebProcess::singleton().networkConnection().connection().send(Messages::NetworkConnectionToWebProcess::LoadPing(WTFMove(loadParameters), originalRequestHeaders), 0);
+    WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::LoadPing(WTFMove(loadParameters), originalRequestHeaders), 0);
 }
 
 void WebLoaderStrategy::didFinishPingLoad(uint64_t pingLoadIdentifier, ResourceError&& error, ResourceResponse&& response)
@@ -527,7 +527,7 @@
     parameters.storedCredentialsPolicy = storedCredentialsPolicy;
     parameters.shouldPreconnectOnly = PreconnectOnly::Yes;
 
-    WebProcess::singleton().networkConnection().connection().send(Messages::NetworkConnectionToWebProcess::PreconnectTo(preconnectionIdentifier, WTFMove(parameters)), 0);
+    WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::PreconnectTo(preconnectionIdentifier, WTFMove(parameters)), 0);
 }
 
 void WebLoaderStrategy::didFinishPreconnection(uint64_t preconnectionIdentifier, ResourceError&& error)
@@ -540,12 +540,12 @@
 {
     NetworkCache::DataKey key { partition, type, bodyHash };
     IPC::SharedBufferDataReference dataReference { &data };
-    WebProcess::singleton().networkConnection().connection().send(Messages::NetworkConnectionToWebProcess::StoreDerivedDataToCache(key, dataReference), 0);
+    WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::StoreDerivedDataToCache(key, dataReference), 0);
 }
 
 void WebLoaderStrategy::setCaptureExtraNetworkLoadMetricsEnabled(bool enabled)
 {
-    WebProcess::singleton().networkConnection().connection().send(Messages::NetworkConnectionToWebProcess::SetCaptureExtraNetworkLoadMetricsEnabled(enabled), 0);
+    WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::SetCaptureExtraNetworkLoadMetricsEnabled(enabled), 0);
 }
 
 } // namespace WebKit

Modified: trunk/Source/WebKit/WebProcess/Network/WebResourceLoader.cpp (225281 => 225282)


--- trunk/Source/WebKit/WebProcess/Network/WebResourceLoader.cpp	2017-11-29 19:22:24 UTC (rev 225281)
+++ trunk/Source/WebKit/WebProcess/Network/WebResourceLoader.cpp	2017-11-29 19:40:12 UTC (rev 225282)
@@ -68,7 +68,7 @@
 
 IPC::Connection* WebResourceLoader::messageSenderConnection()
 {
-    return &WebProcess::singleton().networkConnection().connection();
+    return &WebProcess::singleton().ensureNetworkProcessConnection().connection();
 }
 
 uint64_t WebResourceLoader::messageSenderDestinationID()

Modified: trunk/Source/WebKit/WebProcess/Network/WebSocketStream.cpp (225281 => 225282)


--- trunk/Source/WebKit/WebProcess/Network/WebSocketStream.cpp	2017-11-29 19:22:24 UTC (rev 225281)
+++ trunk/Source/WebKit/WebProcess/Network/WebSocketStream.cpp	2017-11-29 19:40:12 UTC (rev 225282)
@@ -72,7 +72,7 @@
     : SocketStreamHandle(url, client)
     , m_client(client)
 {
-    WebProcess::singleton().networkConnection().connection().send(Messages::NetworkConnectionToWebProcess::CreateSocketStream(url, sessionID, cachePartition, identifier()), 0);
+    WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::CreateSocketStream(url, sessionID, cachePartition, identifier()), 0);
 
     ASSERT(!globalWebSocketStreamMap().contains(identifier()));
     globalWebSocketStreamMap().set(identifier(), this);
@@ -86,7 +86,7 @@
 
 IPC::Connection* WebSocketStream::messageSenderConnection()
 {
-    return &WebProcess::singleton().networkConnection().connection();
+    return &WebProcess::singleton().ensureNetworkProcessConnection().connection();
 }
 
 uint64_t WebSocketStream::messageSenderDestinationID()

Modified: trunk/Source/WebKit/WebProcess/Network/webrtc/LibWebRTCResolver.cpp (225281 => 225282)


--- trunk/Source/WebKit/WebProcess/Network/webrtc/LibWebRTCResolver.cpp	2017-11-29 19:22:24 UTC (rev 225281)
+++ trunk/Source/WebKit/WebProcess/Network/webrtc/LibWebRTCResolver.cpp	2017-11-29 19:40:12 UTC (rev 225282)
@@ -39,7 +39,7 @@
 static inline void sendOnMainThread(Function<void(IPC::Connection&)>&& callback)
 {
     callOnMainThread([callback = WTFMove(callback)]() {
-        callback(WebProcess::singleton().networkConnection().connection());
+        callback(WebProcess::singleton().ensureNetworkProcessConnection().connection());
     });
 }
 

Modified: trunk/Source/WebKit/WebProcess/Network/webrtc/LibWebRTCSocket.cpp (225281 => 225282)


--- trunk/Source/WebKit/WebProcess/Network/webrtc/LibWebRTCSocket.cpp	2017-11-29 19:22:24 UTC (rev 225281)
+++ trunk/Source/WebKit/WebProcess/Network/webrtc/LibWebRTCSocket.cpp	2017-11-29 19:40:12 UTC (rev 225282)
@@ -43,7 +43,7 @@
 static inline void sendOnMainThread(Function<void(IPC::Connection&)>&& callback)
 {
     callOnMainThread([callback = WTFMove(callback)]() {
-        callback(WebProcess::singleton().networkConnection().connection());
+        callback(WebProcess::singleton().ensureNetworkProcessConnection().connection());
     });
 }
 

Modified: trunk/Source/WebKit/WebProcess/Network/webrtc/LibWebRTCSocketFactory.cpp (225281 => 225282)


--- trunk/Source/WebKit/WebProcess/Network/webrtc/LibWebRTCSocketFactory.cpp	2017-11-29 19:22:24 UTC (rev 225281)
+++ trunk/Source/WebKit/WebProcess/Network/webrtc/LibWebRTCSocketFactory.cpp	2017-11-29 19:40:12 UTC (rev 225282)
@@ -46,7 +46,7 @@
     m_sockets.set(socket->identifier(), socket.get());
 
     callOnMainThread([identifier = socket->identifier(), address = RTCNetwork::isolatedCopy(address), minPort, maxPort, options]() {
-        if (!WebProcess::singleton().networkConnection().connection().send(Messages::NetworkRTCProvider::CreateServerTCPSocket(identifier, RTCNetwork::SocketAddress(address), minPort, maxPort, options), 0)) {
+        if (!WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkRTCProvider::CreateServerTCPSocket(identifier, RTCNetwork::SocketAddress(address), minPort, maxPort, options), 0)) {
             // FIXME: Set error back to socket
             return;
         }
@@ -62,7 +62,7 @@
     m_sockets.set(socket->identifier(), socket.get());
 
     callOnMainThread([identifier = socket->identifier(), address = RTCNetwork::isolatedCopy(address), minPort, maxPort]() {
-        if (!WebProcess::singleton().networkConnection().connection().send(Messages::NetworkRTCProvider::CreateUDPSocket(identifier, RTCNetwork::SocketAddress(address), minPort, maxPort), 0)) {
+        if (!WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkRTCProvider::CreateUDPSocket(identifier, RTCNetwork::SocketAddress(address), minPort, maxPort), 0)) {
             // FIXME: Set error back to socket
             return;
         }
@@ -77,7 +77,7 @@
     m_sockets.set(socket->identifier(), socket.get());
 
     callOnMainThread([identifier = socket->identifier(), localAddress = RTCNetwork::isolatedCopy(localAddress), remoteAddress = RTCNetwork::isolatedCopy(remoteAddress), options]() {
-        if (!WebProcess::singleton().networkConnection().connection().send(Messages::NetworkRTCProvider::CreateClientTCPSocket(identifier, RTCNetwork::SocketAddress(localAddress), RTCNetwork::SocketAddress(remoteAddress), options), 0)) {
+        if (!WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkRTCProvider::CreateClientTCPSocket(identifier, RTCNetwork::SocketAddress(localAddress), RTCNetwork::SocketAddress(remoteAddress), options), 0)) {
             // FIXME: Set error back to socket
             return;
         }
@@ -93,7 +93,7 @@
     m_sockets.set(socket->identifier(), socket.get());
 
     callOnMainThread([identifier = socket->identifier(), newConnectionSocketIdentifier]() {
-        if (!WebProcess::singleton().networkConnection().connection().send(Messages::NetworkRTCProvider::WrapNewTCPConnection(identifier, newConnectionSocketIdentifier), 0)) {
+        if (!WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkRTCProvider::WrapNewTCPConnection(identifier, newConnectionSocketIdentifier), 0)) {
             // FIXME: Set error back to socket
             return;
         }

Modified: trunk/Source/WebKit/WebProcess/Network/webrtc/WebRTCMonitor.cpp (225281 => 225282)


--- trunk/Source/WebKit/WebProcess/Network/webrtc/WebRTCMonitor.cpp	2017-11-29 19:22:24 UTC (rev 225281)
+++ trunk/Source/WebKit/WebProcess/Network/webrtc/WebRTCMonitor.cpp	2017-11-29 19:40:12 UTC (rev 225282)
@@ -41,7 +41,7 @@
 static inline void sendOnMainThread(Function<void(IPC::Connection&)>&& callback)
 {
     callOnMainThread([callback = WTFMove(callback)]() {
-        callback(WebProcess::singleton().networkConnection().connection());
+        callback(WebProcess::singleton().ensureNetworkProcessConnection().connection());
     });
 }
 

Modified: trunk/Source/WebKit/WebProcess/Storage/WebServiceWorkerProvider.cpp (225281 => 225282)


--- trunk/Source/WebKit/WebProcess/Storage/WebServiceWorkerProvider.cpp	2017-11-29 19:22:24 UTC (rev 225281)
+++ trunk/Source/WebKit/WebProcess/Storage/WebServiceWorkerProvider.cpp	2017-11-29 19:40:12 UTC (rev 225282)
@@ -55,8 +55,7 @@
 
 WebCore::SWClientConnection& WebServiceWorkerProvider::serviceWorkerConnectionForSession(SessionID sessionID)
 {
-    ASSERT(WebProcess::singleton().webToStorageProcessConnection());
-    return WebProcess::singleton().webToStorageProcessConnection()->serviceWorkerConnectionForSession(sessionID);
+    return WebProcess::singleton().ensureWebToStorageProcessConnection().serviceWorkerConnectionForSession(sessionID);
 }
 
 static inline bool shouldHandleFetch(const ResourceLoaderOptions& options)
@@ -77,7 +76,7 @@
         return;
     }
 
-    auto& connection = WebProcess::singleton().webToStorageProcessConnection()->serviceWorkerConnectionForSession(sessionID);
+    auto& connection = WebProcess::singleton().ensureWebToStorageProcessConnection().serviceWorkerConnectionForSession(sessionID);
     auto fetch = connection.startFetch(*this, loader, loader.identifier(), WTFMove(callback));
     ASSERT(fetch->isOngoing());
 

Modified: trunk/Source/WebKit/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp (225281 => 225282)


--- trunk/Source/WebKit/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp	2017-11-29 19:22:24 UTC (rev 225281)
+++ trunk/Source/WebKit/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp	2017-11-29 19:40:12 UTC (rev 225282)
@@ -113,7 +113,7 @@
 {
     String cookieString;
     bool secureCookiesAccessed = false;
-    if (!WebProcess::singleton().networkConnection().connection().sendSync(Messages::NetworkConnectionToWebProcess::CookiesForDOM(session.sessionID(), firstParty, url, includeSecureCookies), Messages::NetworkConnectionToWebProcess::CookiesForDOM::Reply(cookieString, secureCookiesAccessed), 0))
+    if (!WebProcess::singleton().ensureNetworkProcessConnection().connection().sendSync(Messages::NetworkConnectionToWebProcess::CookiesForDOM(session.sessionID(), firstParty, url, includeSecureCookies), Messages::NetworkConnectionToWebProcess::CookiesForDOM::Reply(cookieString, secureCookiesAccessed), 0))
         return { String(), false };
 
     return { cookieString, secureCookiesAccessed };
@@ -121,13 +121,13 @@
 
 void WebPlatformStrategies::setCookiesFromDOM(const NetworkStorageSession& session, const URL& firstParty, const URL& url, const String& cookieString)
 {
-    WebProcess::singleton().networkConnection().connection().send(Messages::NetworkConnectionToWebProcess::SetCookiesFromDOM(session.sessionID(), firstParty, url, cookieString), 0);
+    WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::SetCookiesFromDOM(session.sessionID(), firstParty, url, cookieString), 0);
 }
 
 bool WebPlatformStrategies::cookiesEnabled(const NetworkStorageSession& session)
 {
     bool result;
-    if (!WebProcess::singleton().networkConnection().connection().sendSync(Messages::NetworkConnectionToWebProcess::CookiesEnabled(session.sessionID()), Messages::NetworkConnectionToWebProcess::CookiesEnabled::Reply(result), 0))
+    if (!WebProcess::singleton().ensureNetworkProcessConnection().connection().sendSync(Messages::NetworkConnectionToWebProcess::CookiesEnabled(session.sessionID()), Messages::NetworkConnectionToWebProcess::CookiesEnabled::Reply(result), 0))
         return false;
     return result;
 }
@@ -141,7 +141,7 @@
 {
     String cookieString;
     bool secureCookiesAccessed = false;
-    if (!WebProcess::singleton().networkConnection().connection().sendSync(Messages::NetworkConnectionToWebProcess::CookieRequestHeaderFieldValue(sessionID, firstParty, url, includeSecureCookies), Messages::NetworkConnectionToWebProcess::CookieRequestHeaderFieldValue::Reply(cookieString, secureCookiesAccessed), 0))
+    if (!WebProcess::singleton().ensureNetworkProcessConnection().connection().sendSync(Messages::NetworkConnectionToWebProcess::CookieRequestHeaderFieldValue(sessionID, firstParty, url, includeSecureCookies), Messages::NetworkConnectionToWebProcess::CookieRequestHeaderFieldValue::Reply(cookieString, secureCookiesAccessed), 0))
         return { String(), false };
     return { cookieString, secureCookiesAccessed };
 }
@@ -148,7 +148,7 @@
 
 bool WebPlatformStrategies::getRawCookies(const NetworkStorageSession& session, const URL& firstParty, const URL& url, Vector<Cookie>& rawCookies)
 {
-    if (!WebProcess::singleton().networkConnection().connection().sendSync(Messages::NetworkConnectionToWebProcess::GetRawCookies(session.sessionID(), firstParty, url), Messages::NetworkConnectionToWebProcess::GetRawCookies::Reply(rawCookies), 0))
+    if (!WebProcess::singleton().ensureNetworkProcessConnection().connection().sendSync(Messages::NetworkConnectionToWebProcess::GetRawCookies(session.sessionID(), firstParty, url), Messages::NetworkConnectionToWebProcess::GetRawCookies::Reply(rawCookies), 0))
         return false;
     return true;
 }
@@ -155,7 +155,7 @@
 
 void WebPlatformStrategies::deleteCookie(const NetworkStorageSession& session, const URL& url, const String& cookieName)
 {
-    WebProcess::singleton().networkConnection().connection().send(Messages::NetworkConnectionToWebProcess::DeleteCookie(session.sessionID(), url, cookieName), 0);
+    WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::DeleteCookie(session.sessionID(), url, cookieName), 0);
 }
 
 #if PLATFORM(COCOA)

Modified: trunk/Source/WebKit/WebProcess/WebPage/WebFrame.cpp (225281 => 225282)


--- trunk/Source/WebKit/WebProcess/WebPage/WebFrame.cpp	2017-11-29 19:22:24 UTC (rev 225281)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebFrame.cpp	2017-11-29 19:40:12 UTC (rev 225282)
@@ -291,7 +291,7 @@
 
     auto& webProcess = WebProcess::singleton();
     PAL::SessionID sessionID = page() ? page()->sessionID() : PAL::SessionID::defaultSessionID();
-    webProcess.networkConnection().connection().send(Messages::NetworkConnectionToWebProcess::StartDownload(sessionID, policyDownloadID, request, suggestedName), 0);
+    webProcess.ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::StartDownload(sessionID, policyDownloadID, request, suggestedName), 0);
 }
 
 void WebFrame::convertMainResourceLoadToDownload(DocumentLoader* documentLoader, PAL::SessionID sessionID, const ResourceRequest& request, const ResourceResponse& response)
@@ -313,7 +313,7 @@
     else
         mainResourceLoadIdentifier = 0;
 
-    webProcess.networkConnection().connection().send(Messages::NetworkConnectionToWebProcess::ConvertMainResourceLoadToDownload(sessionID, mainResourceLoadIdentifier, policyDownloadID, request, response), 0);
+    webProcess.ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::ConvertMainResourceLoadToDownload(sessionID, mainResourceLoadIdentifier, policyDownloadID, request, response), 0);
 }
 
 String WebFrame::source() const

Modified: trunk/Source/WebKit/WebProcess/WebProcess.cpp (225281 => 225282)


--- trunk/Source/WebKit/WebProcess/WebProcess.cpp	2017-11-29 19:22:24 UTC (rev 225281)
+++ trunk/Source/WebKit/WebProcess/WebProcess.cpp	2017-11-29 19:40:12 UTC (rev 225282)
@@ -417,29 +417,6 @@
 #endif
 }
 
-void WebProcess::ensureNetworkProcessConnection()
-{
-    if (m_networkProcessConnection)
-        return;
-
-    IPC::Attachment encodedConnectionIdentifier;
-
-    if (!parentProcessConnection()->sendSync(Messages::WebProcessProxy::GetNetworkProcessConnection(),
-        Messages::WebProcessProxy::GetNetworkProcessConnection::Reply(encodedConnectionIdentifier), 0))
-        return;
-
-#if USE(UNIX_DOMAIN_SOCKETS)
-    IPC::Connection::Identifier connectionIdentifier = encodedConnectionIdentifier.releaseFileDescriptor();
-#elif OS(DARWIN)
-    IPC::Connection::Identifier connectionIdentifier(encodedConnectionIdentifier.port());
-#else
-    ASSERT_NOT_REACHED();
-#endif
-    if (IPC::Connection::identifierIsNull(connectionIdentifier))
-        return;
-    m_networkProcessConnection = NetworkProcessConnection::create(connectionIdentifier);
-}
-
 void WebProcess::registerURLSchemeAsEmptyDocument(const String& urlScheme)
 {
     SchemeRegistry::registerURLSchemeAsEmptyDocument(urlScheme);
@@ -527,7 +504,7 @@
 
 void WebProcess::ensureLegacyPrivateBrowsingSessionInNetworkProcess()
 {
-    networkConnection().connection().send(Messages::NetworkConnectionToWebProcess::EnsureLegacyPrivateBrowsingSession(), 0);
+    ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::EnsureLegacyPrivateBrowsingSession(), 0);
 }
 
 #if ENABLE(NETSCAPE_PLUGIN_API)
@@ -1109,16 +1086,27 @@
     injectedBundle->setBundleParameters(value);
 }
 
-NetworkProcessConnection& WebProcess::networkConnection()
+NetworkProcessConnection& WebProcess::ensureNetworkProcessConnection()
 {
     // If we've lost our connection to the network process (e.g. it crashed) try to re-establish it.
-    if (!m_networkProcessConnection)
-        ensureNetworkProcessConnection();
+    if (!m_networkProcessConnection) {
+        IPC::Attachment encodedConnectionIdentifier;
+
+        if (!parentProcessConnection()->sendSync(Messages::WebProcessProxy::GetNetworkProcessConnection(), Messages::WebProcessProxy::GetNetworkProcessConnection::Reply(encodedConnectionIdentifier), 0))
+            CRASH();
+
+#if USE(UNIX_DOMAIN_SOCKETS)
+        IPC::Connection::Identifier connectionIdentifier = encodedConnectionIdentifier.releaseFileDescriptor();
+#elif OS(DARWIN)
+        IPC::Connection::Identifier connectionIdentifier(encodedConnectionIdentifier.port());
+#else
+        ASSERT_NOT_REACHED();
+#endif
+        if (IPC::Connection::identifierIsNull(connectionIdentifier))
+            CRASH();
+        m_networkProcessConnection = NetworkProcessConnection::create(connectionIdentifier);
+    }
     
-    // If we failed to re-establish it then we are beyond recovery and should crash.
-    if (!m_networkProcessConnection)
-        CRASH();
-    
     return *m_networkProcessConnection;
 }
 
@@ -1171,36 +1159,29 @@
     m_webToStorageProcessConnection = nullptr;
 }
 
-WebToStorageProcessConnection* WebProcess::webToStorageProcessConnection()
+WebToStorageProcessConnection& WebProcess::ensureWebToStorageProcessConnection()
 {
-    if (!m_webToStorageProcessConnection)
-        ensureWebToStorageProcessConnection();
+    if (!m_webToStorageProcessConnection) {
+        IPC::Attachment encodedConnectionIdentifier;
 
-    return m_webToStorageProcessConnection.get();
-}
+        if (!parentProcessConnection()->sendSync(Messages::WebProcessProxy::GetStorageProcessConnection(), Messages::WebProcessProxy::GetStorageProcessConnection::Reply(encodedConnectionIdentifier), 0))
+            CRASH();
 
-void WebProcess::ensureWebToStorageProcessConnection()
-{
-    if (m_webToStorageProcessConnection)
-        return;
-
-    IPC::Attachment encodedConnectionIdentifier;
-
-    if (!parentProcessConnection()->sendSync(Messages::WebProcessProxy::GetStorageProcessConnection(), Messages::WebProcessProxy::GetStorageProcessConnection::Reply(encodedConnectionIdentifier), 0))
-        return;
-
 #if USE(UNIX_DOMAIN_SOCKETS)
-    IPC::Connection::Identifier connectionIdentifier = encodedConnectionIdentifier.releaseFileDescriptor();
+        IPC::Connection::Identifier connectionIdentifier = encodedConnectionIdentifier.releaseFileDescriptor();
 #elif OS(DARWIN)
-    IPC::Connection::Identifier connectionIdentifier(encodedConnectionIdentifier.port());
+        IPC::Connection::Identifier connectionIdentifier(encodedConnectionIdentifier.port());
 #elif OS(WINDOWS)
-    IPC::Connection::Identifier connectionIdentifier(encodedConnectionIdentifier.handle());
+        IPC::Connection::Identifier connectionIdentifier(encodedConnectionIdentifier.handle());
 #else
-    ASSERT_NOT_REACHED();
+        ASSERT_NOT_REACHED();
 #endif
-    if (IPC::Connection::identifierIsNull(connectionIdentifier))
-        return;
-    m_webToStorageProcessConnection = WebToStorageProcessConnection::create(connectionIdentifier);
+        if (IPC::Connection::identifierIsNull(connectionIdentifier))
+            CRASH();
+        m_webToStorageProcessConnection = WebToStorageProcessConnection::create(connectionIdentifier);
+
+    }
+    return *m_webToStorageProcessConnection;
 }
 
 void WebProcess::setEnhancedAccessibility(bool flag)
@@ -1609,7 +1590,7 @@
         return;
 
     if (m_dnsPrefetchedHosts.add(hostname).isNewEntry)
-        networkConnection().connection().send(Messages::NetworkConnectionToWebProcess::PrefetchDNS(hostname), 0);
+        ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::PrefetchDNS(hostname), 0);
     // The DNS prefetched hosts cache is only to avoid asking for the same hosts too many times
     // in a very short period of time, producing a lot of IPC traffic. So we clear this cache after
     // some time of no DNS requests.

Modified: trunk/Source/WebKit/WebProcess/WebProcess.h (225281 => 225282)


--- trunk/Source/WebKit/WebProcess/WebProcess.h	2017-11-29 19:22:24 UTC (rev 225281)
+++ trunk/Source/WebKit/WebProcess/WebProcess.h	2017-11-29 19:40:12 UTC (rev 225282)
@@ -165,7 +165,7 @@
 
     EventDispatcher& eventDispatcher() { return *m_eventDispatcher; }
 
-    NetworkProcessConnection& networkConnection();
+    NetworkProcessConnection& ensureNetworkProcessConnection();
     void networkProcessConnectionClosed(NetworkProcessConnection*);
     WebLoaderStrategy& webLoaderStrategy();
 
@@ -174,7 +174,7 @@
 #endif
 
     void webToStorageProcessConnectionClosed(WebToStorageProcessConnection*);
-    WebToStorageProcessConnection* webToStorageProcessConnection();
+    WebToStorageProcessConnection& ensureWebToStorageProcessConnection();
 
     void setCacheModel(uint32_t);
 
@@ -383,7 +383,6 @@
 
     TextCheckerState m_textCheckerState;
 
-    void ensureNetworkProcessConnection();
     RefPtr<NetworkProcessConnection> m_networkProcessConnection;
     WebLoaderStrategy& m_webLoaderStrategy;
 
@@ -398,7 +397,6 @@
 
     std::unique_ptr<WebAutomationSessionProxy> m_automationSessionProxy;
 
-    void ensureWebToStorageProcessConnection();
     RefPtr<WebToStorageProcessConnection> m_webToStorageProcessConnection;
 
 #if ENABLE(NETSCAPE_PLUGIN_API)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to