<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[225282] trunk/Source/WebKit</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/225282">225282</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2017-11-29 11:40:12 -0800 (Wed, 29 Nov 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>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:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKitChangeLog">trunk/Source/WebKit/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitSharedmacCookieStorageShimmm">trunk/Source/WebKit/Shared/mac/CookieStorageShim.mm</a></li>
<li><a href="#trunkSourceWebKitWebProcessCacheWebCacheStorageConnectioncpp">trunk/Source/WebKit/WebProcess/Cache/WebCacheStorageConnection.cpp</a></li>
<li><a href="#trunkSourceWebKitWebProcessDatabasesIndexedDBWebIDBConnectionToServercpp">trunk/Source/WebKit/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp</a></li>
<li><a href="#trunkSourceWebKitWebProcessDatabasesWebDatabaseProvidercpp">trunk/Source/WebKit/WebProcess/Databases/WebDatabaseProvider.cpp</a></li>
<li><a href="#trunkSourceWebKitWebProcessFileAPIBlobRegistryProxycpp">trunk/Source/WebKit/WebProcess/FileAPI/BlobRegistryProxy.cpp</a></li>
<li><a href="#trunkSourceWebKitWebProcessNetworkNetworkProcessConnectioncpp">trunk/Source/WebKit/WebProcess/Network/NetworkProcessConnection.cpp</a></li>
<li><a href="#trunkSourceWebKitWebProcessNetworkWebLoaderStrategycpp">trunk/Source/WebKit/WebProcess/Network/WebLoaderStrategy.cpp</a></li>
<li><a href="#trunkSourceWebKitWebProcessNetworkWebResourceLoadercpp">trunk/Source/WebKit/WebProcess/Network/WebResourceLoader.cpp</a></li>
<li><a href="#trunkSourceWebKitWebProcessNetworkWebSocketStreamcpp">trunk/Source/WebKit/WebProcess/Network/WebSocketStream.cpp</a></li>
<li><a href="#trunkSourceWebKitWebProcessNetworkwebrtcLibWebRTCResolvercpp">trunk/Source/WebKit/WebProcess/Network/webrtc/LibWebRTCResolver.cpp</a></li>
<li><a href="#trunkSourceWebKitWebProcessNetworkwebrtcLibWebRTCSocketcpp">trunk/Source/WebKit/WebProcess/Network/webrtc/LibWebRTCSocket.cpp</a></li>
<li><a href="#trunkSourceWebKitWebProcessNetworkwebrtcLibWebRTCSocketFactorycpp">trunk/Source/WebKit/WebProcess/Network/webrtc/LibWebRTCSocketFactory.cpp</a></li>
<li><a href="#trunkSourceWebKitWebProcessNetworkwebrtcWebRTCMonitorcpp">trunk/Source/WebKit/WebProcess/Network/webrtc/WebRTCMonitor.cpp</a></li>
<li><a href="#trunkSourceWebKitWebProcessStorageWebServiceWorkerProvidercpp">trunk/Source/WebKit/WebProcess/Storage/WebServiceWorkerProvider.cpp</a></li>
<li><a href="#trunkSourceWebKitWebProcessWebCoreSupportWebPlatformStrategiescpp">trunk/Source/WebKit/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp</a></li>
<li><a href="#trunkSourceWebKitWebProcessWebPageWebFramecpp">trunk/Source/WebKit/WebProcess/WebPage/WebFrame.cpp</a></li>
<li><a href="#trunkSourceWebKitWebProcessWebProcesscpp">trunk/Source/WebKit/WebProcess/WebProcess.cpp</a></li>
<li><a href="#trunkSourceWebKitWebProcessWebProcessh">trunk/Source/WebKit/WebProcess/WebProcess.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ChangeLog (225281 => 225282)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -1,3 +1,78 @@
</span><ins>+2017-11-29  Chris Dumez  <cdumez@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:
+
</ins><span class="cx"> 2017-11-29  Alex Christensen  <achristensen@webkit.org>
</span><span class="cx"> 
</span><span class="cx">         Modernize API::SerializedScriptValue
</span></span></pre></div>
<a id="trunkSourceWebKitSharedmacCookieStorageShimmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Shared/mac/CookieStorageShim.mm (225281 => 225282)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -61,7 +61,7 @@
</span><span class="cx">     String cookies;
</span><span class="cx">     bool secureCookiesAccessed = false;
</span><span class="cx">     URL firstPartyForCookiesURL;
</span><del>-    if (!WebProcess::singleton().networkConnection().connection().sendSync(Messages::NetworkConnectionToWebProcess::CookieRequestHeaderFieldValue(PAL::SessionID::defaultSessionID(), firstPartyForCookiesURL, inRequestURL, includeSecureCookies), Messages::NetworkConnectionToWebProcess::CookieRequestHeaderFieldValue::Reply(cookies, secureCookiesAccessed), 0))
</del><ins>+    if (!WebProcess::singleton().ensureNetworkProcessConnection().connection().sendSync(Messages::NetworkConnectionToWebProcess::CookieRequestHeaderFieldValue(PAL::SessionID::defaultSessionID(), firstPartyForCookiesURL, inRequestURL, includeSecureCookies), Messages::NetworkConnectionToWebProcess::CookieRequestHeaderFieldValue::Reply(cookies, secureCookiesAccessed), 0))
</ins><span class="cx">         return 0;
</span><span class="cx"> 
</span><span class="cx">     if (cookies.isNull())
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessCacheWebCacheStorageConnectioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/Cache/WebCacheStorageConnection.cpp (225281 => 225282)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -53,7 +53,7 @@
</span><span class="cx"> 
</span><span class="cx"> IPC::Connection& WebCacheStorageConnection::connection()
</span><span class="cx"> {
</span><del>-    return WebProcess::singleton().networkConnection().connection();
</del><ins>+    return WebProcess::singleton().ensureNetworkProcessConnection().connection();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebCacheStorageConnection::doOpen(uint64_t requestIdentifier, const String& origin, const String& cacheName)
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessDatabasesIndexedDBWebIDBConnectionToServercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp (225281 => 225282)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -79,7 +79,7 @@
</span><span class="cx"> 
</span><span class="cx"> IPC::Connection* WebIDBConnectionToServer::messageSenderConnection()
</span><span class="cx"> {
</span><del>-    return &WebProcess::singleton().webToStorageProcessConnection()->connection();
</del><ins>+    return &WebProcess::singleton().ensureWebToStorageProcessConnection().connection();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> IDBClient::IDBConnectionToServer& WebIDBConnectionToServer::coreConnectionToServer()
</span><span class="lines">@@ -297,7 +297,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     if (!filePaths.isEmpty())
</span><del>-        WebProcess::singleton().networkConnection().connection().send(Messages::NetworkConnectionToWebProcess::PreregisterSandboxExtensionsForOptionallyFileBackedBlob(filePaths, result.handles()), 0);
</del><ins>+        WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::PreregisterSandboxExtensionsForOptionallyFileBackedBlob(filePaths, result.handles()), 0);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebIDBConnectionToServer::didGetRecord(const WebIDBResult& result)
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessDatabasesWebDatabaseProvidercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/Databases/WebDatabaseProvider.cpp (225281 => 225282)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -79,8 +79,7 @@
</span><span class="cx">         return result.iterator->value->connectionToServer();
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    ASSERT(WebProcess::singleton().webToStorageProcessConnection());
-    return WebProcess::singleton().webToStorageProcessConnection()->idbConnectionToServerForSession(sessionID).coreConnectionToServer();
</del><ins>+    return WebProcess::singleton().ensureWebToStorageProcessConnection().idbConnectionToServerForSession(sessionID).coreConnectionToServer();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessFileAPIBlobRegistryProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/FileAPI/BlobRegistryProxy.cpp (225281 => 225282)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -44,39 +44,39 @@
</span><span class="cx">     if (!file->path().isEmpty())
</span><span class="cx">         SandboxExtension::createHandle(file->path(), SandboxExtension::Type::ReadOnly, extensionHandle);
</span><span class="cx"> 
</span><del>-    WebProcess::singleton().networkConnection().connection().send(Messages::NetworkConnectionToWebProcess::RegisterFileBlobURL(url, file->path(), extensionHandle, contentType), 0);
</del><ins>+    WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::RegisterFileBlobURL(url, file->path(), extensionHandle, contentType), 0);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void BlobRegistryProxy::registerBlobURL(const URL& url, Vector<BlobPart>&& blobParts, const String& contentType)
</span><span class="cx"> {
</span><del>-    WebProcess::singleton().networkConnection().connection().send(Messages::NetworkConnectionToWebProcess::RegisterBlobURL(url, blobParts, contentType), 0);
</del><ins>+    WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::RegisterBlobURL(url, blobParts, contentType), 0);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void BlobRegistryProxy::registerBlobURL(const URL& url, const URL& srcURL)
</span><span class="cx"> {
</span><del>-    WebProcess::singleton().networkConnection().connection().send(Messages::NetworkConnectionToWebProcess::RegisterBlobURLFromURL(url, srcURL), 0);
</del><ins>+    WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::RegisterBlobURLFromURL(url, srcURL), 0);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void BlobRegistryProxy::registerBlobURLOptionallyFileBacked(const URL& url, const URL& srcURL, RefPtr<WebCore::BlobDataFileReference>&& file, const String& contentType)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(file);
</span><del>-    WebProcess::singleton().networkConnection().connection().send(Messages::NetworkConnectionToWebProcess::RegisterBlobURLOptionallyFileBacked(url, srcURL, file->path(), contentType), 0);
</del><ins>+    WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::RegisterBlobURLOptionallyFileBacked(url, srcURL, file->path(), contentType), 0);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void BlobRegistryProxy::unregisterBlobURL(const URL& url)
</span><span class="cx"> {
</span><del>-    WebProcess::singleton().networkConnection().connection().send(Messages::NetworkConnectionToWebProcess::UnregisterBlobURL(url), 0);
</del><ins>+    WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::UnregisterBlobURL(url), 0);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void BlobRegistryProxy::registerBlobURLForSlice(const URL& url, const URL& srcURL, long long start, long long end)
</span><span class="cx"> {
</span><del>-    WebProcess::singleton().networkConnection().connection().send(Messages::NetworkConnectionToWebProcess::RegisterBlobURLForSlice(url, srcURL, start, end), 0);
</del><ins>+    WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::RegisterBlobURLForSlice(url, srcURL, start, end), 0);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> unsigned long long BlobRegistryProxy::blobSize(const URL& url)
</span><span class="cx"> {
</span><span class="cx">     uint64_t resultSize;
</span><del>-    if (!WebProcess::singleton().networkConnection().connection().sendSync(Messages::NetworkConnectionToWebProcess::BlobSize(url), Messages::NetworkConnectionToWebProcess::BlobSize::Reply(resultSize), 0))
</del><ins>+    if (!WebProcess::singleton().ensureNetworkProcessConnection().connection().sendSync(Messages::NetworkConnectionToWebProcess::BlobSize(url), Messages::NetworkConnectionToWebProcess::BlobSize::Reply(resultSize), 0))
</ins><span class="cx">         return 0;
</span><span class="cx">     return resultSize;
</span><span class="cx"> }
</span><span class="lines">@@ -83,7 +83,7 @@
</span><span class="cx"> 
</span><span class="cx"> void BlobRegistryProxy::writeBlobsToTemporaryFiles(const Vector<String>& blobURLs, Function<void (const Vector<String>& filePaths)>&& completionHandler)
</span><span class="cx"> {
</span><del>-    WebProcess::singleton().networkConnection().writeBlobsToTemporaryFiles(blobURLs, WTFMove(completionHandler));
</del><ins>+    WebProcess::singleton().ensureNetworkProcessConnection().writeBlobsToTemporaryFiles(blobURLs, WTFMove(completionHandler));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessNetworkNetworkProcessConnectioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/Network/NetworkProcessConnection.cpp (225281 => 225282)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -126,7 +126,7 @@
</span><span class="cx"> 
</span><span class="cx">     m_writeBlobToFileCompletionHandlers.set(requestIdentifier, WTFMove(completionHandler));
</span><span class="cx"> 
</span><del>-    WebProcess::singleton().networkConnection().connection().send(Messages::NetworkConnectionToWebProcess::WriteBlobsToTemporaryFiles(blobURLs, requestIdentifier), 0);
</del><ins>+    WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::WriteBlobsToTemporaryFiles(blobURLs, requestIdentifier), 0);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void NetworkProcessConnection::didWriteBlobsToTemporaryFiles(uint64_t requestIdentifier, const Vector<String>& filenames)
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessNetworkWebLoaderStrategycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/Network/WebLoaderStrategy.cpp (225281 => 225282)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -271,7 +271,7 @@
</span><span class="cx">     ASSERT((loadParameters.webPageID && loadParameters.webFrameID) || loadParameters.clientCredentialPolicy == ClientCredentialPolicy::CannotAskClientForCredentials);
</span><span class="cx"> 
</span><span class="cx">     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);
</span><del>-    if (!WebProcess::singleton().networkConnection().connection().send(Messages::NetworkConnectionToWebProcess::ScheduleResourceLoad(loadParameters), 0)) {
</del><ins>+    if (!WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::ScheduleResourceLoad(loadParameters), 0)) {
</ins><span class="cx">         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);
</span><span class="cx">         // We probably failed to schedule this load with the NetworkProcess because it had crashed.
</span><span class="cx">         // This load will never succeed so we will schedule it to fail asynchronously.
</span><span class="lines">@@ -343,7 +343,7 @@
</span><span class="cx">     if (!loader)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    WebProcess::singleton().networkConnection().connection().send(Messages::NetworkConnectionToWebProcess::RemoveLoadIdentifier(identifier), 0);
</del><ins>+    WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::RemoveLoadIdentifier(identifier), 0);
</ins><span class="cx"> 
</span><span class="cx">     // It's possible that this WebResourceLoader might be just about to message back to the NetworkProcess (e.g. ContinueWillSendRequest)
</span><span class="cx">     // but there's no point in doing so anymore.
</span><span class="lines">@@ -353,7 +353,7 @@
</span><span class="cx"> void WebLoaderStrategy::setDefersLoading(ResourceLoader* resourceLoader, bool defers)
</span><span class="cx"> {
</span><span class="cx">     ResourceLoadIdentifier identifier = resourceLoader->identifier();
</span><del>-    WebProcess::singleton().networkConnection().connection().send(Messages::NetworkConnectionToWebProcess::SetDefersLoading(identifier, defers), 0);
</del><ins>+    WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::SetDefersLoading(identifier, defers), 0);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebLoaderStrategy::crossOriginRedirectReceived(ResourceLoader*, const URL&)
</span><span class="lines">@@ -422,7 +422,7 @@
</span><span class="cx"> 
</span><span class="cx">     HangDetectionDisabler hangDetectionDisabler;
</span><span class="cx"> 
</span><del>-    if (!WebProcess::singleton().networkConnection().connection().sendSync(Messages::NetworkConnectionToWebProcess::PerformSynchronousLoad(loadParameters), Messages::NetworkConnectionToWebProcess::PerformSynchronousLoad::Reply(error, response, data), 0)) {
</del><ins>+    if (!WebProcess::singleton().ensureNetworkProcessConnection().connection().sendSync(Messages::NetworkConnectionToWebProcess::PerformSynchronousLoad(loadParameters), Messages::NetworkConnectionToWebProcess::PerformSynchronousLoad::Reply(error, response, data), 0)) {
</ins><span class="cx">         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);
</span><span class="cx">         if (auto* page = webPage->corePage())
</span><span class="cx">             page->diagnosticLoggingClient().logDiagnosticMessage(WebCore::DiagnosticLoggingKeys::internalErrorKey(), WebCore::DiagnosticLoggingKeys::synchronousMessageFailedKey(), WebCore::ShouldSample::No);
</span><span class="lines">@@ -487,7 +487,7 @@
</span><span class="cx">     if (completionHandler)
</span><span class="cx">         m_pingLoadCompletionHandlers.add(loadParameters.identifier, WTFMove(completionHandler));
</span><span class="cx"> 
</span><del>-    WebProcess::singleton().networkConnection().connection().send(Messages::NetworkConnectionToWebProcess::LoadPing(WTFMove(loadParameters), originalRequestHeaders), 0);
</del><ins>+    WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::LoadPing(WTFMove(loadParameters), originalRequestHeaders), 0);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebLoaderStrategy::didFinishPingLoad(uint64_t pingLoadIdentifier, ResourceError&& error, ResourceResponse&& response)
</span><span class="lines">@@ -527,7 +527,7 @@
</span><span class="cx">     parameters.storedCredentialsPolicy = storedCredentialsPolicy;
</span><span class="cx">     parameters.shouldPreconnectOnly = PreconnectOnly::Yes;
</span><span class="cx"> 
</span><del>-    WebProcess::singleton().networkConnection().connection().send(Messages::NetworkConnectionToWebProcess::PreconnectTo(preconnectionIdentifier, WTFMove(parameters)), 0);
</del><ins>+    WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::PreconnectTo(preconnectionIdentifier, WTFMove(parameters)), 0);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebLoaderStrategy::didFinishPreconnection(uint64_t preconnectionIdentifier, ResourceError&& error)
</span><span class="lines">@@ -540,12 +540,12 @@
</span><span class="cx"> {
</span><span class="cx">     NetworkCache::DataKey key { partition, type, bodyHash };
</span><span class="cx">     IPC::SharedBufferDataReference dataReference { &data };
</span><del>-    WebProcess::singleton().networkConnection().connection().send(Messages::NetworkConnectionToWebProcess::StoreDerivedDataToCache(key, dataReference), 0);
</del><ins>+    WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::StoreDerivedDataToCache(key, dataReference), 0);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebLoaderStrategy::setCaptureExtraNetworkLoadMetricsEnabled(bool enabled)
</span><span class="cx"> {
</span><del>-    WebProcess::singleton().networkConnection().connection().send(Messages::NetworkConnectionToWebProcess::SetCaptureExtraNetworkLoadMetricsEnabled(enabled), 0);
</del><ins>+    WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::SetCaptureExtraNetworkLoadMetricsEnabled(enabled), 0);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessNetworkWebResourceLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/Network/WebResourceLoader.cpp (225281 => 225282)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -68,7 +68,7 @@
</span><span class="cx"> 
</span><span class="cx"> IPC::Connection* WebResourceLoader::messageSenderConnection()
</span><span class="cx"> {
</span><del>-    return &WebProcess::singleton().networkConnection().connection();
</del><ins>+    return &WebProcess::singleton().ensureNetworkProcessConnection().connection();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> uint64_t WebResourceLoader::messageSenderDestinationID()
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessNetworkWebSocketStreamcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/Network/WebSocketStream.cpp (225281 => 225282)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -72,7 +72,7 @@
</span><span class="cx">     : SocketStreamHandle(url, client)
</span><span class="cx">     , m_client(client)
</span><span class="cx"> {
</span><del>-    WebProcess::singleton().networkConnection().connection().send(Messages::NetworkConnectionToWebProcess::CreateSocketStream(url, sessionID, cachePartition, identifier()), 0);
</del><ins>+    WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::CreateSocketStream(url, sessionID, cachePartition, identifier()), 0);
</ins><span class="cx"> 
</span><span class="cx">     ASSERT(!globalWebSocketStreamMap().contains(identifier()));
</span><span class="cx">     globalWebSocketStreamMap().set(identifier(), this);
</span><span class="lines">@@ -86,7 +86,7 @@
</span><span class="cx"> 
</span><span class="cx"> IPC::Connection* WebSocketStream::messageSenderConnection()
</span><span class="cx"> {
</span><del>-    return &WebProcess::singleton().networkConnection().connection();
</del><ins>+    return &WebProcess::singleton().ensureNetworkProcessConnection().connection();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> uint64_t WebSocketStream::messageSenderDestinationID()
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessNetworkwebrtcLibWebRTCResolvercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/Network/webrtc/LibWebRTCResolver.cpp (225281 => 225282)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -39,7 +39,7 @@
</span><span class="cx"> static inline void sendOnMainThread(Function<void(IPC::Connection&)>&& callback)
</span><span class="cx"> {
</span><span class="cx">     callOnMainThread([callback = WTFMove(callback)]() {
</span><del>-        callback(WebProcess::singleton().networkConnection().connection());
</del><ins>+        callback(WebProcess::singleton().ensureNetworkProcessConnection().connection());
</ins><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessNetworkwebrtcLibWebRTCSocketcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/Network/webrtc/LibWebRTCSocket.cpp (225281 => 225282)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -43,7 +43,7 @@
</span><span class="cx"> static inline void sendOnMainThread(Function<void(IPC::Connection&)>&& callback)
</span><span class="cx"> {
</span><span class="cx">     callOnMainThread([callback = WTFMove(callback)]() {
</span><del>-        callback(WebProcess::singleton().networkConnection().connection());
</del><ins>+        callback(WebProcess::singleton().ensureNetworkProcessConnection().connection());
</ins><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessNetworkwebrtcLibWebRTCSocketFactorycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/Network/webrtc/LibWebRTCSocketFactory.cpp (225281 => 225282)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -46,7 +46,7 @@
</span><span class="cx">     m_sockets.set(socket->identifier(), socket.get());
</span><span class="cx"> 
</span><span class="cx">     callOnMainThread([identifier = socket->identifier(), address = RTCNetwork::isolatedCopy(address), minPort, maxPort, options]() {
</span><del>-        if (!WebProcess::singleton().networkConnection().connection().send(Messages::NetworkRTCProvider::CreateServerTCPSocket(identifier, RTCNetwork::SocketAddress(address), minPort, maxPort, options), 0)) {
</del><ins>+        if (!WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkRTCProvider::CreateServerTCPSocket(identifier, RTCNetwork::SocketAddress(address), minPort, maxPort, options), 0)) {
</ins><span class="cx">             // FIXME: Set error back to socket
</span><span class="cx">             return;
</span><span class="cx">         }
</span><span class="lines">@@ -62,7 +62,7 @@
</span><span class="cx">     m_sockets.set(socket->identifier(), socket.get());
</span><span class="cx"> 
</span><span class="cx">     callOnMainThread([identifier = socket->identifier(), address = RTCNetwork::isolatedCopy(address), minPort, maxPort]() {
</span><del>-        if (!WebProcess::singleton().networkConnection().connection().send(Messages::NetworkRTCProvider::CreateUDPSocket(identifier, RTCNetwork::SocketAddress(address), minPort, maxPort), 0)) {
</del><ins>+        if (!WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkRTCProvider::CreateUDPSocket(identifier, RTCNetwork::SocketAddress(address), minPort, maxPort), 0)) {
</ins><span class="cx">             // FIXME: Set error back to socket
</span><span class="cx">             return;
</span><span class="cx">         }
</span><span class="lines">@@ -77,7 +77,7 @@
</span><span class="cx">     m_sockets.set(socket->identifier(), socket.get());
</span><span class="cx"> 
</span><span class="cx">     callOnMainThread([identifier = socket->identifier(), localAddress = RTCNetwork::isolatedCopy(localAddress), remoteAddress = RTCNetwork::isolatedCopy(remoteAddress), options]() {
</span><del>-        if (!WebProcess::singleton().networkConnection().connection().send(Messages::NetworkRTCProvider::CreateClientTCPSocket(identifier, RTCNetwork::SocketAddress(localAddress), RTCNetwork::SocketAddress(remoteAddress), options), 0)) {
</del><ins>+        if (!WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkRTCProvider::CreateClientTCPSocket(identifier, RTCNetwork::SocketAddress(localAddress), RTCNetwork::SocketAddress(remoteAddress), options), 0)) {
</ins><span class="cx">             // FIXME: Set error back to socket
</span><span class="cx">             return;
</span><span class="cx">         }
</span><span class="lines">@@ -93,7 +93,7 @@
</span><span class="cx">     m_sockets.set(socket->identifier(), socket.get());
</span><span class="cx"> 
</span><span class="cx">     callOnMainThread([identifier = socket->identifier(), newConnectionSocketIdentifier]() {
</span><del>-        if (!WebProcess::singleton().networkConnection().connection().send(Messages::NetworkRTCProvider::WrapNewTCPConnection(identifier, newConnectionSocketIdentifier), 0)) {
</del><ins>+        if (!WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkRTCProvider::WrapNewTCPConnection(identifier, newConnectionSocketIdentifier), 0)) {
</ins><span class="cx">             // FIXME: Set error back to socket
</span><span class="cx">             return;
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessNetworkwebrtcWebRTCMonitorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/Network/webrtc/WebRTCMonitor.cpp (225281 => 225282)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -41,7 +41,7 @@
</span><span class="cx"> static inline void sendOnMainThread(Function<void(IPC::Connection&)>&& callback)
</span><span class="cx"> {
</span><span class="cx">     callOnMainThread([callback = WTFMove(callback)]() {
</span><del>-        callback(WebProcess::singleton().networkConnection().connection());
</del><ins>+        callback(WebProcess::singleton().ensureNetworkProcessConnection().connection());
</ins><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessStorageWebServiceWorkerProvidercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/Storage/WebServiceWorkerProvider.cpp (225281 => 225282)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -55,8 +55,7 @@
</span><span class="cx"> 
</span><span class="cx"> WebCore::SWClientConnection& WebServiceWorkerProvider::serviceWorkerConnectionForSession(SessionID sessionID)
</span><span class="cx"> {
</span><del>-    ASSERT(WebProcess::singleton().webToStorageProcessConnection());
-    return WebProcess::singleton().webToStorageProcessConnection()->serviceWorkerConnectionForSession(sessionID);
</del><ins>+    return WebProcess::singleton().ensureWebToStorageProcessConnection().serviceWorkerConnectionForSession(sessionID);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static inline bool shouldHandleFetch(const ResourceLoaderOptions& options)
</span><span class="lines">@@ -77,7 +76,7 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    auto& connection = WebProcess::singleton().webToStorageProcessConnection()->serviceWorkerConnectionForSession(sessionID);
</del><ins>+    auto& connection = WebProcess::singleton().ensureWebToStorageProcessConnection().serviceWorkerConnectionForSession(sessionID);
</ins><span class="cx">     auto fetch = connection.startFetch(*this, loader, loader.identifier(), WTFMove(callback));
</span><span class="cx">     ASSERT(fetch->isOngoing());
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessWebCoreSupportWebPlatformStrategiescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp (225281 => 225282)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -113,7 +113,7 @@
</span><span class="cx"> {
</span><span class="cx">     String cookieString;
</span><span class="cx">     bool secureCookiesAccessed = false;
</span><del>-    if (!WebProcess::singleton().networkConnection().connection().sendSync(Messages::NetworkConnectionToWebProcess::CookiesForDOM(session.sessionID(), firstParty, url, includeSecureCookies), Messages::NetworkConnectionToWebProcess::CookiesForDOM::Reply(cookieString, secureCookiesAccessed), 0))
</del><ins>+    if (!WebProcess::singleton().ensureNetworkProcessConnection().connection().sendSync(Messages::NetworkConnectionToWebProcess::CookiesForDOM(session.sessionID(), firstParty, url, includeSecureCookies), Messages::NetworkConnectionToWebProcess::CookiesForDOM::Reply(cookieString, secureCookiesAccessed), 0))
</ins><span class="cx">         return { String(), false };
</span><span class="cx"> 
</span><span class="cx">     return { cookieString, secureCookiesAccessed };
</span><span class="lines">@@ -121,13 +121,13 @@
</span><span class="cx"> 
</span><span class="cx"> void WebPlatformStrategies::setCookiesFromDOM(const NetworkStorageSession& session, const URL& firstParty, const URL& url, const String& cookieString)
</span><span class="cx"> {
</span><del>-    WebProcess::singleton().networkConnection().connection().send(Messages::NetworkConnectionToWebProcess::SetCookiesFromDOM(session.sessionID(), firstParty, url, cookieString), 0);
</del><ins>+    WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::SetCookiesFromDOM(session.sessionID(), firstParty, url, cookieString), 0);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool WebPlatformStrategies::cookiesEnabled(const NetworkStorageSession& session)
</span><span class="cx"> {
</span><span class="cx">     bool result;
</span><del>-    if (!WebProcess::singleton().networkConnection().connection().sendSync(Messages::NetworkConnectionToWebProcess::CookiesEnabled(session.sessionID()), Messages::NetworkConnectionToWebProcess::CookiesEnabled::Reply(result), 0))
</del><ins>+    if (!WebProcess::singleton().ensureNetworkProcessConnection().connection().sendSync(Messages::NetworkConnectionToWebProcess::CookiesEnabled(session.sessionID()), Messages::NetworkConnectionToWebProcess::CookiesEnabled::Reply(result), 0))
</ins><span class="cx">         return false;
</span><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="lines">@@ -141,7 +141,7 @@
</span><span class="cx"> {
</span><span class="cx">     String cookieString;
</span><span class="cx">     bool secureCookiesAccessed = false;
</span><del>-    if (!WebProcess::singleton().networkConnection().connection().sendSync(Messages::NetworkConnectionToWebProcess::CookieRequestHeaderFieldValue(sessionID, firstParty, url, includeSecureCookies), Messages::NetworkConnectionToWebProcess::CookieRequestHeaderFieldValue::Reply(cookieString, secureCookiesAccessed), 0))
</del><ins>+    if (!WebProcess::singleton().ensureNetworkProcessConnection().connection().sendSync(Messages::NetworkConnectionToWebProcess::CookieRequestHeaderFieldValue(sessionID, firstParty, url, includeSecureCookies), Messages::NetworkConnectionToWebProcess::CookieRequestHeaderFieldValue::Reply(cookieString, secureCookiesAccessed), 0))
</ins><span class="cx">         return { String(), false };
</span><span class="cx">     return { cookieString, secureCookiesAccessed };
</span><span class="cx"> }
</span><span class="lines">@@ -148,7 +148,7 @@
</span><span class="cx"> 
</span><span class="cx"> bool WebPlatformStrategies::getRawCookies(const NetworkStorageSession& session, const URL& firstParty, const URL& url, Vector<Cookie>& rawCookies)
</span><span class="cx"> {
</span><del>-    if (!WebProcess::singleton().networkConnection().connection().sendSync(Messages::NetworkConnectionToWebProcess::GetRawCookies(session.sessionID(), firstParty, url), Messages::NetworkConnectionToWebProcess::GetRawCookies::Reply(rawCookies), 0))
</del><ins>+    if (!WebProcess::singleton().ensureNetworkProcessConnection().connection().sendSync(Messages::NetworkConnectionToWebProcess::GetRawCookies(session.sessionID(), firstParty, url), Messages::NetworkConnectionToWebProcess::GetRawCookies::Reply(rawCookies), 0))
</ins><span class="cx">         return false;
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="lines">@@ -155,7 +155,7 @@
</span><span class="cx"> 
</span><span class="cx"> void WebPlatformStrategies::deleteCookie(const NetworkStorageSession& session, const URL& url, const String& cookieName)
</span><span class="cx"> {
</span><del>-    WebProcess::singleton().networkConnection().connection().send(Messages::NetworkConnectionToWebProcess::DeleteCookie(session.sessionID(), url, cookieName), 0);
</del><ins>+    WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::DeleteCookie(session.sessionID(), url, cookieName), 0);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(COCOA)
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessWebPageWebFramecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/WebPage/WebFrame.cpp (225281 => 225282)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -291,7 +291,7 @@
</span><span class="cx"> 
</span><span class="cx">     auto& webProcess = WebProcess::singleton();
</span><span class="cx">     PAL::SessionID sessionID = page() ? page()->sessionID() : PAL::SessionID::defaultSessionID();
</span><del>-    webProcess.networkConnection().connection().send(Messages::NetworkConnectionToWebProcess::StartDownload(sessionID, policyDownloadID, request, suggestedName), 0);
</del><ins>+    webProcess.ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::StartDownload(sessionID, policyDownloadID, request, suggestedName), 0);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebFrame::convertMainResourceLoadToDownload(DocumentLoader* documentLoader, PAL::SessionID sessionID, const ResourceRequest& request, const ResourceResponse& response)
</span><span class="lines">@@ -313,7 +313,7 @@
</span><span class="cx">     else
</span><span class="cx">         mainResourceLoadIdentifier = 0;
</span><span class="cx"> 
</span><del>-    webProcess.networkConnection().connection().send(Messages::NetworkConnectionToWebProcess::ConvertMainResourceLoadToDownload(sessionID, mainResourceLoadIdentifier, policyDownloadID, request, response), 0);
</del><ins>+    webProcess.ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::ConvertMainResourceLoadToDownload(sessionID, mainResourceLoadIdentifier, policyDownloadID, request, response), 0);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> String WebFrame::source() const
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessWebProcesscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/WebProcess.cpp (225281 => 225282)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -417,29 +417,6 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-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);
-}
-
</del><span class="cx"> void WebProcess::registerURLSchemeAsEmptyDocument(const String& urlScheme)
</span><span class="cx"> {
</span><span class="cx">     SchemeRegistry::registerURLSchemeAsEmptyDocument(urlScheme);
</span><span class="lines">@@ -527,7 +504,7 @@
</span><span class="cx"> 
</span><span class="cx"> void WebProcess::ensureLegacyPrivateBrowsingSessionInNetworkProcess()
</span><span class="cx"> {
</span><del>-    networkConnection().connection().send(Messages::NetworkConnectionToWebProcess::EnsureLegacyPrivateBrowsingSession(), 0);
</del><ins>+    ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::EnsureLegacyPrivateBrowsingSession(), 0);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(NETSCAPE_PLUGIN_API)
</span><span class="lines">@@ -1109,16 +1086,27 @@
</span><span class="cx">     injectedBundle->setBundleParameters(value);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-NetworkProcessConnection& WebProcess::networkConnection()
</del><ins>+NetworkProcessConnection& WebProcess::ensureNetworkProcessConnection()
</ins><span class="cx"> {
</span><span class="cx">     // If we've lost our connection to the network process (e.g. it crashed) try to re-establish it.
</span><del>-    if (!m_networkProcessConnection)
-        ensureNetworkProcessConnection();
</del><ins>+    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);
+    }
</ins><span class="cx">     
</span><del>-    // If we failed to re-establish it then we are beyond recovery and should crash.
-    if (!m_networkProcessConnection)
-        CRASH();
-    
</del><span class="cx">     return *m_networkProcessConnection;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1171,36 +1159,29 @@
</span><span class="cx">     m_webToStorageProcessConnection = nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-WebToStorageProcessConnection* WebProcess::webToStorageProcessConnection()
</del><ins>+WebToStorageProcessConnection& WebProcess::ensureWebToStorageProcessConnection()
</ins><span class="cx"> {
</span><del>-    if (!m_webToStorageProcessConnection)
-        ensureWebToStorageProcessConnection();
</del><ins>+    if (!m_webToStorageProcessConnection) {
+        IPC::Attachment encodedConnectionIdentifier;
</ins><span class="cx"> 
</span><del>-    return m_webToStorageProcessConnection.get();
-}
</del><ins>+        if (!parentProcessConnection()->sendSync(Messages::WebProcessProxy::GetStorageProcessConnection(), Messages::WebProcessProxy::GetStorageProcessConnection::Reply(encodedConnectionIdentifier), 0))
+            CRASH();
</ins><span class="cx"> 
</span><del>-void WebProcess::ensureWebToStorageProcessConnection()
-{
-    if (m_webToStorageProcessConnection)
-        return;
-
-    IPC::Attachment encodedConnectionIdentifier;
-
-    if (!parentProcessConnection()->sendSync(Messages::WebProcessProxy::GetStorageProcessConnection(), Messages::WebProcessProxy::GetStorageProcessConnection::Reply(encodedConnectionIdentifier), 0))
-        return;
-
</del><span class="cx"> #if USE(UNIX_DOMAIN_SOCKETS)
</span><del>-    IPC::Connection::Identifier connectionIdentifier = encodedConnectionIdentifier.releaseFileDescriptor();
</del><ins>+        IPC::Connection::Identifier connectionIdentifier = encodedConnectionIdentifier.releaseFileDescriptor();
</ins><span class="cx"> #elif OS(DARWIN)
</span><del>-    IPC::Connection::Identifier connectionIdentifier(encodedConnectionIdentifier.port());
</del><ins>+        IPC::Connection::Identifier connectionIdentifier(encodedConnectionIdentifier.port());
</ins><span class="cx"> #elif OS(WINDOWS)
</span><del>-    IPC::Connection::Identifier connectionIdentifier(encodedConnectionIdentifier.handle());
</del><ins>+        IPC::Connection::Identifier connectionIdentifier(encodedConnectionIdentifier.handle());
</ins><span class="cx"> #else
</span><del>-    ASSERT_NOT_REACHED();
</del><ins>+        ASSERT_NOT_REACHED();
</ins><span class="cx"> #endif
</span><del>-    if (IPC::Connection::identifierIsNull(connectionIdentifier))
-        return;
-    m_webToStorageProcessConnection = WebToStorageProcessConnection::create(connectionIdentifier);
</del><ins>+        if (IPC::Connection::identifierIsNull(connectionIdentifier))
+            CRASH();
+        m_webToStorageProcessConnection = WebToStorageProcessConnection::create(connectionIdentifier);
+
+    }
+    return *m_webToStorageProcessConnection;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebProcess::setEnhancedAccessibility(bool flag)
</span><span class="lines">@@ -1609,7 +1590,7 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     if (m_dnsPrefetchedHosts.add(hostname).isNewEntry)
</span><del>-        networkConnection().connection().send(Messages::NetworkConnectionToWebProcess::PrefetchDNS(hostname), 0);
</del><ins>+        ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::PrefetchDNS(hostname), 0);
</ins><span class="cx">     // The DNS prefetched hosts cache is only to avoid asking for the same hosts too many times
</span><span class="cx">     // in a very short period of time, producing a lot of IPC traffic. So we clear this cache after
</span><span class="cx">     // some time of no DNS requests.
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessWebProcessh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/WebProcess.h (225281 => 225282)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -165,7 +165,7 @@
</span><span class="cx"> 
</span><span class="cx">     EventDispatcher& eventDispatcher() { return *m_eventDispatcher; }
</span><span class="cx"> 
</span><del>-    NetworkProcessConnection& networkConnection();
</del><ins>+    NetworkProcessConnection& ensureNetworkProcessConnection();
</ins><span class="cx">     void networkProcessConnectionClosed(NetworkProcessConnection*);
</span><span class="cx">     WebLoaderStrategy& webLoaderStrategy();
</span><span class="cx"> 
</span><span class="lines">@@ -174,7 +174,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     void webToStorageProcessConnectionClosed(WebToStorageProcessConnection*);
</span><del>-    WebToStorageProcessConnection* webToStorageProcessConnection();
</del><ins>+    WebToStorageProcessConnection& ensureWebToStorageProcessConnection();
</ins><span class="cx"> 
</span><span class="cx">     void setCacheModel(uint32_t);
</span><span class="cx"> 
</span><span class="lines">@@ -383,7 +383,6 @@
</span><span class="cx"> 
</span><span class="cx">     TextCheckerState m_textCheckerState;
</span><span class="cx"> 
</span><del>-    void ensureNetworkProcessConnection();
</del><span class="cx">     RefPtr<NetworkProcessConnection> m_networkProcessConnection;
</span><span class="cx">     WebLoaderStrategy& m_webLoaderStrategy;
</span><span class="cx"> 
</span><span class="lines">@@ -398,7 +397,6 @@
</span><span class="cx"> 
</span><span class="cx">     std::unique_ptr<WebAutomationSessionProxy> m_automationSessionProxy;
</span><span class="cx"> 
</span><del>-    void ensureWebToStorageProcessConnection();
</del><span class="cx">     RefPtr<WebToStorageProcessConnection> m_webToStorageProcessConnection;
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(NETSCAPE_PLUGIN_API)
</span></span></pre>
</div>
</div>

</body>
</html>