<!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>[248593] trunk/Source</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/248593">248593</a></dd>
<dt>Author</dt> <dd>youenn@apple.com</dd>
<dt>Date</dt> <dd>2019-08-13 03:06:16 -0700 (Tue, 13 Aug 2019)</dd>
</dl>

<h3>Log Message</h3>
<pre>Blob registries should be keyed by session IDs
https://bugs.webkit.org/show_bug.cgi?id=200567
Source/WebCore:

<rdar://problem/54120212>

Reviewed by Alex Christensen.

Pass session IDs to all BlobRegistry methods in particular ThreadableLoaderRegistry.
The only exception is blobSize which should be dealt with a follow-up patch.
blobSize blob registry is retrieved from the connection -> sessionID map in Network Process.
Covered by existing tests.

* Modules/fetch/FetchLoader.cpp:
(WebCore::FetchLoader::~FetchLoader):
(WebCore::FetchLoader::startLoadingBlobURL):
* Modules/fetch/FetchLoader.h:
* fileapi/FileReaderLoader.cpp:
(WebCore::FileReaderLoader::~FileReaderLoader):
(WebCore::FileReaderLoader::start):
* fileapi/FileReaderLoader.h:
* fileapi/ThreadableBlobRegistry.cpp:
(WebCore::ThreadableBlobRegistry::registerFileBlobURL):
(WebCore::ThreadableBlobRegistry::registerBlobURL):
(WebCore::ThreadableBlobRegistry::registerBlobURLOptionallyFileBacked):
* fileapi/ThreadableBlobRegistry.h:
* html/PublicURLManager.cpp:
* loader/PolicyChecker.cpp:
(WebCore::PolicyChecker::extendBlobURLLifetimeIfNecessary const):
* platform/network/BlobRegistry.h:
* platform/network/BlobRegistryImpl.cpp:
(WebCore::createBlobResourceHandle):
(WebCore::loadBlobResourceSynchronously):
(WebCore::BlobRegistryImpl::filesInBlob const):
* platform/network/BlobRegistryImpl.h:
* platform/network/FormData.cpp:
(WebCore::appendBlobResolved):
(WebCore::FormData::resolveBlobReferences):
* platform/network/FormData.h:
* platform/network/cf/FormDataStreamCFNet.cpp:
(WebCore::createHTTPBodyCFReadStream):
* platform/network/soup/ResourceRequest.h:
* platform/network/soup/ResourceRequestSoup.cpp:
(WebCore::ResourceRequest::updateSoupMessageBody const):
(WebCore::ResourceRequest::updateSoupMessage const):

Source/WebKit:

<rdar://problem/54120212>

Reviewed by Alex Christensen.

Move blob registry to NetworkSession so that it is partitioned by session ID.
In case session ID is not given through IPC, use the connection as key to get the network session.
This is used for blobSize.

* NetworkProcess/Downloads/DownloadManager.cpp:
(WebKit::DownloadManager::startDownload):
* NetworkProcess/Downloads/DownloadManager.h:
* NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
* NetworkProcess/FileAPI/NetworkBlobRegistry.h: Removed.
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::didClose):
(WebKit::NetworkConnectionToWebProcess::resolveBlobReferences):
(WebKit::NetworkConnectionToWebProcess::registerFileBlobURL):
(WebKit::NetworkConnectionToWebProcess::registerBlobURL):
(WebKit::NetworkConnectionToWebProcess::registerBlobURLFromURL):
(WebKit::NetworkConnectionToWebProcess::registerBlobURLOptionallyFileBacked):
(WebKit::NetworkConnectionToWebProcess::registerBlobURLForSlice):
(WebKit::NetworkConnectionToWebProcess::unregisterBlobURL):
(WebKit::NetworkConnectionToWebProcess::blobSize):
(WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles):
(WebKit::NetworkConnectionToWebProcess::filesInBlob):
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::blobRegistry):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcessPlatformStrategies.cpp:
(WebKit::NetworkProcessPlatformStrategies::createBlobRegistry):
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::startNetworkLoad):
* NetworkProcess/NetworkSession.h:
(WebKit::NetworkSession::blobRegistry):
* NetworkProcess/soup/NetworkDataTaskSoup.cpp:
(WebKit::NetworkDataTaskSoup::createRequest):
* NetworkProcess/soup/NetworkSessionSoup.cpp:
(WebKit::NetworkSessionSoup::createWebSocketTask):
* Sources.txt:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/FileAPI/BlobRegistryProxy.cpp:
(WebKit::BlobRegistryProxy::registerFileBlobURL):
(WebKit::BlobRegistryProxy::registerBlobURL):
(WebKit::BlobRegistryProxy::registerBlobURLOptionallyFileBacked):
(WebKit::BlobRegistryProxy::unregisterBlobURL):
(WebKit::BlobRegistryProxy::registerBlobURLForSlice):
(WebKit::BlobRegistryProxy::writeBlobsToTemporaryFiles):
* WebProcess/FileAPI/BlobRegistryProxy.h:
* WebProcess/Network/NetworkProcessConnection.cpp:
(WebKit::NetworkProcessConnection::writeBlobsToTemporaryFiles):
* WebProcess/Network/NetworkProcessConnection.h:

Source/WebKitLegacy/mac:

Reviewed by Alex Christensen.

* WebCoreSupport/WebPlatformStrategies.mm:
(WebPlatformStrategies::createBlobRegistry):
Ignore sessionID parameter for WK1.

Source/WebKitLegacy/win:

<rdar://problem/54120212>

Reviewed by Alex Christensen.

* WebCoreSupport/WebPlatformStrategies.cpp:
(WebPlatformStrategies::createBlobRegistry):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulesfetchFetchLoadercpp">trunk/Source/WebCore/Modules/fetch/FetchLoader.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesfetchFetchLoaderh">trunk/Source/WebCore/Modules/fetch/FetchLoader.h</a></li>
<li><a href="#trunkSourceWebCorebindingsjsSerializedScriptValuecpp">trunk/Source/WebCore/bindings/js/SerializedScriptValue.cpp</a></li>
<li><a href="#trunkSourceWebCorefileapiBlobcpp">trunk/Source/WebCore/fileapi/Blob.cpp</a></li>
<li><a href="#trunkSourceWebCorefileapiFilecpp">trunk/Source/WebCore/fileapi/File.cpp</a></li>
<li><a href="#trunkSourceWebCorefileapiFileReaderLoadercpp">trunk/Source/WebCore/fileapi/FileReaderLoader.cpp</a></li>
<li><a href="#trunkSourceWebCorefileapiFileReaderLoaderh">trunk/Source/WebCore/fileapi/FileReaderLoader.h</a></li>
<li><a href="#trunkSourceWebCorefileapiThreadableBlobRegistrycpp">trunk/Source/WebCore/fileapi/ThreadableBlobRegistry.cpp</a></li>
<li><a href="#trunkSourceWebCorefileapiThreadableBlobRegistryh">trunk/Source/WebCore/fileapi/ThreadableBlobRegistry.h</a></li>
<li><a href="#trunkSourceWebCorehtmlPublicURLManagercpp">trunk/Source/WebCore/html/PublicURLManager.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderPolicyCheckercpp">trunk/Source/WebCore/loader/PolicyChecker.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkBlobRegistryh">trunk/Source/WebCore/platform/network/BlobRegistry.h</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkBlobRegistryImplcpp">trunk/Source/WebCore/platform/network/BlobRegistryImpl.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkBlobRegistryImplh">trunk/Source/WebCore/platform/network/BlobRegistryImpl.h</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkFormDatacpp">trunk/Source/WebCore/platform/network/FormData.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkFormDatah">trunk/Source/WebCore/platform/network/FormData.h</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkcfFormDataStreamCFNetcpp">trunk/Source/WebCore/platform/network/cf/FormDataStreamCFNet.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkcurlCurlFormDataStreamcpp">trunk/Source/WebCore/platform/network/curl/CurlFormDataStream.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworksoupResourceRequesth">trunk/Source/WebCore/platform/network/soup/ResourceRequest.h</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworksoupResourceRequestSoupcpp">trunk/Source/WebCore/platform/network/soup/ResourceRequestSoup.cpp</a></li>
<li><a href="#trunkSourceWebKitChangeLog">trunk/Source/WebKit/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitNetworkProcessDownloadsDownloadManagercpp">trunk/Source/WebKit/NetworkProcess/Downloads/DownloadManager.cpp</a></li>
<li><a href="#trunkSourceWebKitNetworkProcessDownloadsDownloadManagerh">trunk/Source/WebKit/NetworkProcess/Downloads/DownloadManager.h</a></li>
<li><a href="#trunkSourceWebKitNetworkProcessFileAPINetworkBlobRegistrycpp">trunk/Source/WebKit/NetworkProcess/FileAPI/NetworkBlobRegistry.cpp</a></li>
<li><a href="#trunkSourceWebKitNetworkProcessNetworkConnectionToWebProcesscpp">trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp</a></li>
<li><a href="#trunkSourceWebKitNetworkProcessNetworkConnectionToWebProcessh">trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h</a></li>
<li><a href="#trunkSourceWebKitNetworkProcessNetworkConnectionToWebProcessmessagesin">trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in</a></li>
<li><a href="#trunkSourceWebKitNetworkProcessNetworkProcesscpp">trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp</a></li>
<li><a href="#trunkSourceWebKitNetworkProcessNetworkProcessh">trunk/Source/WebKit/NetworkProcess/NetworkProcess.h</a></li>
<li><a href="#trunkSourceWebKitNetworkProcessNetworkProcessPlatformStrategiescpp">trunk/Source/WebKit/NetworkProcess/NetworkProcessPlatformStrategies.cpp</a></li>
<li><a href="#trunkSourceWebKitNetworkProcessNetworkResourceLoadercpp">trunk/Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp</a></li>
<li><a href="#trunkSourceWebKitNetworkProcessNetworkSessionh">trunk/Source/WebKit/NetworkProcess/NetworkSession.h</a></li>
<li><a href="#trunkSourceWebKitNetworkProcesssoupNetworkDataTaskSoupcpp">trunk/Source/WebKit/NetworkProcess/soup/NetworkDataTaskSoup.cpp</a></li>
<li><a href="#trunkSourceWebKitNetworkProcesssoupNetworkSessionSoupcpp">trunk/Source/WebKit/NetworkProcess/soup/NetworkSessionSoup.cpp</a></li>
<li><a href="#trunkSourceWebKitSourcestxt">trunk/Source/WebKit/Sources.txt</a></li>
<li><a href="#trunkSourceWebKitWebKitxcodeprojprojectpbxproj">trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebKitWebProcessFileAPIBlobRegistryProxycpp">trunk/Source/WebKit/WebProcess/FileAPI/BlobRegistryProxy.cpp</a></li>
<li><a href="#trunkSourceWebKitWebProcessFileAPIBlobRegistryProxyh">trunk/Source/WebKit/WebProcess/FileAPI/BlobRegistryProxy.h</a></li>
<li><a href="#trunkSourceWebKitWebProcessNetworkNetworkProcessConnectioncpp">trunk/Source/WebKit/WebProcess/Network/NetworkProcessConnection.cpp</a></li>
<li><a href="#trunkSourceWebKitWebProcessNetworkNetworkProcessConnectionh">trunk/Source/WebKit/WebProcess/Network/NetworkProcessConnection.h</a></li>
<li><a href="#trunkSourceWebKitLegacymacChangeLog">trunk/Source/WebKitLegacy/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitLegacymacWebCoreSupportWebPlatformStrategiesmm">trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebPlatformStrategies.mm</a></li>
<li><a href="#trunkSourceWebKitLegacywinChangeLog">trunk/Source/WebKitLegacy/win/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitLegacywinWebCoreSupportWebPlatformStrategiescpp">trunk/Source/WebKitLegacy/win/WebCoreSupport/WebPlatformStrategies.cpp</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebKitNetworkProcessFileAPINetworkBlobRegistryh">trunk/Source/WebKit/NetworkProcess/FileAPI/NetworkBlobRegistry.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (248592 => 248593)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2019-08-13 08:54:27 UTC (rev 248592)
+++ trunk/Source/WebCore/ChangeLog      2019-08-13 10:06:16 UTC (rev 248593)
</span><span class="lines">@@ -1,5 +1,51 @@
</span><span class="cx"> 2019-08-13  Youenn Fablet  <youenn@apple.com>
</span><span class="cx"> 
</span><ins>+        Blob registries should be keyed by session IDs
+        https://bugs.webkit.org/show_bug.cgi?id=200567
+        <rdar://problem/54120212>
+
+        Reviewed by Alex Christensen.
+
+        Pass session IDs to all BlobRegistry methods in particular ThreadableLoaderRegistry.
+        The only exception is blobSize which should be dealt with a follow-up patch.
+        blobSize blob registry is retrieved from the connection -> sessionID map in Network Process.
+        Covered by existing tests.
+
+        * Modules/fetch/FetchLoader.cpp:
+        (WebCore::FetchLoader::~FetchLoader):
+        (WebCore::FetchLoader::startLoadingBlobURL):
+        * Modules/fetch/FetchLoader.h:
+        * fileapi/FileReaderLoader.cpp:
+        (WebCore::FileReaderLoader::~FileReaderLoader):
+        (WebCore::FileReaderLoader::start):
+        * fileapi/FileReaderLoader.h:
+        * fileapi/ThreadableBlobRegistry.cpp:
+        (WebCore::ThreadableBlobRegistry::registerFileBlobURL):
+        (WebCore::ThreadableBlobRegistry::registerBlobURL):
+        (WebCore::ThreadableBlobRegistry::registerBlobURLOptionallyFileBacked):
+        * fileapi/ThreadableBlobRegistry.h:
+        * html/PublicURLManager.cpp:
+        * loader/PolicyChecker.cpp:
+        (WebCore::PolicyChecker::extendBlobURLLifetimeIfNecessary const):
+        * platform/network/BlobRegistry.h:
+        * platform/network/BlobRegistryImpl.cpp:
+        (WebCore::createBlobResourceHandle):
+        (WebCore::loadBlobResourceSynchronously):
+        (WebCore::BlobRegistryImpl::filesInBlob const):
+        * platform/network/BlobRegistryImpl.h:
+        * platform/network/FormData.cpp:
+        (WebCore::appendBlobResolved):
+        (WebCore::FormData::resolveBlobReferences):
+        * platform/network/FormData.h:
+        * platform/network/cf/FormDataStreamCFNet.cpp:
+        (WebCore::createHTTPBodyCFReadStream):
+        * platform/network/soup/ResourceRequest.h:
+        * platform/network/soup/ResourceRequestSoup.cpp:
+        (WebCore::ResourceRequest::updateSoupMessageBody const):
+        (WebCore::ResourceRequest::updateSoupMessage const):
+
+2019-08-13  Youenn Fablet  <youenn@apple.com>
+
</ins><span class="cx">         User Agent and SessionID should be given to NetworkRTCProvider to set up the correct proxy information
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=200583
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesfetchFetchLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/fetch/FetchLoader.cpp (248592 => 248593)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/fetch/FetchLoader.cpp       2019-08-13 08:54:27 UTC (rev 248592)
+++ trunk/Source/WebCore/Modules/fetch/FetchLoader.cpp  2019-08-13 10:06:16 UTC (rev 248593)
</span><span class="lines">@@ -48,7 +48,7 @@
</span><span class="cx"> FetchLoader::~FetchLoader()
</span><span class="cx"> {
</span><span class="cx">     if (!m_urlForReading.isEmpty())
</span><del>-        ThreadableBlobRegistry::unregisterBlobURL(m_urlForReading);
</del><ins>+        ThreadableBlobRegistry::unregisterBlobURL(*m_sessionID, m_urlForReading);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void FetchLoader::start(ScriptExecutionContext& context, const Blob& blob)
</span><span class="lines">@@ -64,7 +64,8 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    ThreadableBlobRegistry::registerBlobURL(context.securityOrigin(), m_urlForReading, blobURL);
</del><ins>+    m_sessionID = context.sessionID();
+    ThreadableBlobRegistry::registerBlobURL(*m_sessionID, context.securityOrigin(), m_urlForReading, blobURL);
</ins><span class="cx"> 
</span><span class="cx">     ResourceRequest request(m_urlForReading);
</span><span class="cx">     request.setInitiatorIdentifier(context.resourceRequestIdentifier());
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesfetchFetchLoaderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/fetch/FetchLoader.h (248592 => 248593)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/fetch/FetchLoader.h 2019-08-13 08:54:27 UTC (rev 248592)
+++ trunk/Source/WebCore/Modules/fetch/FetchLoader.h    2019-08-13 10:06:16 UTC (rev 248593)
</span><span class="lines">@@ -67,6 +67,7 @@
</span><span class="cx">     FetchBodyConsumer* m_consumer;
</span><span class="cx">     bool m_isStarted { false };
</span><span class="cx">     URL m_urlForReading;
</span><ins>+    Optional<PAL::SessionID> m_sessionID;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsSerializedScriptValuecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/SerializedScriptValue.cpp (248592 => 248593)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/SerializedScriptValue.cpp       2019-08-13 08:54:27 UTC (rev 248592)
+++ trunk/Source/WebCore/bindings/js/SerializedScriptValue.cpp  2019-08-13 10:06:16 UTC (rev 248593)
</span><span class="lines">@@ -3569,13 +3569,12 @@
</span><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void SerializedScriptValue::writeBlobsToDiskForIndexedDB(PAL::SessionID, CompletionHandler<void(IDBValue&&)>&& completionHandler)
</del><ins>+void SerializedScriptValue::writeBlobsToDiskForIndexedDB(PAL::SessionID sessionID, CompletionHandler<void(IDBValue&&)>&& completionHandler)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(isMainThread());
</span><span class="cx">     ASSERT(hasBlobURLs());
</span><span class="cx"> 
</span><del>-    // FIXME: Get the right blob registry from the given sessionID.
-    blobRegistry().writeBlobsToTemporaryFiles(m_blobURLs, [completionHandler = WTFMove(completionHandler), this, protectedThis = makeRef(*this)] (auto&& blobFilePaths) mutable {
</del><ins>+    blobRegistry().writeBlobsToTemporaryFiles(sessionID, m_blobURLs, [completionHandler = WTFMove(completionHandler), this, protectedThis = makeRef(*this)] (auto&& blobFilePaths) mutable {
</ins><span class="cx">         ASSERT(isMainThread());
</span><span class="cx"> 
</span><span class="cx">         if (blobFilePaths.isEmpty()) {
</span><span class="lines">@@ -3586,7 +3585,7 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         ASSERT(m_blobURLs.size() == blobFilePaths.size());
</span><del>-        
</del><ins>+
</ins><span class="cx">         completionHandler({ *this, m_blobURLs, blobFilePaths });
</span><span class="cx">     });
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorefileapiBlobcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/fileapi/Blob.cpp (248592 => 248593)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/fileapi/Blob.cpp    2019-08-13 08:54:27 UTC (rev 248592)
+++ trunk/Source/WebCore/fileapi/Blob.cpp       2019-08-13 10:06:16 UTC (rev 248593)
</span><span class="lines">@@ -58,12 +58,12 @@
</span><span class="cx"> void BlobURLRegistry::registerURL(ScriptExecutionContext& context, const URL& publicURL, URLRegistrable& blob)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(&blob.registry() == this);
</span><del>-    ThreadableBlobRegistry::registerBlobURL(context.securityOrigin(), publicURL, static_cast<Blob&>(blob).url());
</del><ins>+    ThreadableBlobRegistry::registerBlobURL(context.sessionID(), context.securityOrigin(), publicURL, static_cast<Blob&>(blob).url());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void BlobURLRegistry::unregisterURL(ScriptExecutionContext&, const URL& url)
</del><ins>+void BlobURLRegistry::unregisterURL(ScriptExecutionContext& context, const URL& url)
</ins><span class="cx"> {
</span><del>-    ThreadableBlobRegistry::unregisterBlobURL(url);
</del><ins>+    ThreadableBlobRegistry::unregisterBlobURL(context.sessionID(), url);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> URLRegistry& BlobURLRegistry::registry()
</span><span class="lines">@@ -84,7 +84,7 @@
</span><span class="cx">     , m_size(0)
</span><span class="cx"> {
</span><span class="cx">     m_internalURL = BlobURL::createInternalURL();
</span><del>-    ThreadableBlobRegistry::registerBlobURL(m_internalURL, { },  { });
</del><ins>+    ThreadableBlobRegistry::registerBlobURL(m_sessionID, m_internalURL, { },  { });
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> Blob::Blob(PAL::SessionID sessionID, Vector<BlobPartVariant>&& blobPartVariants, const BlobPropertyBag& propertyBag)
</span><span class="lines">@@ -101,7 +101,7 @@
</span><span class="cx">         );
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    ThreadableBlobRegistry::registerBlobURL(m_internalURL, builder.finalize(), m_type);
</del><ins>+    ThreadableBlobRegistry::registerBlobURL(m_sessionID, m_internalURL, builder.finalize(), m_type);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> Blob::Blob(PAL::SessionID sessionID, const SharedBuffer& buffer, const String& contentType)
</span><span class="lines">@@ -115,7 +115,7 @@
</span><span class="cx">     Vector<BlobPart> blobParts;
</span><span class="cx">     blobParts.append(BlobPart(WTFMove(data)));
</span><span class="cx">     m_internalURL = BlobURL::createInternalURL();
</span><del>-    ThreadableBlobRegistry::registerBlobURL(m_internalURL, WTFMove(blobParts), contentType);
</del><ins>+    ThreadableBlobRegistry::registerBlobURL(m_sessionID, m_internalURL, WTFMove(blobParts), contentType);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> Blob::Blob(PAL::SessionID sessionID, Vector<uint8_t>&& data, const String& contentType)
</span><span class="lines">@@ -126,7 +126,7 @@
</span><span class="cx">     Vector<BlobPart> blobParts;
</span><span class="cx">     blobParts.append(BlobPart(WTFMove(data)));
</span><span class="cx">     m_internalURL = BlobURL::createInternalURL();
</span><del>-    ThreadableBlobRegistry::registerBlobURL(m_internalURL, WTFMove(blobParts), contentType);
</del><ins>+    ThreadableBlobRegistry::registerBlobURL(m_sessionID, m_internalURL, WTFMove(blobParts), contentType);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> Blob::Blob(ReferencingExistingBlobConstructor, const Blob& blob)
</span><span class="lines">@@ -135,7 +135,7 @@
</span><span class="cx">     , m_type(blob.type())
</span><span class="cx">     , m_size(blob.size())
</span><span class="cx"> {
</span><del>-    ThreadableBlobRegistry::registerBlobURL(m_internalURL, { BlobPart(blob.url()) } , m_type);
</del><ins>+    ThreadableBlobRegistry::registerBlobURL(m_sessionID, m_internalURL, { BlobPart(blob.url()) } , m_type);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> Blob::Blob(DeserializationContructor, PAL::SessionID sessionID, const URL& srcURL, const String& type, Optional<unsigned long long> size, const String& fileBackedPath)
</span><span class="lines">@@ -145,9 +145,9 @@
</span><span class="cx"> {
</span><span class="cx">     m_internalURL = BlobURL::createInternalURL();
</span><span class="cx">     if (fileBackedPath.isEmpty())
</span><del>-        ThreadableBlobRegistry::registerBlobURL(nullptr, m_internalURL, srcURL);
</del><ins>+        ThreadableBlobRegistry::registerBlobURL(m_sessionID, nullptr, m_internalURL, srcURL);
</ins><span class="cx">     else
</span><del>-        ThreadableBlobRegistry::registerBlobURLOptionallyFileBacked(m_internalURL, srcURL, fileBackedPath, m_type);
</del><ins>+        ThreadableBlobRegistry::registerBlobURLOptionallyFileBacked(m_sessionID, m_internalURL, srcURL, fileBackedPath, m_type);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> Blob::Blob(PAL::SessionID sessionID, const URL& srcURL, long long start, long long end, const String& type)
</span><span class="lines">@@ -156,12 +156,12 @@
</span><span class="cx">     // m_size is not necessarily equal to end - start so we do not initialize it here.
</span><span class="cx"> {
</span><span class="cx">     m_internalURL = BlobURL::createInternalURL();
</span><del>-    ThreadableBlobRegistry::registerBlobURLForSlice(m_internalURL, srcURL, start, end);
</del><ins>+    ThreadableBlobRegistry::registerBlobURLForSlice(m_sessionID, m_internalURL, srcURL, start, end);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> Blob::~Blob()
</span><span class="cx"> {
</span><del>-    ThreadableBlobRegistry::unregisterBlobURL(m_internalURL);
</del><ins>+    ThreadableBlobRegistry::unregisterBlobURL(m_sessionID, m_internalURL);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> unsigned long long Blob::size() const
</span></span></pre></div>
<a id="trunkSourceWebCorefileapiFilecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/fileapi/File.cpp (248592 => 248593)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/fileapi/File.cpp    2019-08-13 08:54:27 UTC (rev 248592)
+++ trunk/Source/WebCore/fileapi/File.cpp       2019-08-13 10:06:16 UTC (rev 248593)
</span><span class="lines">@@ -53,7 +53,7 @@
</span><span class="cx">     computeNameAndContentType(path, nameOverride, name, type);
</span><span class="cx"> 
</span><span class="cx">     auto internalURL = BlobURL::createInternalURL();
</span><del>-    ThreadableBlobRegistry::registerFileBlobURL(internalURL, path, type);
</del><ins>+    ThreadableBlobRegistry::registerFileBlobURL(sessionID, internalURL, path, type);
</ins><span class="cx"> 
</span><span class="cx">     return adoptRef(*new File(sessionID, WTFMove(internalURL), WTFMove(type), String { path }, WTFMove(name)));
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorefileapiFileReaderLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/fileapi/FileReaderLoader.cpp (248592 => 248593)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/fileapi/FileReaderLoader.cpp        2019-08-13 08:54:27 UTC (rev 248592)
+++ trunk/Source/WebCore/fileapi/FileReaderLoader.cpp   2019-08-13 10:06:16 UTC (rev 248593)
</span><span class="lines">@@ -68,7 +68,7 @@
</span><span class="cx"> {
</span><span class="cx">     terminate();
</span><span class="cx">     if (!m_urlForReading.isEmpty())
</span><del>-        ThreadableBlobRegistry::unregisterBlobURL(m_urlForReading);
</del><ins>+        ThreadableBlobRegistry::unregisterBlobURL(*m_sessionID, m_urlForReading);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void FileReaderLoader::start(ScriptExecutionContext* scriptExecutionContext, Blob& blob)
</span><span class="lines">@@ -81,7 +81,8 @@
</span><span class="cx">         failed(FileError::SECURITY_ERR);
</span><span class="cx">         return;
</span><span class="cx">     }
</span><del>-    ThreadableBlobRegistry::registerBlobURL(scriptExecutionContext->securityOrigin(), m_urlForReading, blob.url());
</del><ins>+    m_sessionID = scriptExecutionContext->sessionID();
+    ThreadableBlobRegistry::registerBlobURL(*m_sessionID, scriptExecutionContext->securityOrigin(), m_urlForReading, blob.url());
</ins><span class="cx"> 
</span><span class="cx">     // Construct and load the request.
</span><span class="cx">     ResourceRequest request(m_urlForReading);
</span></span></pre></div>
<a id="trunkSourceWebCorefileapiFileReaderLoaderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/fileapi/FileReaderLoader.h (248592 => 248593)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/fileapi/FileReaderLoader.h  2019-08-13 08:54:27 UTC (rev 248592)
+++ trunk/Source/WebCore/fileapi/FileReaderLoader.h     2019-08-13 10:06:16 UTC (rev 248593)
</span><span class="lines">@@ -35,6 +35,7 @@
</span><span class="cx"> #include <wtf/URL.h>
</span><span class="cx"> #include "TextEncoding.h"
</span><span class="cx"> #include "ThreadableLoaderClient.h"
</span><ins>+#include <pal/SessionID.h>
</ins><span class="cx"> #include <wtf/Forward.h>
</span><span class="cx"> #include <wtf/text/WTFString.h>
</span><span class="cx"> 
</span><span class="lines">@@ -102,6 +103,7 @@
</span><span class="cx">     String m_dataType;
</span><span class="cx"> 
</span><span class="cx">     URL m_urlForReading;
</span><ins>+    Optional<PAL::SessionID> m_sessionID;
</ins><span class="cx">     RefPtr<ThreadableLoader> m_loader;
</span><span class="cx"> 
</span><span class="cx">     RefPtr<JSC::ArrayBuffer> m_rawData;
</span></span></pre></div>
<a id="trunkSourceWebCorefileapiThreadableBlobRegistrycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/fileapi/ThreadableBlobRegistry.cpp (248592 => 248593)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/fileapi/ThreadableBlobRegistry.cpp  2019-08-13 08:54:27 UTC (rev 248592)
+++ trunk/Source/WebCore/fileapi/ThreadableBlobRegistry.cpp     2019-08-13 10:06:16 UTC (rev 248593)
</span><span class="lines">@@ -64,109 +64,97 @@
</span><span class="cx">     return *map;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static void postToMainThread(CrossThreadTask&& task)
</del><ins>+void ThreadableBlobRegistry::registerFileBlobURL(PAL::SessionID sessionID, const URL& url, const String& path, const String& contentType)
</ins><span class="cx"> {
</span><del>-    static std::once_flag onceFlag;
-    static CrossThreadQueue<CrossThreadTask>* queue;
-    std::call_once(onceFlag, [] {
-        queue = new CrossThreadQueue<CrossThreadTask>;
-    });
</del><ins>+    if (isMainThread()) {
+        blobRegistry().registerFileBlobURL(sessionID, url, BlobDataFileReference::create(path), contentType);
+        return;
+    }
</ins><span class="cx"> 
</span><del>-    queue->append(WTFMove(task));
-
-    callOnMainThread([] {
-        auto task = queue->tryGetMessage();
-        ASSERT(task);
-        task->performTask();
</del><ins>+    callOnMainThread([sessionID, url = url.isolatedCopy(), path = path.isolatedCopy(), contentType = contentType.isolatedCopy()] {
+        blobRegistry().registerFileBlobURL(sessionID, url, BlobDataFileReference::create(path), contentType);
</ins><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void ThreadableBlobRegistry::registerFileBlobURL(const URL& url, const String& path, const String& contentType)
</del><ins>+void ThreadableBlobRegistry::registerBlobURL(PAL::SessionID sessionID, const URL& url, Vector<BlobPart>&& blobParts, const String& contentType)
</ins><span class="cx"> {
</span><del>-    if (isMainThread())
-        blobRegistry().registerFileBlobURL(url, BlobDataFileReference::create(path), contentType);
-    else {
-        callOnMainThread([url = url.isolatedCopy(), path = path.isolatedCopy(), contentType = contentType.isolatedCopy()] {
-            blobRegistry().registerFileBlobURL(url, BlobDataFileReference::create(path), contentType);
-        });
</del><ins>+    if (isMainThread()) {
+        blobRegistry().registerBlobURL(sessionID, url, WTFMove(blobParts), contentType);
+        return;
</ins><span class="cx">     }
</span><ins>+    for (auto& part : blobParts)
+        part.detachFromCurrentThread();
+    callOnMainThread([sessionID, url = url.isolatedCopy(), blobParts = WTFMove(blobParts), contentType = contentType.isolatedCopy()]() mutable {
+        blobRegistry().registerBlobURL(sessionID, url, WTFMove(blobParts), contentType);
+    });
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void ThreadableBlobRegistry::registerBlobURL(const URL& url, Vector<BlobPart>&& blobParts, const String& contentType)
</del><ins>+void ThreadableBlobRegistry::registerBlobURL(PAL::SessionID sessionID, SecurityOrigin* origin, const URL& url, const URL& srcURL)
</ins><span class="cx"> {
</span><del>-    if (isMainThread())
-        blobRegistry().registerBlobURL(url, WTFMove(blobParts), contentType);
-    else {
-        for (auto& part : blobParts)
-            part.detachFromCurrentThread();
-        callOnMainThread([url = url.isolatedCopy(), blobParts = WTFMove(blobParts), contentType = contentType.isolatedCopy()]() mutable {
-            blobRegistry().registerBlobURL(url, WTFMove(blobParts), contentType);
-        });
-    }
-}
-
-void ThreadableBlobRegistry::registerBlobURL(SecurityOrigin* origin, const URL& url, const URL& srcURL)
-{
</del><span class="cx">     // If the blob URL contains null origin, as in the context with unique security origin or file URL, save the mapping between url and origin so that the origin can be retrived when doing security origin check.
</span><span class="cx">     if (origin && BlobURL::getOrigin(url) == "null")
</span><span class="cx">         originMap()->add(url.string(), origin);
</span><span class="cx"> 
</span><del>-    if (isMainThread())
-        blobRegistry().registerBlobURL(url, srcURL);
-    else {
-        callOnMainThread([url = url.isolatedCopy(), srcURL = srcURL.isolatedCopy()] {
-            blobRegistry().registerBlobURL(url, srcURL);
-        });
</del><ins>+    if (isMainThread()) {
+        blobRegistry().registerBlobURL(sessionID, url, srcURL);
+        return;
</ins><span class="cx">     }
</span><ins>+
+    callOnMainThread([sessionID, url = url.isolatedCopy(), srcURL = srcURL.isolatedCopy()] {
+        blobRegistry().registerBlobURL(sessionID, url, srcURL);
+    });
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void ThreadableBlobRegistry::registerBlobURLOptionallyFileBacked(const URL& url, const URL& srcURL, const String& fileBackedPath, const String& contentType)
</del><ins>+void ThreadableBlobRegistry::registerBlobURLOptionallyFileBacked(PAL::SessionID sessionID, const URL& url, const URL& srcURL, const String& fileBackedPath, const String& contentType)
</ins><span class="cx"> {
</span><del>-    if (isMainThread())
-        blobRegistry().registerBlobURLOptionallyFileBacked(url, srcURL, BlobDataFileReference::create(fileBackedPath), contentType);
-    else
-        postToMainThread(createCrossThreadTask(ThreadableBlobRegistry::registerBlobURLOptionallyFileBacked, url, srcURL, fileBackedPath, contentType));
</del><ins>+    if (isMainThread()) {
+        blobRegistry().registerBlobURLOptionallyFileBacked(sessionID, url, srcURL, BlobDataFileReference::create(fileBackedPath), contentType);
+        return;
+    }
+    callOnMainThread([sessionID, url = url.isolatedCopy(), srcURL = srcURL.isolatedCopy(), fileBackedPath = fileBackedPath.isolatedCopy(), contentType = contentType.isolatedCopy()] {
+        blobRegistry().registerBlobURLOptionallyFileBacked(sessionID, url, srcURL, BlobDataFileReference::create(fileBackedPath), contentType);
+    });
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void ThreadableBlobRegistry::registerBlobURLForSlice(const URL& newURL, const URL& srcURL, long long start, long long end)
</del><ins>+void ThreadableBlobRegistry::registerBlobURLForSlice(PAL::SessionID sessionID, const URL& newURL, const URL& srcURL, long long start, long long end)
</ins><span class="cx"> {
</span><del>-    if (isMainThread())
-        blobRegistry().registerBlobURLForSlice(newURL, srcURL, start, end);
-    else {
-        callOnMainThread([newURL = newURL.isolatedCopy(), srcURL = srcURL.isolatedCopy(), start, end] {
-            blobRegistry().registerBlobURLForSlice(newURL, srcURL, start, end);
-        });
</del><ins>+    if (isMainThread()) {
+        blobRegistry().registerBlobURLForSlice(sessionID, newURL, srcURL, start, end);
+        return;
</ins><span class="cx">     }
</span><ins>+
+    callOnMainThread([sessionID, newURL = newURL.isolatedCopy(), srcURL = srcURL.isolatedCopy(), start, end] {
+        blobRegistry().registerBlobURLForSlice(sessionID, newURL, srcURL, start, end);
+    });
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> unsigned long long ThreadableBlobRegistry::blobSize(const URL& url)
</span><span class="cx"> {
</span><ins>+    if (isMainThread())
+        return blobRegistry().blobSize(url);
+
</ins><span class="cx">     unsigned long long resultSize;
</span><del>-    if (isMainThread())
</del><ins>+    BinarySemaphore semaphore;
+    callOnMainThread([url = url.isolatedCopy(), &semaphore, &resultSize] {
</ins><span class="cx">         resultSize = blobRegistry().blobSize(url);
</span><del>-    else {
-        BinarySemaphore semaphore;
-        callOnMainThread([url = url.isolatedCopy(), &semaphore, &resultSize] {
-            resultSize = blobRegistry().blobSize(url);
-            semaphore.signal();
-        });
-        semaphore.wait();
-    }
</del><ins>+        semaphore.signal();
+    });
+    semaphore.wait();
</ins><span class="cx">     return resultSize;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void ThreadableBlobRegistry::unregisterBlobURL(const URL& url)
</del><ins>+void ThreadableBlobRegistry::unregisterBlobURL(PAL::SessionID sessionID, const URL& url)
</ins><span class="cx"> {
</span><span class="cx">     if (BlobURL::getOrigin(url) == "null")
</span><span class="cx">         originMap()->remove(url.string());
</span><span class="cx"> 
</span><del>-    if (isMainThread())
-        blobRegistry().unregisterBlobURL(url);
-    else {
-        callOnMainThread([url = url.isolatedCopy()] {
-            blobRegistry().unregisterBlobURL(url);
-        });
</del><ins>+    if (isMainThread()) {
+        blobRegistry().unregisterBlobURL(sessionID, url);
+        return;
</ins><span class="cx">     }
</span><ins>+    callOnMainThread([sessionID, url = url.isolatedCopy()] {
+        blobRegistry().unregisterBlobURL(sessionID, url);
+    });
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RefPtr<SecurityOrigin> ThreadableBlobRegistry::getCachedOrigin(const URL& url)
</span></span></pre></div>
<a id="trunkSourceWebCorefileapiThreadableBlobRegistryh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/fileapi/ThreadableBlobRegistry.h (248592 => 248593)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/fileapi/ThreadableBlobRegistry.h    2019-08-13 08:54:27 UTC (rev 248592)
+++ trunk/Source/WebCore/fileapi/ThreadableBlobRegistry.h       2019-08-13 10:06:16 UTC (rev 248593)
</span><span class="lines">@@ -40,12 +40,12 @@
</span><span class="cx"> 
</span><span class="cx"> class ThreadableBlobRegistry {
</span><span class="cx"> public:
</span><del>-    static void registerFileBlobURL(const URL&, const String& path, const String& contentType);
-    static void registerBlobURL(const URL&, Vector<BlobPart>&& blobParts, const String& contentType);
-    static void registerBlobURL(SecurityOrigin*, const URL&, const URL& srcURL);
-    static void registerBlobURLOptionallyFileBacked(const URL&, const URL& srcURL, const String& fileBackedPath, const String& contentType);
-    static void registerBlobURLForSlice(const URL& newURL, const URL& srcURL, long long start, long long end);
-    static void unregisterBlobURL(const URL&);
</del><ins>+    static void registerFileBlobURL(PAL::SessionID, const URL&, const String& path, const String& contentType);
+    static void registerBlobURL(PAL::SessionID, const URL&, Vector<BlobPart>&& blobParts, const String& contentType);
+    static void registerBlobURL(PAL::SessionID, SecurityOrigin*, const URL&, const URL& srcURL);
+    static void registerBlobURLOptionallyFileBacked(PAL::SessionID, const URL&, const URL& srcURL, const String& fileBackedPath, const String& contentType);
+    static void registerBlobURLForSlice(PAL::SessionID, const URL& newURL, const URL& srcURL, long long start, long long end);
+    static void unregisterBlobURL(PAL::SessionID, const URL&);
</ins><span class="cx"> 
</span><span class="cx">     static unsigned long long blobSize(const URL&);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlPublicURLManagercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/PublicURLManager.cpp (248592 => 248593)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/PublicURLManager.cpp   2019-08-13 08:54:27 UTC (rev 248592)
+++ trunk/Source/WebCore/html/PublicURLManager.cpp      2019-08-13 10:06:16 UTC (rev 248593)
</span><span class="lines">@@ -26,8 +26,9 @@
</span><span class="cx"> 
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "PublicURLManager.h"
</span><ins>+
+#include "URLRegistry.h"
</ins><span class="cx"> #include <wtf/URL.h>
</span><del>-#include "URLRegistry.h"
</del><span class="cx"> #include <wtf/text/StringHash.h>
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderPolicyCheckercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/PolicyChecker.cpp (248592 => 248593)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/PolicyChecker.cpp    2019-08-13 08:54:27 UTC (rev 248592)
+++ trunk/Source/WebCore/loader/PolicyChecker.cpp       2019-08-13 10:06:16 UTC (rev 248593)
</span><span class="lines">@@ -106,10 +106,11 @@
</span><span class="cx"> 
</span><span class="cx">     // Create a new temporary blobURL in case this one gets revoked during the asynchronous navigation policy decision.
</span><span class="cx">     URL temporaryBlobURL = BlobURL::createPublicURL(&m_frame.document()->securityOrigin());
</span><del>-    blobRegistry().registerBlobURL(temporaryBlobURL, request.url());
</del><ins>+    auto sessionID = m_frame.document()->sessionID();
+    blobRegistry().registerBlobURL(sessionID, temporaryBlobURL, request.url());
</ins><span class="cx">     request.setURL(temporaryBlobURL);
</span><del>-    return CompletionHandler<void()>([temporaryBlobURL = WTFMove(temporaryBlobURL)] {
-        blobRegistry().unregisterBlobURL(temporaryBlobURL);
</del><ins>+    return CompletionHandler<void()>([sessionID, temporaryBlobURL = WTFMove(temporaryBlobURL)] {
+        blobRegistry().unregisterBlobURL(sessionID, temporaryBlobURL);
</ins><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkBlobRegistryh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/BlobRegistry.h (248592 => 248593)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/BlobRegistry.h     2019-08-13 08:54:27 UTC (rev 248592)
+++ trunk/Source/WebCore/platform/network/BlobRegistry.h        2019-08-13 10:06:16 UTC (rev 248593)
</span><span class="lines">@@ -31,6 +31,7 @@
</span><span class="cx"> 
</span><span class="cx"> #pragma once
</span><span class="cx"> 
</span><ins>+#include <pal/SessionID.h>
</ins><span class="cx"> #include <wtf/Forward.h>
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -38,6 +39,7 @@
</span><span class="cx"> class BlobDataFileReference;
</span><span class="cx"> class BlobPart;
</span><span class="cx"> class BlobRegistry;
</span><ins>+class BlobRegistryImpl;
</ins><span class="cx"> 
</span><span class="cx"> WEBCORE_EXPORT BlobRegistry& blobRegistry();
</span><span class="cx"> 
</span><span class="lines">@@ -46,27 +48,27 @@
</span><span class="cx"> public:
</span><span class="cx"> 
</span><span class="cx">     // Registers a blob URL referring to the specified file.
</span><del>-    virtual void registerFileBlobURL(const URL&, Ref<BlobDataFileReference>&&, const String& contentType) = 0;
</del><ins>+    virtual void registerFileBlobURL(PAL::SessionID, const URL&, Ref<BlobDataFileReference>&&, const String& contentType) = 0;
</ins><span class="cx"> 
</span><span class="cx">     // Registers a blob URL referring to the specified blob data.
</span><del>-    virtual void registerBlobURL(const URL&, Vector<BlobPart>&&, const String& contentType) = 0;
</del><ins>+    virtual void registerBlobURL(PAL::SessionID, const URL&, Vector<BlobPart>&&, const String& contentType) = 0;
</ins><span class="cx">     
</span><span class="cx">     // Registers a new blob URL referring to the blob data identified by the specified srcURL.
</span><del>-    virtual void registerBlobURL(const URL&, const URL& srcURL) = 0;
</del><ins>+    virtual void registerBlobURL(PAL::SessionID, const URL&, const URL& srcURL) = 0;
</ins><span class="cx"> 
</span><span class="cx">     // Registers a new blob URL referring to the blob data identified by the specified srcURL or, if none found, referring to the file found at the given path.
</span><del>-    virtual void registerBlobURLOptionallyFileBacked(const URL&, const URL& srcURL, RefPtr<BlobDataFileReference>&&, const String& contentType) = 0;
</del><ins>+    virtual void registerBlobURLOptionallyFileBacked(PAL::SessionID, const URL&, const URL& srcURL, RefPtr<BlobDataFileReference>&&, const String& contentType) = 0;
</ins><span class="cx"> 
</span><span class="cx">     // Negative start and end values select from the end.
</span><del>-    virtual void registerBlobURLForSlice(const URL&, const URL& srcURL, long long start, long long end) = 0;
</del><ins>+    virtual void registerBlobURLForSlice(PAL::SessionID, const URL&, const URL& srcURL, long long start, long long end) = 0;
</ins><span class="cx"> 
</span><del>-    virtual void unregisterBlobURL(const URL&) = 0;
</del><ins>+    virtual void unregisterBlobURL(PAL::SessionID, const URL&) = 0;
</ins><span class="cx"> 
</span><span class="cx">     virtual unsigned long long blobSize(const URL&) = 0;
</span><span class="cx"> 
</span><del>-    virtual void writeBlobsToTemporaryFiles(const Vector<String>& blobURLs, CompletionHandler<void(Vector<String>&& filePaths)>&&) = 0;
</del><ins>+    virtual void writeBlobsToTemporaryFiles(PAL::SessionID, const Vector<String>& blobURLs, CompletionHandler<void(Vector<String>&& filePaths)>&&) = 0;
</ins><span class="cx"> 
</span><del>-    virtual bool isBlobRegistryImpl() const { return false; }
</del><ins>+    virtual BlobRegistryImpl* blobRegistryImpl() { return nullptr; }
</ins><span class="cx"> 
</span><span class="cx"> protected:
</span><span class="cx">     virtual ~BlobRegistry();
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkBlobRegistryImplcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/BlobRegistryImpl.cpp (248592 => 248593)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/BlobRegistryImpl.cpp       2019-08-13 08:54:27 UTC (rev 248592)
+++ trunk/Source/WebCore/platform/network/BlobRegistryImpl.cpp  2019-08-13 10:06:16 UTC (rev 248593)
</span><span class="lines">@@ -54,12 +54,12 @@
</span><span class="cx"> 
</span><span class="cx"> static Ref<ResourceHandle> createBlobResourceHandle(const ResourceRequest& request, ResourceHandleClient* client)
</span><span class="cx"> {
</span><del>-    return static_cast<BlobRegistryImpl&>(blobRegistry()).createResourceHandle(request, client);
</del><ins>+    return blobRegistry().blobRegistryImpl()->createResourceHandle(request, client);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static void loadBlobResourceSynchronously(NetworkingContext*, const ResourceRequest& request, StoredCredentialsPolicy, ResourceError& error, ResourceResponse& response, Vector<char>& data)
</span><span class="cx"> {
</span><del>-    BlobData* blobData = static_cast<BlobRegistryImpl&>(blobRegistry()).getBlobDataFromURL(request.url());
</del><ins>+    auto* blobData = blobRegistry().blobRegistryImpl()->getBlobDataFromURL(request.url());
</ins><span class="cx">     BlobResourceHandle::loadResourceSynchronously(blobData, request, error, response, data);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -343,4 +343,19 @@
</span><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+Vector<RefPtr<BlobDataFileReference>> BlobRegistryImpl::filesInBlob(const URL& url) const
+{
+    auto* blobData = getBlobDataFromURL(url);
+    if (!blobData)
+        return { };
+
+    Vector<RefPtr<BlobDataFileReference>> result;
+    for (const BlobDataItem& item : blobData->items()) {
+        if (item.type() == BlobDataItem::Type::File)
+            result.append(item.file());
+    }
+
+    return result;
+}
+
</ins><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkBlobRegistryImplh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/BlobRegistryImpl.h (248592 => 248593)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/BlobRegistryImpl.h 2019-08-13 08:54:27 UTC (rev 248592)
+++ trunk/Source/WebCore/platform/network/BlobRegistryImpl.h    2019-08-13 10:06:16 UTC (rev 248593)
</span><span class="lines">@@ -46,7 +46,7 @@
</span><span class="cx"> class ThreadSafeDataBuffer;
</span><span class="cx"> 
</span><span class="cx"> // BlobRegistryImpl is not thread-safe. It should only be called from main thread.
</span><del>-class WEBCORE_EXPORT BlobRegistryImpl final : public BlobRegistry {
</del><ins>+class WEBCORE_EXPORT BlobRegistryImpl {
</ins><span class="cx">     WTF_MAKE_FAST_ALLOCATED;
</span><span class="cx"> public:
</span><span class="cx">     virtual ~BlobRegistryImpl();
</span><span class="lines">@@ -58,17 +58,16 @@
</span><span class="cx"> 
</span><span class="cx">     void appendStorageItems(BlobData*, const BlobDataItemList&, long long offset, long long length);
</span><span class="cx"> 
</span><del>-    void registerFileBlobURL(const URL&, Ref<BlobDataFileReference>&&, const String& contentType) override;
-    void registerBlobURL(const URL&, Vector<BlobPart>&&, const String& contentType) override;
-    void registerBlobURL(const URL&, const URL& srcURL) override;
-    void registerBlobURLOptionallyFileBacked(const URL&, const URL& srcURL, RefPtr<BlobDataFileReference>&&, const String& contentType) override;
-    void registerBlobURLForSlice(const URL&, const URL& srcURL, long long start, long long end) override;
-    void unregisterBlobURL(const URL&) override;
-    bool isBlobRegistryImpl() const override { return true; }
</del><ins>+    void registerFileBlobURL(const URL&, Ref<BlobDataFileReference>&&, const String& contentType);
+    void registerBlobURL(const URL&, Vector<BlobPart>&&, const String& contentType);
+    void registerBlobURL(const URL&, const URL& srcURL);
+    void registerBlobURLOptionallyFileBacked(const URL&, const URL& srcURL, RefPtr<BlobDataFileReference>&&, const String& contentType);
+    void registerBlobURLForSlice(const URL&, const URL& srcURL, long long start, long long end);
+    void unregisterBlobURL(const URL&);
</ins><span class="cx"> 
</span><del>-    unsigned long long blobSize(const URL&) override;
</del><ins>+    unsigned long long blobSize(const URL&);
</ins><span class="cx"> 
</span><del>-    void writeBlobsToTemporaryFiles(const Vector<String>& blobURLs, CompletionHandler<void(Vector<String>&& filePaths)>&&) override;
</del><ins>+    void writeBlobsToTemporaryFiles(const Vector<String>& blobURLs, CompletionHandler<void(Vector<String>&& filePaths)>&&);
</ins><span class="cx"> 
</span><span class="cx">     struct BlobForFileWriting {
</span><span class="cx">         String blobURL;
</span><span class="lines">@@ -76,6 +75,7 @@
</span><span class="cx">     };
</span><span class="cx"> 
</span><span class="cx">     bool populateBlobsForFileWriting(const Vector<String>& blobURLs, Vector<BlobForFileWriting>&);
</span><ins>+    Vector<RefPtr<BlobDataFileReference>> filesInBlob(const URL&) const;
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     HashMap<String, RefPtr<BlobData>> m_blobs;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkFormDatacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/FormData.cpp (248592 => 248593)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/FormData.cpp       2019-08-13 08:54:27 UTC (rev 248592)
+++ trunk/Source/WebCore/platform/network/FormData.cpp  2019-08-13 10:06:16 UTC (rev 248593)
</span><span class="lines">@@ -286,14 +286,14 @@
</span><span class="cx">     return Latin1Encoding().decode(reinterpret_cast<const char*>(bytes.data()), bytes.size());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static void appendBlobResolved(BlobRegistry& blobRegistry, FormData& formData, const URL& url)
</del><ins>+static void appendBlobResolved(BlobRegistryImpl* blobRegistry, FormData& formData, const URL& url)
</ins><span class="cx"> {
</span><del>-    if (!blobRegistry.isBlobRegistryImpl()) {
</del><ins>+    if (!blobRegistry) {
</ins><span class="cx">         LOG_ERROR("Tried to resolve a blob without a usable registry");
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    auto* blobData = static_cast<BlobRegistryImpl&>(blobRegistry).getBlobDataFromURL(url);
</del><ins>+    auto* blobData = blobRegistry->getBlobDataFromURL(url);
</ins><span class="cx">     if (!blobData) {
</span><span class="cx">         LOG_ERROR("Could not get blob data from a registry");
</span><span class="cx">         return;
</span><span class="lines">@@ -310,7 +310,7 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-Ref<FormData> FormData::resolveBlobReferences(BlobRegistry& blobRegistry)
</del><ins>+Ref<FormData> FormData::resolveBlobReferences(BlobRegistryImpl* blobRegistry)
</ins><span class="cx"> {
</span><span class="cx">     // First check if any blobs needs to be resolved, or we can take the fast path.
</span><span class="cx">     bool hasBlob = false;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkFormDatah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/FormData.h (248592 => 248593)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/FormData.h 2019-08-13 08:54:27 UTC (rev 248592)
+++ trunk/Source/WebCore/platform/network/FormData.h    2019-08-13 10:06:16 UTC (rev 248593)
</span><span class="lines">@@ -29,7 +29,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-class BlobRegistry;
</del><ins>+class BlobRegistryImpl;
</ins><span class="cx"> class DOMFormData;
</span><span class="cx"> class File;
</span><span class="cx"> class SharedBuffer;
</span><span class="lines">@@ -219,7 +219,7 @@
</span><span class="cx"> 
</span><span class="cx">     // Resolve all blob references so we only have file and data.
</span><span class="cx">     // If the FormData has no blob references to resolve, this is returned.
</span><del>-    WEBCORE_EXPORT Ref<FormData> resolveBlobReferences(BlobRegistry&);
</del><ins>+    WEBCORE_EXPORT Ref<FormData> resolveBlobReferences(BlobRegistryImpl*);
</ins><span class="cx"> 
</span><span class="cx">     WEBCORE_EXPORT FormDataForUpload prepareForUpload();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkcfFormDataStreamCFNetcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/cf/FormDataStreamCFNet.cpp (248592 => 248593)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/cf/FormDataStreamCFNet.cpp 2019-08-13 08:54:27 UTC (rev 248592)
+++ trunk/Source/WebCore/platform/network/cf/FormDataStreamCFNet.cpp    2019-08-13 10:06:16 UTC (rev 248593)
</span><span class="lines">@@ -372,7 +372,7 @@
</span><span class="cx"> 
</span><span class="cx"> RetainPtr<CFReadStreamRef> createHTTPBodyCFReadStream(FormData& formData)
</span><span class="cx"> {
</span><del>-    auto resolvedFormData = formData.resolveBlobReferences(blobRegistry());
</del><ins>+    auto resolvedFormData = formData.resolveBlobReferences(blobRegistry().blobRegistryImpl());
</ins><span class="cx">     auto dataForUpload = resolvedFormData->prepareForUpload();
</span><span class="cx"> 
</span><span class="cx">     // Precompute the content length so CFNetwork doesn't use chunked mode.
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkcurlCurlFormDataStreamcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/curl/CurlFormDataStream.cpp (248592 => 248593)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/curl/CurlFormDataStream.cpp        2019-08-13 08:54:27 UTC (rev 248592)
+++ trunk/Source/WebCore/platform/network/curl/CurlFormDataStream.cpp   2019-08-13 10:06:16 UTC (rev 248593)
</span><span class="lines">@@ -51,7 +51,7 @@
</span><span class="cx">     m_formData = formData->isolatedCopy();
</span><span class="cx"> 
</span><span class="cx">     // Resolve the blob elements so the formData can correctly report it's size.
</span><del>-    m_formData = m_formData->resolveBlobReferences(blobRegistry());
</del><ins>+    m_formData = m_formData->resolveBlobReferences(blobRegistry().blobRegistryImpl());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> CurlFormDataStream::~CurlFormDataStream()
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworksoupResourceRequesth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/soup/ResourceRequest.h (248592 => 248593)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/soup/ResourceRequest.h     2019-08-13 08:54:27 UTC (rev 248592)
+++ trunk/Source/WebCore/platform/network/soup/ResourceRequest.h        2019-08-13 10:06:16 UTC (rev 248593)
</span><span class="lines">@@ -33,6 +33,8 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+    class BlobRegistryImpl;
+
</ins><span class="cx">     class ResourceRequest : public ResourceRequestBase {
</span><span class="cx">     public:
</span><span class="cx">         ResourceRequest(const String& url)
</span><span class="lines">@@ -87,7 +89,7 @@
</span><span class="cx"> 
</span><span class="cx">         void updateSoupMessageHeaders(SoupMessageHeaders*) const;
</span><span class="cx">         void updateFromSoupMessageHeaders(SoupMessageHeaders*);
</span><del>-        void updateSoupMessage(SoupMessage*) const;
</del><ins>+        void updateSoupMessage(SoupMessage*, BlobRegistryImpl&) const;
</ins><span class="cx">         void updateFromSoupMessage(SoupMessage*);
</span><span class="cx">         void updateSoupRequest(SoupRequest*) const;
</span><span class="cx">         void updateFromSoupRequest(SoupRequest*);
</span><span class="lines">@@ -111,7 +113,7 @@
</span><span class="cx">         Optional<PageIdentifier> m_initiatingPageID;
</span><span class="cx"> 
</span><span class="cx">         void updateSoupMessageMembers(SoupMessage*) const;
</span><del>-        void updateSoupMessageBody(SoupMessage*) const;
</del><ins>+        void updateSoupMessageBody(SoupMessage*, BlobRegistryImpl&) const;
</ins><span class="cx">         void doUpdatePlatformRequest() { }
</span><span class="cx">         void doUpdateResourceRequest() { }
</span><span class="cx">         void doUpdatePlatformHTTPBody() { }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworksoupResourceRequestSoupcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/soup/ResourceRequestSoup.cpp (248592 => 248593)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/soup/ResourceRequestSoup.cpp       2019-08-13 08:54:27 UTC (rev 248592)
+++ trunk/Source/WebCore/platform/network/soup/ResourceRequestSoup.cpp  2019-08-13 10:06:16 UTC (rev 248593)
</span><span class="lines">@@ -68,7 +68,7 @@
</span><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void ResourceRequest::updateSoupMessageBody(SoupMessage* soupMessage) const
</del><ins>+void ResourceRequest::updateSoupMessageBody(SoupMessage* soupMessage, BlobRegistryImpl& blobRegistry) const
</ins><span class="cx"> {
</span><span class="cx">     auto* formData = httpBody();
</span><span class="cx">     if (!formData || formData->isEmpty())
</span><span class="lines">@@ -92,7 +92,7 @@
</span><span class="cx">                         soup_message_body_append_buffer(soupMessage->request_body, soupBuffer.get());
</span><span class="cx">                 }
</span><span class="cx">             }, [&] (const FormDataElement::EncodedBlobData& blob) {
</span><del>-                if (auto* blobData = static_cast<BlobRegistryImpl&>(blobRegistry()).getBlobDataFromURL(blob.url)) {
</del><ins>+                if (auto* blobData = blobRegistry.getBlobDataFromURL(blob.url)) {
</ins><span class="cx">                     for (const auto& item : blobData->items())
</span><span class="cx">                         bodySize += appendEncodedBlobItemToSoupMessageBody(soupMessage, item);
</span><span class="cx">                 }
</span><span class="lines">@@ -140,7 +140,7 @@
</span><span class="cx">         m_httpHeaderFields.set(String(headerName), String(headerValue));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void ResourceRequest::updateSoupMessage(SoupMessage* soupMessage) const
</del><ins>+void ResourceRequest::updateSoupMessage(SoupMessage* soupMessage, BlobRegistryImpl& blobRegistry) const
</ins><span class="cx"> {
</span><span class="cx">     g_object_set(soupMessage, SOUP_MESSAGE_METHOD, httpMethod().ascii().data(), NULL);
</span><span class="cx"> 
</span><span class="lines">@@ -148,7 +148,7 @@
</span><span class="cx">     soup_message_set_uri(soupMessage, uri.get());
</span><span class="cx"> 
</span><span class="cx">     updateSoupMessageMembers(soupMessage);
</span><del>-    updateSoupMessageBody(soupMessage);
</del><ins>+    updateSoupMessageBody(soupMessage, blobRegistry);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void ResourceRequest::updateFromSoupMessage(SoupMessage* soupMessage)
</span></span></pre></div>
<a id="trunkSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ChangeLog (248592 => 248593)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ChangeLog    2019-08-13 08:54:27 UTC (rev 248592)
+++ trunk/Source/WebKit/ChangeLog       2019-08-13 10:06:16 UTC (rev 248593)
</span><span class="lines">@@ -1,5 +1,63 @@
</span><span class="cx"> 2019-08-13  Youenn Fablet  <youenn@apple.com>
</span><span class="cx"> 
</span><ins>+        Blob registries should be keyed by session IDs
+        https://bugs.webkit.org/show_bug.cgi?id=200567
+        <rdar://problem/54120212>
+
+        Reviewed by Alex Christensen.
+
+        Move blob registry to NetworkSession so that it is partitioned by session ID.
+        In case session ID is not given through IPC, use the connection as key to get the network session.
+        This is used for blobSize.
+
+        * NetworkProcess/Downloads/DownloadManager.cpp:
+        (WebKit::DownloadManager::startDownload):
+        * NetworkProcess/Downloads/DownloadManager.h:
+        * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
+        * NetworkProcess/FileAPI/NetworkBlobRegistry.h: Removed.
+        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
+        (WebKit::NetworkConnectionToWebProcess::didClose):
+        (WebKit::NetworkConnectionToWebProcess::resolveBlobReferences):
+        (WebKit::NetworkConnectionToWebProcess::registerFileBlobURL):
+        (WebKit::NetworkConnectionToWebProcess::registerBlobURL):
+        (WebKit::NetworkConnectionToWebProcess::registerBlobURLFromURL):
+        (WebKit::NetworkConnectionToWebProcess::registerBlobURLOptionallyFileBacked):
+        (WebKit::NetworkConnectionToWebProcess::registerBlobURLForSlice):
+        (WebKit::NetworkConnectionToWebProcess::unregisterBlobURL):
+        (WebKit::NetworkConnectionToWebProcess::blobSize):
+        (WebKit::NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles):
+        (WebKit::NetworkConnectionToWebProcess::filesInBlob):
+        * NetworkProcess/NetworkConnectionToWebProcess.h:
+        * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
+        * NetworkProcess/NetworkProcess.cpp:
+        (WebKit::NetworkProcess::blobRegistry):
+        * NetworkProcess/NetworkProcess.h:
+        * NetworkProcess/NetworkProcessPlatformStrategies.cpp:
+        (WebKit::NetworkProcessPlatformStrategies::createBlobRegistry):
+        * NetworkProcess/NetworkResourceLoader.cpp:
+        (WebKit::NetworkResourceLoader::startNetworkLoad):
+        * NetworkProcess/NetworkSession.h:
+        (WebKit::NetworkSession::blobRegistry):
+        * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
+        (WebKit::NetworkDataTaskSoup::createRequest):
+        * NetworkProcess/soup/NetworkSessionSoup.cpp:
+        (WebKit::NetworkSessionSoup::createWebSocketTask):
+        * Sources.txt:
+        * WebKit.xcodeproj/project.pbxproj:
+        * WebProcess/FileAPI/BlobRegistryProxy.cpp:
+        (WebKit::BlobRegistryProxy::registerFileBlobURL):
+        (WebKit::BlobRegistryProxy::registerBlobURL):
+        (WebKit::BlobRegistryProxy::registerBlobURLOptionallyFileBacked):
+        (WebKit::BlobRegistryProxy::unregisterBlobURL):
+        (WebKit::BlobRegistryProxy::registerBlobURLForSlice):
+        (WebKit::BlobRegistryProxy::writeBlobsToTemporaryFiles):
+        * WebProcess/FileAPI/BlobRegistryProxy.h:
+        * WebProcess/Network/NetworkProcessConnection.cpp:
+        (WebKit::NetworkProcessConnection::writeBlobsToTemporaryFiles):
+        * WebProcess/Network/NetworkProcessConnection.h:
+
+2019-08-13  Youenn Fablet  <youenn@apple.com>
+
</ins><span class="cx">         User Agent and SessionID should be given to NetworkRTCProvider to set up the correct proxy information
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=200583
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcessDownloadsDownloadManagercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/Downloads/DownloadManager.cpp (248592 => 248593)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/Downloads/DownloadManager.cpp 2019-08-13 08:54:27 UTC (rev 248592)
+++ trunk/Source/WebKit/NetworkProcess/Downloads/DownloadManager.cpp    2019-08-13 10:06:16 UTC (rev 248593)
</span><span class="lines">@@ -27,7 +27,6 @@
</span><span class="cx"> #include "DownloadManager.h"
</span><span class="cx"> 
</span><span class="cx"> #include "Download.h"
</span><del>-#include "NetworkBlobRegistry.h"
</del><span class="cx"> #include "NetworkConnectionToWebProcess.h"
</span><span class="cx"> #include "NetworkLoad.h"
</span><span class="cx"> #include "NetworkSession.h"
</span><span class="lines">@@ -55,10 +54,10 @@
</span><span class="cx">     parameters.request = request;
</span><span class="cx">     parameters.clientCredentialPolicy = ClientCredentialPolicy::MayAskClientForCredentials;
</span><span class="cx">     if (request.url().protocolIsBlob())
</span><del>-        parameters.blobFileReferences = client().networkBlobRegistry().filesInBlob(request.url());
</del><ins>+        parameters.blobFileReferences = client().networkSession(sessionID)->blobRegistry().filesInBlob(request.url());
</ins><span class="cx">     parameters.storedCredentialsPolicy = sessionID.isEphemeral() ? StoredCredentialsPolicy::DoNotUse : StoredCredentialsPolicy::Use;
</span><span class="cx"> 
</span><del>-    m_pendingDownloads.add(downloadID, std::make_unique<PendingDownload>(m_client.parentProcessConnectionForDownloads(), WTFMove(parameters), downloadID, *networkSession, &client().networkBlobRegistry().blobRegistry(), suggestedName));
</del><ins>+    m_pendingDownloads.add(downloadID, std::make_unique<PendingDownload>(m_client.parentProcessConnectionForDownloads(), WTFMove(parameters), downloadID, *networkSession, &client().networkSession(sessionID)->blobRegistry(), suggestedName));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void DownloadManager::dataTaskBecameDownloadTask(DownloadID downloadID, std::unique_ptr<Download>&& download)
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcessDownloadsDownloadManagerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/Downloads/DownloadManager.h (248592 => 248593)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/Downloads/DownloadManager.h   2019-08-13 08:54:27 UTC (rev 248592)
+++ trunk/Source/WebKit/NetworkProcess/Downloads/DownloadManager.h      2019-08-13 10:06:16 UTC (rev 248593)
</span><span class="lines">@@ -55,7 +55,6 @@
</span><span class="cx"> 
</span><span class="cx"> class AuthenticationManager;
</span><span class="cx"> class Download;
</span><del>-class NetworkBlobRegistry;
</del><span class="cx"> class NetworkConnectionToWebProcess;
</span><span class="cx"> class NetworkLoad;
</span><span class="cx"> class PendingDownload;
</span><span class="lines">@@ -75,7 +74,6 @@
</span><span class="cx">         virtual AuthenticationManager& downloadsAuthenticationManager() = 0;
</span><span class="cx">         virtual void pendingDownloadCanceled(DownloadID) = 0;
</span><span class="cx">         virtual NetworkSession* networkSession(const PAL::SessionID&) const = 0;
</span><del>-        virtual NetworkBlobRegistry& networkBlobRegistry() = 0;
</del><span class="cx">         virtual void ref() const = 0;
</span><span class="cx">         virtual void deref() const = 0;
</span><span class="cx">         virtual uint32_t downloadMonitorSpeedMultiplier() const = 0;
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcessFileAPINetworkBlobRegistrycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/FileAPI/NetworkBlobRegistry.cpp (248592 => 248593)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/FileAPI/NetworkBlobRegistry.cpp       2019-08-13 08:54:27 UTC (rev 248592)
+++ trunk/Source/WebKit/NetworkProcess/FileAPI/NetworkBlobRegistry.cpp  2019-08-13 10:06:16 UTC (rev 248593)
</span><span class="lines">@@ -166,20 +166,4 @@
</span><span class="cx">     return filesInBlob(url);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-Vector<RefPtr<BlobDataFileReference>> NetworkBlobRegistry::filesInBlob(const URL& url)
-{
-    ASSERT(m_blobRegistry.isBlobRegistryImpl());
-    BlobData* blobData = m_blobRegistry.getBlobDataFromURL(url);
-    if (!blobData)
-        return { };
-
-    Vector<RefPtr<BlobDataFileReference>> result;
-    for (const BlobDataItem& item : blobData->items()) {
-        if (item.type() == BlobDataItem::Type::File)
-            result.append(item.file());
-    }
-
-    return result;
</del><span class="cx"> }
</span><del>-
-}
</del></span></pre></div>
<a id="trunkSourceWebKitNetworkProcessFileAPINetworkBlobRegistryh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebKit/NetworkProcess/FileAPI/NetworkBlobRegistry.h (248592 => 248593)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/FileAPI/NetworkBlobRegistry.h 2019-08-13 08:54:27 UTC (rev 248592)
+++ trunk/Source/WebKit/NetworkProcess/FileAPI/NetworkBlobRegistry.h    2019-08-13 10:06:16 UTC (rev 248593)
</span><span class="lines">@@ -1,73 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013-2016 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-#include <WebCore/BlobRegistryImpl.h>
-#include <wtf/Function.h>
-#include <wtf/HashMap.h>
-#include <wtf/HashSet.h>
-#include <wtf/URLHash.h>
-
-namespace WebCore {
-class BlobDataFileReference;
-class BlobPart;
-}
-
-namespace WebKit {
-
-class NetworkConnectionToWebProcess;
-class SandboxExtension;
-
-class NetworkBlobRegistry {
-WTF_MAKE_NONCOPYABLE(NetworkBlobRegistry);
-public:
-    NetworkBlobRegistry();
-    ~NetworkBlobRegistry();
-
-    void registerFileBlobURL(NetworkConnectionToWebProcess&, const URL&, const String& path, RefPtr<SandboxExtension>&&, const String& contentType);
-    void registerBlobURL(NetworkConnectionToWebProcess&, const URL&, Vector<WebCore::BlobPart>&&, const String& contentType);
-    void registerBlobURL(NetworkConnectionToWebProcess&, const URL&, const URL& srcURL, bool shouldBypassConnectionCheck);
-    void registerBlobURLOptionallyFileBacked(NetworkConnectionToWebProcess&, const URL&, const URL& srcURL, const String& fileBackedPath, const String& contentType);
-    void registerBlobURLForSlice(NetworkConnectionToWebProcess&, const URL&, const URL& srcURL, int64_t start, int64_t end);
-    void unregisterBlobURL(NetworkConnectionToWebProcess&, const URL&);
-    uint64_t blobSize(NetworkConnectionToWebProcess&, const URL&);
-    void writeBlobsToTemporaryFiles(const Vector<String>& blobURLs, CompletionHandler<void(Vector<String>&&)>&&);
-    void writeBlobToFilePath(const URL& blobURL, const String& path, CompletionHandler<void(bool success)>&&);
-
-    void connectionToWebProcessDidClose(NetworkConnectionToWebProcess&);
-
-    Vector<RefPtr<WebCore::BlobDataFileReference>> filesInBlob(NetworkConnectionToWebProcess&, const URL&);
-    Vector<RefPtr<WebCore::BlobDataFileReference>> filesInBlob(const URL&);
-    
-    WebCore::BlobRegistryImpl& blobRegistry() { return m_blobRegistry; }
-
-private:
-    typedef HashMap<NetworkConnectionToWebProcess*, HashSet<URL>> BlobForConnectionMap;
-    BlobForConnectionMap m_blobsForConnection;
-    WebCore::BlobRegistryImpl m_blobRegistry;
-};
-
-}
</del></span></pre></div>
<a id="trunkSourceWebKitNetworkProcessNetworkConnectionToWebProcesscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp (248592 => 248593)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp     2019-08-13 08:54:27 UTC (rev 248592)
+++ trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp        2019-08-13 10:06:16 UTC (rev 248593)
</span><span class="lines">@@ -301,7 +301,6 @@
</span><span class="cx"> 
</span><span class="cx">     m_networkProcess->webProcessWasDisconnected(connection);
</span><span class="cx"> 
</span><del>-    m_networkProcess->networkBlobRegistry().connectionToWebProcessDidClose(*this);
</del><span class="cx">     m_networkProcess->removeNetworkConnectionToWebProcess(*this);
</span><span class="cx"> 
</span><span class="cx"> #if USE(LIBWEBRTC)
</span><span class="lines">@@ -374,13 +373,19 @@
</span><span class="cx"> 
</span><span class="cx"> Vector<RefPtr<WebCore::BlobDataFileReference>> NetworkConnectionToWebProcess::resolveBlobReferences(const NetworkResourceLoadParameters& parameters)
</span><span class="cx"> {
</span><ins>+    auto* session = networkProcess().networkSession(parameters.sessionID);
+    if (!session)
+        return { };
+
+    auto& blobRegistry = session->blobRegistry();
+
</ins><span class="cx">     Vector<RefPtr<WebCore::BlobDataFileReference>> files;
</span><span class="cx">     if (auto* body = parameters.request.httpBody()) {
</span><span class="cx">         for (auto& element : body->elements()) {
</span><span class="cx">             if (auto* blobData = WTF::get_if<FormDataElement::EncodedBlobData>(element.data))
</span><del>-                files.appendVector(m_networkProcess->networkBlobRegistry().filesInBlob(*this, blobData->url));
</del><ins>+                files.appendVector(blobRegistry.filesInBlob(blobData->url));
</ins><span class="cx">         }
</span><del>-        const_cast<WebCore::ResourceRequest&>(parameters.request).setHTTPBody(body->resolveBlobReferences(m_networkProcess->networkBlobRegistry().blobRegistry()));
</del><ins>+        const_cast<WebCore::ResourceRequest&>(parameters.request).setHTTPBody(body->resolveBlobReferences(&blobRegistry));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     return files;
</span><span class="lines">@@ -568,51 +573,83 @@
</span><span class="cx">     storageSession(networkProcess(), sessionID).deleteCookie(url, cookieName);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void NetworkConnectionToWebProcess::registerFileBlobURL(const URL& url, const String& path, SandboxExtension::Handle&& extensionHandle, const String& contentType)
</del><ins>+void NetworkConnectionToWebProcess::registerFileBlobURL(PAL::SessionID sessionID, const URL& url, const String& path, SandboxExtension::Handle&& extensionHandle, const String& contentType)
</ins><span class="cx"> {
</span><del>-    m_networkProcess->networkBlobRegistry().registerFileBlobURL(*this, url, path, SandboxExtension::create(WTFMove(extensionHandle)), contentType);
</del><ins>+    auto* session = networkProcess().networkSession(sessionID);
+    if (!session)
+        return;
+
+    session->blobRegistry().registerFileBlobURL(url, BlobDataFileReferenceWithSandboxExtension::create(path, SandboxExtension::create(WTFMove(extensionHandle))), contentType);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void NetworkConnectionToWebProcess::registerBlobURL(const URL& url, Vector<BlobPart>&& blobParts, const String& contentType)
</del><ins>+void NetworkConnectionToWebProcess::registerBlobURL(PAL::SessionID sessionID, const URL& url, Vector<BlobPart>&& blobParts, const String& contentType)
</ins><span class="cx"> {
</span><del>-    m_networkProcess->networkBlobRegistry().registerBlobURL(*this, url, WTFMove(blobParts), contentType);
</del><ins>+    auto* session = networkProcess().networkSession(sessionID);
+    if (!session)
+        return;
+
+    session->blobRegistry().registerBlobURL(url, WTFMove(blobParts), contentType);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void NetworkConnectionToWebProcess::registerBlobURLFromURL(const URL& url, const URL& srcURL, bool shouldBypassConnectionCheck)
</del><ins>+void NetworkConnectionToWebProcess::registerBlobURLFromURL(PAL::SessionID sessionID, const URL& url, const URL& srcURL)
</ins><span class="cx"> {
</span><del>-    m_networkProcess->networkBlobRegistry().registerBlobURL(*this, url, srcURL, shouldBypassConnectionCheck);
</del><ins>+    auto* session = networkProcess().networkSession(sessionID);
+    if (!session)
+        return;
+
+    session->blobRegistry().registerBlobURL(url, srcURL);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void NetworkConnectionToWebProcess::registerBlobURLOptionallyFileBacked(const URL& url, const URL& srcURL, const String& fileBackedPath, const String& contentType)
</del><ins>+void NetworkConnectionToWebProcess::registerBlobURLOptionallyFileBacked(PAL::SessionID sessionID, const URL& url, const URL& srcURL, const String& fileBackedPath, const String& contentType)
</ins><span class="cx"> {
</span><del>-    m_networkProcess->networkBlobRegistry().registerBlobURLOptionallyFileBacked(*this, url, srcURL, fileBackedPath, contentType);
</del><ins>+    auto* session = networkProcess().networkSession(sessionID);
+    if (!session)
+        return;
+
+    session->blobRegistry().registerBlobURLOptionallyFileBacked(url, srcURL, BlobDataFileReferenceWithSandboxExtension::create(fileBackedPath, nullptr), contentType);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void NetworkConnectionToWebProcess::registerBlobURLForSlice(const URL& url, const URL& srcURL, int64_t start, int64_t end)
</del><ins>+void NetworkConnectionToWebProcess::registerBlobURLForSlice(PAL::SessionID sessionID, const URL& url, const URL& srcURL, int64_t start, int64_t end)
</ins><span class="cx"> {
</span><del>-    m_networkProcess->networkBlobRegistry().registerBlobURLForSlice(*this, url, srcURL, start, end);
</del><ins>+    auto* session = networkProcess().networkSession(sessionID);
+    if (!session)
+        return;
+
+    session->blobRegistry().registerBlobURLForSlice(url, srcURL, start, end);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void NetworkConnectionToWebProcess::unregisterBlobURL(const URL& url)
</del><ins>+void NetworkConnectionToWebProcess::unregisterBlobURL(PAL::SessionID sessionID, const URL& url)
</ins><span class="cx"> {
</span><del>-    m_networkProcess->networkBlobRegistry().unregisterBlobURL(*this, url);
</del><ins>+    auto* session = networkProcess().networkSession(sessionID);
+    if (!session)
+        return;
+
+    session->blobRegistry().unregisterBlobURL(url);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void NetworkConnectionToWebProcess::blobSize(const URL& url, CompletionHandler<void(uint64_t)>&& completionHandler)
</span><span class="cx"> {
</span><del>-    completionHandler(m_networkProcess->networkBlobRegistry().blobSize(*this, url));
</del><ins>+    auto* blobRegistry = networkProcess().blobRegistry(*this);
+    if (!blobRegistry)
+        return;
+
+    completionHandler(blobRegistry->blobSize(url));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles(const Vector<String>& blobURLs, CompletionHandler<void(Vector<String>&&)>&& completionHandler)
</del><ins>+void NetworkConnectionToWebProcess::writeBlobsToTemporaryFiles(PAL::SessionID sessionID, const Vector<String>& blobURLs, CompletionHandler<void(Vector<String>&&)>&& completionHandler)
</ins><span class="cx"> {
</span><ins>+    auto* session = networkProcess().networkSession(sessionID);
+    if (!session)
+        return;
+
</ins><span class="cx">     Vector<RefPtr<BlobDataFileReference>> fileReferences;
</span><span class="cx">     for (auto& url : blobURLs)
</span><del>-        fileReferences.appendVector(m_networkProcess->networkBlobRegistry().filesInBlob(*this, { { }, url }));
</del><ins>+        fileReferences.appendVector(session->blobRegistry().filesInBlob({ { }, url }));
</ins><span class="cx"> 
</span><span class="cx">     for (auto& file : fileReferences)
</span><span class="cx">         file->prepareForFileAccess();
</span><span class="cx"> 
</span><del>-    m_networkProcess->networkBlobRegistry().writeBlobsToTemporaryFiles(blobURLs, [fileReferences = WTFMove(fileReferences), completionHandler = WTFMove(completionHandler)](auto&& fileNames) mutable {
</del><ins>+    session->blobRegistry().writeBlobsToTemporaryFiles(blobURLs, [fileReferences = WTFMove(fileReferences), completionHandler = WTFMove(completionHandler)](auto&& fileNames) mutable {
</ins><span class="cx">         for (auto& file : fileReferences)
</span><span class="cx">             file->revokeFileAccess();
</span><span class="cx">         completionHandler(WTFMove(fileNames));
</span><span class="lines">@@ -619,16 +656,6 @@
</span><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-Vector<RefPtr<WebCore::BlobDataFileReference>> NetworkConnectionToWebProcess::filesInBlob(const URL& url)
-{
-    return m_networkProcess->networkBlobRegistry().filesInBlob(*this, url);
-}
-
-WebCore::BlobRegistryImpl& NetworkConnectionToWebProcess::blobRegistry()
-{
-    return m_networkProcess->networkBlobRegistry().blobRegistry();
-}
-
</del><span class="cx"> void NetworkConnectionToWebProcess::setCaptureExtraNetworkLoadMetricsEnabled(bool enabled)
</span><span class="cx"> {
</span><span class="cx">     m_captureExtraNetworkLoadMetricsEnabled = enabled;
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcessNetworkConnectionToWebProcessh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h (248592 => 248593)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h       2019-08-13 08:54:27 UTC (rev 248592)
+++ trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h  2019-08-13 10:06:16 UTC (rev 248593)
</span><span class="lines">@@ -138,8 +138,6 @@
</span><span class="cx">     Optional<NetworkActivityTracker> startTrackingResourceLoad(WebCore::PageIdentifier, ResourceLoadIdentifier resourceID, bool isMainResource, const PAL::SessionID&);
</span><span class="cx">     void stopTrackingResourceLoad(ResourceLoadIdentifier resourceID, NetworkActivityTracker::CompletionCode);
</span><span class="cx"> 
</span><del>-    WebCore::BlobRegistryImpl& blobRegistry();
-    Vector<RefPtr<WebCore::BlobDataFileReference>> filesInBlob(const URL&);
</del><span class="cx">     Vector<RefPtr<WebCore::BlobDataFileReference>> resolveBlobReferences(const NetworkResourceLoadParameters&);
</span><span class="cx"> 
</span><span class="cx">     void webPageWasAdded(PAL::SessionID, WebCore::PageIdentifier, WebCore::PageIdentifier oldPageID);
</span><span class="lines">@@ -183,14 +181,14 @@
</span><span class="cx">     void getRawCookies(PAL::SessionID, const URL& firstParty, const WebCore::SameSiteInfo&, const URL&, Optional<uint64_t> frameID, Optional<WebCore::PageIdentifier>, CompletionHandler<void(Vector<WebCore::Cookie>&&)>&&);
</span><span class="cx">     void deleteCookie(PAL::SessionID, const URL&, const String& cookieName);
</span><span class="cx"> 
</span><del>-    void registerFileBlobURL(const URL&, const String& path, SandboxExtension::Handle&&, const String& contentType);
-    void registerBlobURL(const URL&, Vector<WebCore::BlobPart>&&, const String& contentType);
-    void registerBlobURLFromURL(const URL&, const URL& srcURL, bool shouldBypassConnectionCheck);
-    void registerBlobURLOptionallyFileBacked(const URL&, const URL& srcURL, const String& fileBackedPath, const String& contentType);
-    void registerBlobURLForSlice(const URL&, const URL& srcURL, int64_t start, int64_t end);
</del><ins>+    void registerFileBlobURL(PAL::SessionID, const URL&, const String& path, SandboxExtension::Handle&&, const String& contentType);
+    void registerBlobURL(PAL::SessionID, const URL&, Vector<WebCore::BlobPart>&&, const String& contentType);
+    void registerBlobURLFromURL(PAL::SessionID, const URL&, const URL& srcURL);
+    void registerBlobURLOptionallyFileBacked(PAL::SessionID, const URL&, const URL& srcURL, const String& fileBackedPath, const String& contentType);
+    void registerBlobURLForSlice(PAL::SessionID, const URL&, const URL& srcURL, int64_t start, int64_t end);
</ins><span class="cx">     void blobSize(const URL&, CompletionHandler<void(uint64_t)>&&);
</span><del>-    void unregisterBlobURL(const URL&);
-    void writeBlobsToTemporaryFiles(const Vector<String>& blobURLs, CompletionHandler<void(Vector<String>&&)>&&);
</del><ins>+    void unregisterBlobURL(PAL::SessionID, const URL&);
+    void writeBlobsToTemporaryFiles(PAL::SessionID, const Vector<String>& blobURLs, CompletionHandler<void(Vector<String>&&)>&&);
</ins><span class="cx"> 
</span><span class="cx">     void setCaptureExtraNetworkLoadMetricsEnabled(bool);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcessNetworkConnectionToWebProcessmessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in (248592 => 248593)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in     2019-08-13 08:54:27 UTC (rev 248592)
+++ trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in        2019-08-13 10:06:16 UTC (rev 248593)
</span><span class="lines">@@ -41,14 +41,14 @@
</span><span class="cx">     GetRawCookies(PAL::SessionID sessionID, URL firstParty, struct WebCore::SameSiteInfo sameSiteInfo, URL url, Optional<uint64_t> frameID, Optional<WebCore::PageIdentifier> pageID) -> (Vector<WebCore::Cookie> cookies) Synchronous
</span><span class="cx">     DeleteCookie(PAL::SessionID sessionID, URL url, String cookieName)
</span><span class="cx"> 
</span><del>-    RegisterFileBlobURL(URL url, String path, WebKit::SandboxExtension::Handle extensionHandle, String contentType)
-    RegisterBlobURL(URL url, Vector<WebCore::BlobPart> blobParts, String contentType)
-    RegisterBlobURLFromURL(URL url, URL srcURL, bool shouldBypassConnectionCheck)
-    RegisterBlobURLOptionallyFileBacked(URL url, URL srcURL, String fileBackedPath, String contentType)
-    RegisterBlobURLForSlice(URL url, URL srcURL, int64_t start, int64_t end)
-    UnregisterBlobURL(URL url)
</del><ins>+    RegisterFileBlobURL(PAL::SessionID sessionID, URL url, String path, WebKit::SandboxExtension::Handle extensionHandle, String contentType)
+    RegisterBlobURL(PAL::SessionID sessionID, URL url, Vector<WebCore::BlobPart> blobParts, String contentType)
+    RegisterBlobURLFromURL(PAL::SessionID sessionID, URL url, URL srcURL)
+    RegisterBlobURLOptionallyFileBacked(PAL::SessionID sessionID, URL url, URL srcURL, String fileBackedPath, String contentType)
+    RegisterBlobURLForSlice(PAL::SessionID sessionID, URL url, URL srcURL, int64_t start, int64_t end)
+    UnregisterBlobURL(PAL::SessionID sessionID, URL url)
</ins><span class="cx">     BlobSize(URL url) -> (uint64_t resultSize) Synchronous
</span><del>-    WriteBlobsToTemporaryFiles(Vector<String> blobURLs) -> (Vector<String> fileNames) Async
</del><ins>+    WriteBlobsToTemporaryFiles(PAL::SessionID sessionID, Vector<String> blobURLs) -> (Vector<String> fileNames) Async
</ins><span class="cx"> 
</span><span class="cx">     SetCaptureExtraNetworkLoadMetricsEnabled(bool enabled)
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcessNetworkProcesscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp (248592 => 248593)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp    2019-08-13 08:54:27 UTC (rev 248592)
+++ trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp       2019-08-13 10:06:16 UTC (rev 248593)
</span><span class="lines">@@ -612,6 +612,13 @@
</span><span class="cx">     m_storageQuotaManagers.remove(sessionID);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+BlobRegistryImpl* NetworkProcess::blobRegistry(NetworkConnectionToWebProcess& connection)
+{
+    // FIXME: Deprecate this method and use sessionID -> NetworkSession -> blob registry.
+    auto* session = networkSessionByConnection(connection.connection());
+    return session ? &session->blobRegistry() : nullptr;
+}
+
</ins><span class="cx"> #if ENABLE(RESOURCE_LOAD_STATISTICS)
</span><span class="cx"> void NetworkProcess::dumpResourceLoadStatistics(PAL::SessionID sessionID, CompletionHandler<void(String)>&& completionHandler)
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcessNetworkProcessh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/NetworkProcess.h (248592 => 248593)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/NetworkProcess.h      2019-08-13 08:54:27 UTC (rev 248592)
+++ trunk/Source/WebKit/NetworkProcess/NetworkProcess.h 2019-08-13 10:06:16 UTC (rev 248593)
</span><span class="lines">@@ -29,7 +29,6 @@
</span><span class="cx"> #include "CacheModel.h"
</span><span class="cx"> #include "DownloadManager.h"
</span><span class="cx"> #include "LocalStorageDatabaseTracker.h"
</span><del>-#include "NetworkBlobRegistry.h"
</del><span class="cx"> #include "NetworkContentRuleListManager.h"
</span><span class="cx"> #include "NetworkHTTPSUpgradeChecker.h"
</span><span class="cx"> #include "SandboxExtension.h"
</span><span class="lines">@@ -327,7 +326,7 @@
</span><span class="cx">     void removeCacheEngine(const PAL::SessionID&);
</span><span class="cx">     void requestStorageSpace(PAL::SessionID, const WebCore::ClientOrigin&, uint64_t quota, uint64_t currentSize, uint64_t spaceRequired, CompletionHandler<void(Optional<uint64_t>)>&&);
</span><span class="cx"> 
</span><del>-    NetworkBlobRegistry& networkBlobRegistry() override { return m_networkBlobRegistry; }
</del><ins>+    WebCore::BlobRegistryImpl* blobRegistry(NetworkConnectionToWebProcess&);
</ins><span class="cx"> 
</span><span class="cx">     void storeAdClickAttribution(PAL::SessionID, WebCore::AdClickAttribution&&);
</span><span class="cx">     void dumpAdClickAttribution(PAL::SessionID, CompletionHandler<void(String)>&&);
</span><span class="lines">@@ -498,7 +497,6 @@
</span><span class="cx">     HashMap<PAL::SessionID, std::unique_ptr<NetworkSession>> m_networkSessions;
</span><span class="cx">     HashMap<PAL::SessionID, std::unique_ptr<WebCore::NetworkStorageSession>> m_networkStorageSessions;
</span><span class="cx">     mutable std::unique_ptr<WebCore::NetworkStorageSession> m_defaultNetworkStorageSession;
</span><del>-    NetworkBlobRegistry m_networkBlobRegistry;
</del><span class="cx"> 
</span><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx">     void platformInitializeNetworkProcessCocoa(const NetworkProcessCreationParameters&);
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcessNetworkProcessPlatformStrategiescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/NetworkProcessPlatformStrategies.cpp (248592 => 248593)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/NetworkProcessPlatformStrategies.cpp  2019-08-13 08:54:27 UTC (rev 248592)
+++ trunk/Source/WebKit/NetworkProcess/NetworkProcessPlatformStrategies.cpp     2019-08-13 10:06:16 UTC (rev 248593)
</span><span class="lines">@@ -52,15 +52,14 @@
</span><span class="cx"> {
</span><span class="cx">     using namespace WebCore;
</span><span class="cx">     class EmptyBlobRegistry : public WebCore::BlobRegistry {
</span><del>-        void registerFileBlobURL(const URL&, Ref<BlobDataFileReference>&&, const String& contentType) final { ASSERT_NOT_REACHED(); }
-        void registerBlobURL(const URL&, Vector<BlobPart>&&, const String& contentType) final { ASSERT_NOT_REACHED(); }
-        void registerBlobURL(const URL&, const URL& srcURL) final { ASSERT_NOT_REACHED(); }
-        void registerBlobURLOptionallyFileBacked(const URL&, const URL& srcURL, RefPtr<BlobDataFileReference>&&, const String& contentType) final { ASSERT_NOT_REACHED(); }
-        void registerBlobURLForSlice(const URL&, const URL& srcURL, long long start, long long end) final { ASSERT_NOT_REACHED(); }
-        void unregisterBlobURL(const URL&) final { ASSERT_NOT_REACHED(); }
</del><ins>+        void registerFileBlobURL(PAL::SessionID, const URL&, Ref<BlobDataFileReference>&&, const String& contentType) final { ASSERT_NOT_REACHED(); }
+        void registerBlobURL(PAL::SessionID, const URL&, Vector<BlobPart>&&, const String& contentType) final { ASSERT_NOT_REACHED(); }
+        void registerBlobURL(PAL::SessionID, const URL&, const URL& srcURL) final { ASSERT_NOT_REACHED(); }
+        void registerBlobURLOptionallyFileBacked(PAL::SessionID, const URL&, const URL& srcURL, RefPtr<BlobDataFileReference>&&, const String& contentType) final { ASSERT_NOT_REACHED(); }
+        void registerBlobURLForSlice(PAL::SessionID, const URL&, const URL& srcURL, long long start, long long end) final { ASSERT_NOT_REACHED(); }
+        void unregisterBlobURL(PAL::SessionID, const URL&) final { ASSERT_NOT_REACHED(); }
</ins><span class="cx">         unsigned long long blobSize(const URL&) final { ASSERT_NOT_REACHED(); return 0; }
</span><del>-        void writeBlobsToTemporaryFiles(const Vector<String>& blobURLs, CompletionHandler<void(Vector<String>&& filePaths)>&&) final { ASSERT_NOT_REACHED(); }
-        bool isBlobRegistryImpl() const { return false; }
</del><ins>+        void writeBlobsToTemporaryFiles(PAL::SessionID, const Vector<String>& blobURLs, CompletionHandler<void(Vector<String>&& filePaths)>&&) final { ASSERT_NOT_REACHED(); }
</ins><span class="cx">     };
</span><span class="cx">     static NeverDestroyed<EmptyBlobRegistry> blobRegistry;
</span><span class="cx">     return &blobRegistry.get();
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcessNetworkResourceLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp (248592 => 248593)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp     2019-08-13 08:54:27 UTC (rev 248592)
+++ trunk/Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp        2019-08-13 10:06:16 UTC (rev 248593)
</span><span class="lines">@@ -301,9 +301,6 @@
</span><span class="cx">     if (parameters.storedCredentialsPolicy == WebCore::StoredCredentialsPolicy::Use && m_networkLoadChecker)
</span><span class="cx">         parameters.storedCredentialsPolicy = m_networkLoadChecker->storedCredentialsPolicy();
</span><span class="cx"> 
</span><del>-    if (request.url().protocolIsBlob())
-        parameters.blobFileReferences = m_connection->filesInBlob(originalRequest().url());
-
</del><span class="cx">     auto* networkSession = m_connection->networkProcess().networkSession(parameters.sessionID);
</span><span class="cx">     if (!networkSession && parameters.sessionID.isEphemeral()) {
</span><span class="cx">         m_connection->networkProcess().addWebsiteDataStore(WebsiteDataStoreParameters::privateSessionParameters(parameters.sessionID));
</span><span class="lines">@@ -317,8 +314,11 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    if (request.url().protocolIsBlob())
+        parameters.blobFileReferences = networkSession->blobRegistry().filesInBlob(originalRequest().url());
+
</ins><span class="cx">     parameters.request = WTFMove(request);
</span><del>-    m_networkLoad = std::make_unique<NetworkLoad>(*this, &m_connection->blobRegistry(), WTFMove(parameters), *networkSession);
</del><ins>+    m_networkLoad = std::make_unique<NetworkLoad>(*this, &networkSession->blobRegistry(), WTFMove(parameters), *networkSession);
</ins><span class="cx"> 
</span><span class="cx">     RELEASE_LOG_IF_ALLOWED("startNetworkLoad: (pageID = %" PRIu64 ", frameID = %" PRIu64 ", resourceID = %" PRIu64 ", description = %{public}s)", m_parameters.webPageID.toUInt64(), m_parameters.webFrameID, m_parameters.identifier, m_networkLoad->description().utf8().data());
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcessNetworkSessionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/NetworkSession.h (248592 => 248593)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/NetworkSession.h      2019-08-13 08:54:27 UTC (rev 248592)
+++ trunk/Source/WebKit/NetworkProcess/NetworkSession.h 2019-08-13 10:06:16 UTC (rev 248593)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> #include "SandboxExtension.h"
</span><span class="cx"> #include "WebResourceLoadStatisticsStore.h"
</span><span class="cx"> #include <WebCore/AdClickAttribution.h>
</span><ins>+#include <WebCore/BlobRegistryImpl.h>
</ins><span class="cx"> #include <WebCore/RegistrableDomain.h>
</span><span class="cx"> #include <pal/SessionID.h>
</span><span class="cx"> #include <wtf/HashSet.h>
</span><span class="lines">@@ -114,6 +115,8 @@
</span><span class="cx">     virtual void removeWebSocketTask(WebSocketTask&) { }
</span><span class="cx">     virtual void addWebSocketTask(WebSocketTask&) { }
</span><span class="cx"> 
</span><ins>+    WebCore::BlobRegistryImpl& blobRegistry() { return m_blobRegistry; }
+
</ins><span class="cx"> protected:
</span><span class="cx">     NetworkSession(NetworkProcess&, const NetworkSessionCreationParameters&);
</span><span class="cx"> 
</span><span class="lines">@@ -143,6 +146,7 @@
</span><span class="cx">     bool m_isInvalidated { false };
</span><span class="cx"> #endif
</span><span class="cx">     RefPtr<NetworkCache::Cache> m_cache;
</span><ins>+    WebCore::BlobRegistryImpl m_blobRegistry;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcesssoupNetworkDataTaskSoupcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/soup/NetworkDataTaskSoup.cpp (248592 => 248593)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/soup/NetworkDataTaskSoup.cpp  2019-08-13 08:54:27 UTC (rev 248592)
+++ trunk/Source/WebKit/NetworkProcess/soup/NetworkDataTaskSoup.cpp     2019-08-13 10:06:16 UTC (rev 248593)
</span><span class="lines">@@ -134,7 +134,7 @@
</span><span class="cx"> 
</span><span class="cx">     unsigned messageFlags = SOUP_MESSAGE_NO_REDIRECT;
</span><span class="cx"> 
</span><del>-    m_currentRequest.updateSoupMessage(soupMessage.get());
</del><ins>+    m_currentRequest.updateSoupMessage(soupMessage.get(), m_session->blobRegistry());
</ins><span class="cx">     if (m_shouldContentSniff == ContentSniffingPolicy::DoNotSniffContent)
</span><span class="cx">         soup_message_disable_feature(soupMessage.get(), SOUP_TYPE_CONTENT_SNIFFER);
</span><span class="cx">     if (m_user.isEmpty() && m_password.isEmpty() && m_storedCredentialsPolicy == StoredCredentialsPolicy::DoNotUse) {
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcesssoupNetworkSessionSoupcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/soup/NetworkSessionSoup.cpp (248592 => 248593)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/soup/NetworkSessionSoup.cpp   2019-08-13 08:54:27 UTC (rev 248592)
+++ trunk/Source/WebKit/NetworkProcess/soup/NetworkSessionSoup.cpp      2019-08-13 10:06:16 UTC (rev 248593)
</span><span class="lines">@@ -121,7 +121,7 @@
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="cx">     GRefPtr<SoupMessage> soupMessage = adoptGRef(soup_message_new_from_uri(SOUP_METHOD_GET, soupURI.get()));
</span><del>-    request.updateSoupMessage(soupMessage.get());
</del><ins>+    request.updateSoupMessage(soupMessage.get(), blobRegistry());
</ins><span class="cx">     if (request.url().protocolIs("wss"))
</span><span class="cx">         g_signal_connect(soupMessage.get(), "network-event", G_CALLBACK(webSocketMessageNetworkEventCallback), nullptr);
</span><span class="cx">     return std::make_unique<WebSocketTask>(channel, soupSession(), soupMessage.get(), protocol);
</span></span></pre></div>
<a id="trunkSourceWebKitSourcestxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Sources.txt (248592 => 248593)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Sources.txt  2019-08-13 08:54:27 UTC (rev 248592)
+++ trunk/Source/WebKit/Sources.txt     2019-08-13 10:06:16 UTC (rev 248593)
</span><span class="lines">@@ -57,8 +57,6 @@
</span><span class="cx"> NetworkProcess/Downloads/DownloadMonitor.cpp
</span><span class="cx"> NetworkProcess/Downloads/PendingDownload.cpp
</span><span class="cx"> 
</span><del>-NetworkProcess/FileAPI/NetworkBlobRegistry.cpp
-
</del><span class="cx"> NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp
</span><span class="cx"> 
</span><span class="cx"> NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp @no-unify
</span></span></pre></div>
<a id="trunkSourceWebKitWebKitxcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj (248592 => 248593)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj     2019-08-13 08:54:27 UTC (rev 248592)
+++ trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj        2019-08-13 10:06:16 UTC (rev 248593)
</span><span class="lines">@@ -1317,7 +1317,6 @@
</span><span class="cx">          9FB5F395169E6A80002C25BF /* WKContextPrivateMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 9FB5F393169E6A80002C25BF /* WKContextPrivateMac.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          A102A7081EC0EEE900D81D82 /* com.macromedia.Flash Player ESR.plugin.sb in Copy Plug-in Sandbox Profiles */ = {isa = PBXBuildFile; fileRef = 7A5E39491D5BD8A700B4B7CE /* com.macromedia.Flash Player ESR.plugin.sb */; };
</span><span class="cx">          A1046EA12079263100F0C5D8 /* WKPDFView.h in Headers */ = {isa = PBXBuildFile; fileRef = A1046E9F2079263100F0C5D8 /* WKPDFView.h */; };
</span><del>-               A105D0D1212734B20034F6C7 /* NetworkBlobRegistry.h in Headers */ = {isa = PBXBuildFile; fileRef = A105D0D0212734B10034F6C7 /* NetworkBlobRegistry.h */; };
</del><span class="cx">           A115DC72191D82DA00DA8072 /* _WKWebViewPrintFormatter.h in Headers */ = {isa = PBXBuildFile; fileRef = A115DC6E191D82AB00DA8072 /* _WKWebViewPrintFormatter.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">          A118A9EF1907AD6F00F7C92B /* QuickLookDocumentData.h in Headers */ = {isa = PBXBuildFile; fileRef = A118A9ED1907AD6F00F7C92B /* QuickLookDocumentData.h */; };
</span><span class="cx">          A118A9F31908B8EA00F7C92B /* _WKNSFileManagerExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = A118A9F11908B8EA00F7C92B /* _WKNSFileManagerExtras.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -3987,7 +3986,6 @@
</span><span class="cx">          9FB5F393169E6A80002C25BF /* WKContextPrivateMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WKContextPrivateMac.h; path = mac/WKContextPrivateMac.h; sourceTree = "<group>"; };
</span><span class="cx">          A1046E9F2079263100F0C5D8 /* WKPDFView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = WKPDFView.h; path = ios/WKPDFView.h; sourceTree = "<group>"; };
</span><span class="cx">          A1046EA02079263100F0C5D8 /* WKPDFView.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = WKPDFView.mm; path = ios/WKPDFView.mm; sourceTree = "<group>"; };
</span><del>-               A105D0D0212734B10034F6C7 /* NetworkBlobRegistry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NetworkBlobRegistry.h; sourceTree = "<group>"; };
</del><span class="cx">           A115DC6D191D82AB00DA8072 /* _WKWebViewPrintFormatter.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = _WKWebViewPrintFormatter.mm; sourceTree = "<group>"; };
</span><span class="cx">          A115DC6E191D82AB00DA8072 /* _WKWebViewPrintFormatter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _WKWebViewPrintFormatter.h; sourceTree = "<group>"; };
</span><span class="cx">          A118A9EC1907AD6F00F7C92B /* QuickLookDocumentData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = QuickLookDocumentData.cpp; path = ios/QuickLookDocumentData.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -4621,7 +4619,6 @@
</span><span class="cx">          E164A2F0191AF14E0010737D /* BlobDataFileReferenceWithSandboxExtension.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlobDataFileReferenceWithSandboxExtension.h; sourceTree = "<group>"; };
</span><span class="cx">          E170876916D6CA6900F99226 /* BlobRegistryProxy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BlobRegistryProxy.cpp; path = WebProcess/FileAPI/BlobRegistryProxy.cpp; sourceTree = "<group>"; };
</span><span class="cx">          E170876A16D6CA6900F99226 /* BlobRegistryProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BlobRegistryProxy.h; path = WebProcess/FileAPI/BlobRegistryProxy.h; sourceTree = "<group>"; };
</span><del>-               E1798C7716E6818800240139 /* NetworkBlobRegistry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NetworkBlobRegistry.cpp; sourceTree = "<group>"; };
</del><span class="cx">           E17AE2C116B9C139001C42F1 /* com.apple.WebKit.NetworkProcess.sb.in */ = {isa = PBXFileReference; lastKnownFileType = text; path = com.apple.WebKit.NetworkProcess.sb.in; sourceTree = "<group>"; };
</span><span class="cx">          E17AE2C216B9C63A001C42F1 /* com.apple.WebKit.NetworkProcess.sb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = com.apple.WebKit.NetworkProcess.sb; path = DerivedSources/WebKit2/com.apple.WebKit.NetworkProcess.sb; sourceTree = BUILT_PRODUCTS_DIR; };
</span><span class="cx">          E18C92F312DB9E7100CF2AEB /* PrintInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PrintInfo.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -6667,7 +6664,6 @@
</span><span class="cx">                          5C1426F21C23F82D00D41183 /* CustomProtocols */,
</span><span class="cx">                          5C1426F11C23F81700D41183 /* Downloads */,
</span><span class="cx">                          BC82837C16B45DA500A278FE /* EntryPoint */,
</span><del>-                               E1798C7616E6815500240139 /* FileAPI */,
</del><span class="cx">                           939288E021404DF000EBBA33 /* IndexedDB */,
</span><span class="cx">                          2DA944BB188511DD00ED86DB /* ios */,
</span><span class="cx">                          510CC7DC16138E2900D03ED3 /* mac */,
</span><span class="lines">@@ -9027,15 +9023,6 @@
</span><span class="cx">                  name = FileAPI;
</span><span class="cx">                  sourceTree = "<group>";
</span><span class="cx">          };
</span><del>-               E1798C7616E6815500240139 /* FileAPI */ = {
-                       isa = PBXGroup;
-                       children = (
-                               E1798C7716E6818800240139 /* NetworkBlobRegistry.cpp */,
-                               A105D0D0212734B10034F6C7 /* NetworkBlobRegistry.h */,
-                       );
-                       path = FileAPI;
-                       sourceTree = "<group>";
-               };
</del><span class="cx">           E199875B142BF9CF00BB2DE7 /* PDF */ = {
</span><span class="cx">                  isa = PBXGroup;
</span><span class="cx">                  children = (
</span><span class="lines">@@ -9483,7 +9470,6 @@
</span><span class="cx">                          1A4A9C5612B816CF008FE984 /* NetscapePluginModule.h in Headers */,
</span><span class="cx">                          1AA5889211EE70400061B882 /* NetscapePluginStream.h in Headers */,
</span><span class="cx">                          535BCB922069C49C00CCCE02 /* NetworkActivityTracker.h in Headers */,
</span><del>-                               A105D0D1212734B20034F6C7 /* NetworkBlobRegistry.h in Headers */,
</del><span class="cx">                           E4436ECC1A0D040B00EAD204 /* NetworkCache.h in Headers */,
</span><span class="cx">                          E49D40D71AD3FB170066B7B9 /* NetworkCacheBlobStorage.h in Headers */,
</span><span class="cx">                          E489D28C1A0A2DB80078C06A /* NetworkCacheCoders.h in Headers */,
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessFileAPIBlobRegistryProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/FileAPI/BlobRegistryProxy.cpp (248592 => 248593)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/FileAPI/BlobRegistryProxy.cpp     2019-08-13 08:54:27 UTC (rev 248592)
+++ trunk/Source/WebKit/WebProcess/FileAPI/BlobRegistryProxy.cpp        2019-08-13 10:06:16 UTC (rev 248593)
</span><span class="lines">@@ -36,7 +36,7 @@
</span><span class="cx"> namespace WebKit {
</span><span class="cx"> using namespace WebCore;
</span><span class="cx"> 
</span><del>-void BlobRegistryProxy::registerFileBlobURL(const URL& url, Ref<BlobDataFileReference>&& file, const String& contentType)
</del><ins>+void BlobRegistryProxy::registerFileBlobURL(PAL::SessionID sessionID, const URL& url, Ref<BlobDataFileReference>&& file, const String& contentType)
</ins><span class="cx"> {
</span><span class="cx">     SandboxExtension::Handle extensionHandle;
</span><span class="cx"> 
</span><span class="lines">@@ -44,37 +44,33 @@
</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().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::RegisterFileBlobURL(url, file->path(), extensionHandle, contentType), 0);
</del><ins>+    WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::RegisterFileBlobURL(sessionID, url, file->path(), extensionHandle, contentType), 0);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void BlobRegistryProxy::registerBlobURL(const URL& url, Vector<BlobPart>&& blobParts, const String& contentType)
</del><ins>+void BlobRegistryProxy::registerBlobURL(PAL::SessionID sessionID, const URL& url, Vector<BlobPart>&& blobParts, const String& contentType)
</ins><span class="cx"> {
</span><del>-    WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::RegisterBlobURL(url, blobParts, contentType), 0);
</del><ins>+    WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::RegisterBlobURL(sessionID, url, blobParts, contentType), 0);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void BlobRegistryProxy::registerBlobURL(const URL& url, const URL& srcURL)
</del><ins>+void BlobRegistryProxy::registerBlobURL(PAL::SessionID sessionID, const URL& url, const URL& srcURL)
</ins><span class="cx"> {
</span><del>-    bool shouldBypassConnectionCheck = false;
-#if ENABLE(SERVICE_WORKER)
-    shouldBypassConnectionCheck = SWContextManager::singleton().connection();
-#endif
-    WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::RegisterBlobURLFromURL { url, srcURL, shouldBypassConnectionCheck }, 0);
</del><ins>+    WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::RegisterBlobURLFromURL { sessionID, url, srcURL }, 0);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void BlobRegistryProxy::registerBlobURLOptionallyFileBacked(const URL& url, const URL& srcURL, RefPtr<WebCore::BlobDataFileReference>&& file, const String& contentType)
</del><ins>+void BlobRegistryProxy::registerBlobURLOptionallyFileBacked(PAL::SessionID sessionID, const URL& url, const URL& srcURL, RefPtr<WebCore::BlobDataFileReference>&& file, const String& contentType)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(file);
</span><del>-    WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::RegisterBlobURLOptionallyFileBacked(url, srcURL, file->path(), contentType), 0);
</del><ins>+    WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::RegisterBlobURLOptionallyFileBacked(sessionID, url, srcURL, file->path(), contentType), 0);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void BlobRegistryProxy::unregisterBlobURL(const URL& url)
</del><ins>+void BlobRegistryProxy::unregisterBlobURL(PAL::SessionID sessionID, const URL& url)
</ins><span class="cx"> {
</span><del>-    WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::UnregisterBlobURL(url), 0);
</del><ins>+    WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::UnregisterBlobURL(sessionID, url), 0);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void BlobRegistryProxy::registerBlobURLForSlice(const URL& url, const URL& srcURL, long long start, long long end)
</del><ins>+void BlobRegistryProxy::registerBlobURLForSlice(PAL::SessionID sessionID, const URL& url, const URL& srcURL, long long start, long long end)
</ins><span class="cx"> {
</span><del>-    WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::RegisterBlobURLForSlice(url, srcURL, start, end), 0);
</del><ins>+    WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::RegisterBlobURLForSlice(sessionID, 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="lines">@@ -85,9 +81,9 @@
</span><span class="cx">     return resultSize;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void BlobRegistryProxy::writeBlobsToTemporaryFiles(const Vector<String>& blobURLs, CompletionHandler<void(Vector<String>&& filePaths)>&& completionHandler)
</del><ins>+void BlobRegistryProxy::writeBlobsToTemporaryFiles(PAL::SessionID sessionID, const Vector<String>& blobURLs, CompletionHandler<void(Vector<String>&& filePaths)>&& completionHandler)
</ins><span class="cx"> {
</span><del>-    WebProcess::singleton().ensureNetworkProcessConnection().writeBlobsToTemporaryFiles(blobURLs, WTFMove(completionHandler));
</del><ins>+    WebProcess::singleton().ensureNetworkProcessConnection().writeBlobsToTemporaryFiles(sessionID, blobURLs, WTFMove(completionHandler));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessFileAPIBlobRegistryProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/FileAPI/BlobRegistryProxy.h (248592 => 248593)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/FileAPI/BlobRegistryProxy.h       2019-08-13 08:54:27 UTC (rev 248592)
+++ trunk/Source/WebKit/WebProcess/FileAPI/BlobRegistryProxy.h  2019-08-13 10:06:16 UTC (rev 248593)
</span><span class="lines">@@ -31,14 +31,14 @@
</span><span class="cx"> 
</span><span class="cx"> class BlobRegistryProxy final : public WebCore::BlobRegistry {
</span><span class="cx"> public:
</span><del>-    void registerFileBlobURL(const URL&, Ref<WebCore::BlobDataFileReference>&&, const String& contentType) override;
-    void registerBlobURL(const URL&, Vector<WebCore::BlobPart>&&, const String& contentType) override;
-    void registerBlobURL(const URL&, const URL& srcURL) override;
-    void registerBlobURLOptionallyFileBacked(const URL&, const URL& srcURL, RefPtr<WebCore::BlobDataFileReference>&&, const String& contentType) override;
-    void unregisterBlobURL(const URL&) override;
-    void registerBlobURLForSlice(const URL&, const URL& srcURL, long long start, long long end) override;
-    unsigned long long blobSize(const URL&) override;
-    void writeBlobsToTemporaryFiles(const Vector<String>& blobURLs, CompletionHandler<void(Vector<String>&& filePaths)>&&) override;
</del><ins>+    void registerFileBlobURL(PAL::SessionID, const URL&, Ref<WebCore::BlobDataFileReference>&&, const String& contentType) final;
+    void registerBlobURL(PAL::SessionID, const URL&, Vector<WebCore::BlobPart>&&, const String& contentType) final;
+    void registerBlobURL(PAL::SessionID, const URL&, const URL& srcURL) final;
+    void registerBlobURLOptionallyFileBacked(PAL::SessionID, const URL&, const URL& srcURL, RefPtr<WebCore::BlobDataFileReference>&&, const String& contentType) final;
+    void unregisterBlobURL(PAL::SessionID, const URL&) final;
+    void registerBlobURLForSlice(PAL::SessionID, const URL&, const URL& srcURL, long long start, long long end) final;
+    unsigned long long blobSize(const URL&) final;
+    void writeBlobsToTemporaryFiles(PAL::SessionID, const Vector<String>& blobURLs, CompletionHandler<void(Vector<String>&& filePaths)>&&) final;
</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 (248592 => 248593)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/Network/NetworkProcessConnection.cpp      2019-08-13 08:54:27 UTC (rev 248592)
+++ trunk/Source/WebKit/WebProcess/Network/NetworkProcessConnection.cpp 2019-08-13 10:06:16 UTC (rev 248593)
</span><span class="lines">@@ -211,9 +211,9 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void NetworkProcessConnection::writeBlobsToTemporaryFiles(const Vector<String>& blobURLs, CompletionHandler<void(Vector<String>&& filePaths)>&& completionHandler)
</del><ins>+void NetworkProcessConnection::writeBlobsToTemporaryFiles(PAL::SessionID sessionID, const Vector<String>& blobURLs, CompletionHandler<void(Vector<String>&& filePaths)>&& completionHandler)
</ins><span class="cx"> {
</span><del>-    WebProcess::singleton().ensureNetworkProcessConnection().connection().sendWithAsyncReply(Messages::NetworkConnectionToWebProcess::WriteBlobsToTemporaryFiles(blobURLs), WTFMove(completionHandler));
</del><ins>+    WebProcess::singleton().ensureNetworkProcessConnection().connection().sendWithAsyncReply(Messages::NetworkConnectionToWebProcess::WriteBlobsToTemporaryFiles(sessionID, blobURLs), WTFMove(completionHandler));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void NetworkProcessConnection::didFinishPingLoad(uint64_t pingLoadIdentifier, ResourceError&& error, ResourceResponse&& response)
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessNetworkNetworkProcessConnectionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/Network/NetworkProcessConnection.h (248592 => 248593)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/Network/NetworkProcessConnection.h        2019-08-13 08:54:27 UTC (rev 248592)
+++ trunk/Source/WebKit/WebProcess/Network/NetworkProcessConnection.h   2019-08-13 10:06:16 UTC (rev 248593)
</span><span class="lines">@@ -65,7 +65,7 @@
</span><span class="cx"> 
</span><span class="cx">     void didReceiveNetworkProcessConnectionMessage(IPC::Connection&, IPC::Decoder&);
</span><span class="cx"> 
</span><del>-    void writeBlobsToTemporaryFiles(const Vector<String>& blobURLs, CompletionHandler<void(Vector<String>&& filePaths)>&&);
</del><ins>+    void writeBlobsToTemporaryFiles(PAL::SessionID, const Vector<String>& blobURLs, CompletionHandler<void(Vector<String>&& filePaths)>&&);
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(INDEXED_DATABASE)
</span><span class="cx">     WebIDBConnectionToServer* existingIDBConnectionToServerForIdentifier(uint64_t identifier) const { return m_webIDBConnectionsByIdentifier.get(identifier); };
</span></span></pre></div>
<a id="trunkSourceWebKitLegacymacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKitLegacy/mac/ChangeLog (248592 => 248593)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKitLegacy/mac/ChangeLog  2019-08-13 08:54:27 UTC (rev 248592)
+++ trunk/Source/WebKitLegacy/mac/ChangeLog     2019-08-13 10:06:16 UTC (rev 248593)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2019-08-13  Youenn Fablet  <youenn@apple.com>
+
+        Blob registries should be keyed by session IDs
+        https://bugs.webkit.org/show_bug.cgi?id=200567
+
+        Reviewed by Alex Christensen.
+
+        * WebCoreSupport/WebPlatformStrategies.mm:
+        (WebPlatformStrategies::createBlobRegistry):
+        Ignore sessionID parameter for WK1.
+
</ins><span class="cx"> 2019-08-12  Chris Dumez  <cdumez@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Add threading assertions to RefCounted
</span></span></pre></div>
<a id="trunkSourceWebKitLegacymacWebCoreSupportWebPlatformStrategiesmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebPlatformStrategies.mm (248592 => 248593)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebPlatformStrategies.mm    2019-08-13 08:54:27 UTC (rev 248592)
+++ trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebPlatformStrategies.mm       2019-08-13 10:06:16 UTC (rev 248593)
</span><span class="lines">@@ -62,9 +62,25 @@
</span><span class="cx">     return this;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+class WebBlobRegistry final : public BlobRegistry {
+private:
+    void registerFileBlobURL(PAL::SessionID, const URL& url, Ref<BlobDataFileReference>&& reference, const String& contentType) final { m_blobRegistry.registerFileBlobURL(url, WTFMove(reference), contentType); }
+    void registerBlobURL(PAL::SessionID, const URL& url, Vector<BlobPart>&& parts, const String& contentType) final { m_blobRegistry.registerBlobURL(url, WTFMove(parts), contentType); }
+    void registerBlobURL(PAL::SessionID, const URL& url, const URL& srcURL) final { m_blobRegistry.registerBlobURL(url, srcURL); }
+    void registerBlobURLOptionallyFileBacked(PAL::SessionID, const URL& url, const URL& srcURL, RefPtr<BlobDataFileReference>&& reference, const String& contentType) final { m_blobRegistry.registerBlobURLOptionallyFileBacked(url, srcURL, WTFMove(reference), contentType); }
+    void registerBlobURLForSlice(PAL::SessionID, const URL& url, const URL& srcURL, long long start, long long end) final { m_blobRegistry.registerBlobURLForSlice(url, srcURL, start, end); }
+    void unregisterBlobURL(PAL::SessionID, const URL& url) final { m_blobRegistry.unregisterBlobURL(url); }
+    unsigned long long blobSize(const URL& url) final { return m_blobRegistry.blobSize(url); }
+    void writeBlobsToTemporaryFiles(PAL::SessionID, const Vector<String>& blobURLs, CompletionHandler<void(Vector<String>&& filePaths)>&& completionHandler) final { m_blobRegistry.writeBlobsToTemporaryFiles(blobURLs, WTFMove(completionHandler)); }
+
+    BlobRegistryImpl* blobRegistryImpl() final { return &m_blobRegistry; }
+
+    BlobRegistryImpl m_blobRegistry;
+};
+
</ins><span class="cx"> BlobRegistry* WebPlatformStrategies::createBlobRegistry()
</span><span class="cx"> {
</span><del>-    return new WebCore::BlobRegistryImpl;
</del><ins>+    return new WebBlobRegistry;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebPlatformStrategies::getTypes(Vector<String>& types, const String& pasteboardName)
</span></span></pre></div>
<a id="trunkSourceWebKitLegacywinChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKitLegacy/win/ChangeLog (248592 => 248593)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKitLegacy/win/ChangeLog  2019-08-13 08:54:27 UTC (rev 248592)
+++ trunk/Source/WebKitLegacy/win/ChangeLog     2019-08-13 10:06:16 UTC (rev 248593)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2019-08-13  Youenn Fablet  <youenn@apple.com>
+
+        Blob registries should be keyed by session IDs
+        https://bugs.webkit.org/show_bug.cgi?id=200567
+        <rdar://problem/54120212>
+
+        Reviewed by Alex Christensen.
+
+        * WebCoreSupport/WebPlatformStrategies.cpp:
+        (WebPlatformStrategies::createBlobRegistry):
+
</ins><span class="cx"> 2019-08-12  Youenn Fablet  <youenn@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Remove IDB-specific quota
</span></span></pre></div>
<a id="trunkSourceWebKitLegacywinWebCoreSupportWebPlatformStrategiescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKitLegacy/win/WebCoreSupport/WebPlatformStrategies.cpp (248592 => 248593)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKitLegacy/win/WebCoreSupport/WebPlatformStrategies.cpp   2019-08-13 08:54:27 UTC (rev 248592)
+++ trunk/Source/WebKitLegacy/win/WebCoreSupport/WebPlatformStrategies.cpp      2019-08-13 10:06:16 UTC (rev 248593)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include "WebFrameNetworkingContext.h"
</span><span class="cx"> #include "WebResourceLoadScheduler.h"
</span><ins>+#include <WebCore/BlobRegistry.h>
</ins><span class="cx"> #include <WebCore/BlobRegistryImpl.h>
</span><span class="cx"> #include <WebCore/FrameLoader.h>
</span><span class="cx"> #include <WebCore/NetworkStorageSession.h>
</span><span class="lines">@@ -59,7 +60,23 @@
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+class WebBlobRegistry final : public BlobRegistry {
+private:
+    void registerFileBlobURL(PAL::SessionID, const URL& url, Ref<BlobDataFileReference>&& reference, const String& contentType) final { m_blobRegistry.registerFileBlobURL(url, WTFMove(reference), contentType); }
+    void registerBlobURL(PAL::SessionID, const URL& url, Vector<BlobPart>&& parts, const String& contentType) final { m_blobRegistry.registerBlobURL(url, WTFMove(parts), contentType); }
+    void registerBlobURL(PAL::SessionID, const URL& url, const URL& srcURL) final { m_blobRegistry.registerBlobURL(url, srcURL); }
+    void registerBlobURLOptionallyFileBacked(PAL::SessionID, const URL& url, const URL& srcURL, RefPtr<BlobDataFileReference>&& reference, const String& contentType) final { m_blobRegistry.registerBlobURLOptionallyFileBacked(url, srcURL, WTFMove(reference), contentType); }
+    void registerBlobURLForSlice(PAL::SessionID, const URL& url, const URL& srcURL, long long start, long long end) final { m_blobRegistry.registerBlobURLForSlice(url, srcURL, start, end); }
+    void unregisterBlobURL(PAL::SessionID, const URL& url) final { m_blobRegistry.unregisterBlobURL(url); }
+    unsigned long long blobSize(const URL& url) final { return m_blobRegistry.blobSize(url); }
+    void writeBlobsToTemporaryFiles(PAL::SessionID, const Vector<String>& blobURLs, CompletionHandler<void(Vector<String>&& filePaths)>&& completionHandler) final { m_blobRegistry.writeBlobsToTemporaryFiles(blobURLs, WTFMove(completionHandler)); }
+
+    BlobRegistryImpl* blobRegistryImpl() final { return &m_blobRegistry; }
+
+    BlobRegistryImpl m_blobRegistry;
+};
+
</ins><span class="cx"> BlobRegistry* WebPlatformStrategies::createBlobRegistry()
</span><span class="cx"> {
</span><del>-    return new BlobRegistryImpl;
</del><ins>+    return new WebBlobRegistry;
</ins><span class="cx"> }
</span></span></pre>
</div>
</div>

</body>
</html>