<!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>[260955] branches/safari-609.2.9.0-branch/Source/WebKit</title>
</head>
<body>

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

<h3>Log Message</h3>
<pre>Apply patch. rdar://problem/62623152</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#branchessafari609290branchSourceWebKitChangeLog">branches/safari-609.2.9.0-branch/Source/WebKit/ChangeLog</a></li>
<li><a href="#branchessafari609290branchSourceWebKitNetworkProcessClassifierWebResourceLoadStatisticsStorecpp">branches/safari-609.2.9.0-branch/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp</a></li>
<li><a href="#branchessafari609290branchSourceWebKitNetworkProcessClassifierWebResourceLoadStatisticsStoreh">branches/safari-609.2.9.0-branch/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h</a></li>
<li><a href="#branchessafari609290branchSourceWebKitNetworkProcessNetworkProcesscpp">branches/safari-609.2.9.0-branch/Source/WebKit/NetworkProcess/NetworkProcess.cpp</a></li>
<li><a href="#branchessafari609290branchSourceWebKitNetworkProcessNetworkSessioncpp">branches/safari-609.2.9.0-branch/Source/WebKit/NetworkProcess/NetworkSession.cpp</a></li>
<li><a href="#branchessafari609290branchSourceWebKitNetworkProcessNetworkSessionh">branches/safari-609.2.9.0-branch/Source/WebKit/NetworkProcess/NetworkSession.h</a></li>
<li><a href="#branchessafari609290branchSourceWebKitUIProcessNetworkNetworkProcessProxycpp">branches/safari-609.2.9.0-branch/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp</a></li>
<li><a href="#branchessafari609290branchSourceWebKitUIProcessNetworkNetworkProcessProxyh">branches/safari-609.2.9.0-branch/Source/WebKit/UIProcess/Network/NetworkProcessProxy.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchessafari609290branchSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-609.2.9.0-branch/Source/WebKit/ChangeLog (260954 => 260955)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-609.2.9.0-branch/Source/WebKit/ChangeLog 2020-04-30 17:52:08 UTC (rev 260954)
+++ branches/safari-609.2.9.0-branch/Source/WebKit/ChangeLog    2020-04-30 17:56:42 UTC (rev 260955)
</span><span class="lines">@@ -1,3 +1,43 @@
</span><ins>+2020-04-30  Russell Epstein  <repstein@apple.com>
+
+        Apply patch. rdar://problem/62623152
+
+    2020-04-30  Alex Christensen  <achristensen@webkit.org>
+
+            Revert most of r260370 and all of r260795
+            <rdar://problem/62623152>
+
+            r260370 not only fixed client certificate authentication when using non-persistent WKWebsiteDataStores,
+            but it also removed a strong reference to the WebsiteDataStores, which changed their lifetime and caused their destructor
+            to be called more often in SafariViewController, which caused hangs because of a deadlock in the destruction code I tried to
+            fix in r260795, which introduced suspension hangs.  This keeps only the part of r260370 that is necessary to fix client certificate authentication
+            (as verified by the Challenge.ClientCertificateNonPersistentDataStore unit test from r260370 that continues to pass) but reverts the part of that
+            change that changed the lifetime of the WebsiteDataStore, restoring behavior to how the safari-609-branch was without hangs in SafariViewController
+            or in suspension, but with client certificate authentication working in non-persistent WKWebsiteDataStores.
+
+            This patch applies to the safari-609.2.9.0-branch.
+
+            * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
+            (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
+            (WebKit::WebResourceLoadStatisticsStore::didDestroyNetworkSession):
+            (WebKit::WebResourceLoadStatisticsStore::flushAndDestroyPersistentStore):
+            (WebKit::WebResourceLoadStatisticsStore::applicationWillTerminate):
+            (WebKit::sharedStatisticsQueue): Deleted.
+            * NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
+            * NetworkProcess/NetworkProcess.cpp:
+            (WebKit::NetworkProcess::didClose):
+            * NetworkProcess/NetworkSession.cpp:
+            (WebKit::NetworkSession::~NetworkSession):
+            (WebKit::NetworkSession::destroyResourceLoadStatistics):
+            (WebKit::NetworkSession::setResourceLoadStatisticsEnabled):
+            (WebKit::NetworkSession::recreateResourceLoadStatisticStore):
+            * NetworkProcess/NetworkSession.h:
+            * UIProcess/Network/NetworkProcessProxy.cpp:
+            (WebKit::NetworkProcessProxy::NetworkProcessProxy):
+            (WebKit::NetworkProcessProxy::addSession):
+            (WebKit::NetworkProcessProxy::removeSession):
+            * UIProcess/Network/NetworkProcessProxy.h:
+
</ins><span class="cx"> 2020-04-27  Russell Epstein  <repstein@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Apply patch. rdar://problem/62377357
</span></span></pre></div>
<a id="branchessafari609290branchSourceWebKitNetworkProcessClassifierWebResourceLoadStatisticsStorecpp"></a>
<div class="modfile"><h4>Modified: branches/safari-609.2.9.0-branch/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp (260954 => 260955)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-609.2.9.0-branch/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp      2020-04-30 17:52:08 UTC (rev 260954)
+++ branches/safari-609.2.9.0-branch/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp 2020-04-30 17:56:42 UTC (rev 260955)
</span><span class="lines">@@ -150,15 +150,9 @@
</span><span class="cx">     completionHandler();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static Ref<WorkQueue> sharedStatisticsQueue()
-{
-    static NeverDestroyed<Ref<WorkQueue>> queue(WorkQueue::create("WebResourceLoadStatisticsStore Process Data Queue", WorkQueue::Type::Serial, WorkQueue::QOS::Utility));
-    return queue.get().copyRef();
-}
-
</del><span class="cx"> WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore(NetworkSession& networkSession, const String& resourceLoadStatisticsDirectory, ShouldIncludeLocalhost shouldIncludeLocalhost)
</span><span class="cx">     : m_networkSession(makeWeakPtr(networkSession))
</span><del>-    , m_statisticsQueue(sharedStatisticsQueue())
</del><ins>+    , m_statisticsQueue(WorkQueue::create("WebResourceLoadStatisticsStore Process Data Queue", WorkQueue::Type::Serial, WorkQueue::QOS::Utility))
</ins><span class="cx">     , m_dailyTasksTimer(RunLoop::main(), this, &WebResourceLoadStatisticsStore::performDailyTasks)
</span><span class="cx"> {
</span><span class="cx">     RELEASE_ASSERT(RunLoop::isMain());
</span><span class="lines">@@ -188,12 +182,12 @@
</span><span class="cx">     RELEASE_ASSERT(!m_persistentStorage);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebResourceLoadStatisticsStore::didDestroyNetworkSession(CompletionHandler<void()>&& completionHandler)
</del><ins>+void WebResourceLoadStatisticsStore::didDestroyNetworkSession()
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(RunLoop::isMain());
</span><span class="cx"> 
</span><span class="cx">     m_networkSession = nullptr;
</span><del>-    flushAndDestroyPersistentStore(WTFMove(completionHandler));
</del><ins>+    flushAndDestroyPersistentStore();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> inline void WebResourceLoadStatisticsStore::postTask(WTF::Function<void()>&& task)
</span><span class="lines">@@ -210,17 +204,21 @@
</span><span class="cx">     RunLoop::main().dispatch(WTFMove(reply));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebResourceLoadStatisticsStore::flushAndDestroyPersistentStore(CompletionHandler<void()>&& completionHandler)
</del><ins>+void WebResourceLoadStatisticsStore::flushAndDestroyPersistentStore()
</ins><span class="cx"> {
</span><span class="cx">     RELEASE_ASSERT(RunLoop::isMain());
</span><span class="cx"> 
</span><del>-    // Make sure we destroy the persistent store on the background queue and stay alive until it
-    // is destroyed because it has a C++ reference to us.
-    m_statisticsQueue->dispatch([this, protectedThis = makeRef(*this), completionHandler = WTFMove(completionHandler)] () mutable {
</del><ins>+    // Make sure we destroy the persistent store on the background queue and wait for it to die
+    // synchronously since it has a C++ reference to us. Blocking nature of this task allows us
+    // to not maintain a WebResourceLoadStatisticsStore reference for the duration of dispatch,
+    // avoiding double-deletion issues when this is invoked from the destructor.
+    BinarySemaphore semaphore;
+    m_statisticsQueue->dispatch([&semaphore, this] {
</ins><span class="cx">         m_persistentStorage = nullptr;
</span><span class="cx">         m_statisticsStore = nullptr;
</span><del>-        RunLoop::main().dispatch(WTFMove(completionHandler));
</del><ins>+        semaphore.signal();
</ins><span class="cx">     });
</span><ins>+    semaphore.wait();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebResourceLoadStatisticsStore::populateMemoryStoreFromDisk(CompletionHandler<void()>&& completionHandler)
</span><span class="lines">@@ -522,6 +520,12 @@
</span><span class="cx">     completionHandler();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebResourceLoadStatisticsStore::applicationWillTerminate()
+{
+    ASSERT(RunLoop::isMain());
+    flushAndDestroyPersistentStore();
+}
+
</ins><span class="cx"> void WebResourceLoadStatisticsStore::performDailyTasks()
</span><span class="cx"> {
</span><span class="cx">     ASSERT(RunLoop::isMain());
</span></span></pre></div>
<a id="branchessafari609290branchSourceWebKitNetworkProcessClassifierWebResourceLoadStatisticsStoreh"></a>
<div class="modfile"><h4>Modified: branches/safari-609.2.9.0-branch/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h (260954 => 260955)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-609.2.9.0-branch/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h        2020-04-30 17:52:08 UTC (rev 260954)
+++ branches/safari-609.2.9.0-branch/Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h   2020-04-30 17:56:42 UTC (rev 260955)
</span><span class="lines">@@ -194,7 +194,7 @@
</span><span class="cx">     }
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-    void didDestroyNetworkSession(CompletionHandler<void()>&&);
</del><ins>+    void didDestroyNetworkSession();
</ins><span class="cx"> 
</span><span class="cx">     static const OptionSet<WebsiteDataType>& monitoredDataTypes();
</span><span class="cx"> 
</span><span class="lines">@@ -208,6 +208,8 @@
</span><span class="cx"> 
</span><span class="cx">     void grantStorageAccess(const SubFrameDomain&, const TopFrameDomain&, WebCore::FrameIdentifier, WebCore::PageIdentifier, StorageAccessPromptWasShown, CompletionHandler<void(StorageAccessWasGranted, StorageAccessPromptWasShown)>&&);
</span><span class="cx"> 
</span><ins>+    void applicationWillTerminate();
+
</ins><span class="cx">     void logFrameNavigation(const NavigatedToDomain&, const TopFrameDomain&, const NavigatedFromDomain&, bool isRedirect, bool isMainFrame, Seconds delayAfterMainFrameDocumentLoad, bool wasPotentiallyInitiatedByUser);
</span><span class="cx">     void logUserInteraction(const TopFrameDomain&, CompletionHandler<void()>&&);
</span><span class="cx">     void logCrossSiteLoadWithLinkDecoration(const NavigatedFromDomain&, const NavigatedToDomain&, CompletionHandler<void()>&&);
</span><span class="lines">@@ -298,7 +300,7 @@
</span><span class="cx"> 
</span><span class="cx">     StorageAccessStatus storageAccessStatus(const String& subFramePrimaryDomain, const String& topFramePrimaryDomain);
</span><span class="cx"> 
</span><del>-    void flushAndDestroyPersistentStore(CompletionHandler<void()>&&);
</del><ins>+    void flushAndDestroyPersistentStore();
</ins><span class="cx"> 
</span><span class="cx">     WeakPtr<NetworkSession> m_networkSession;
</span><span class="cx">     Ref<WTF::WorkQueue> m_statisticsQueue;
</span></span></pre></div>
<a id="branchessafari609290branchSourceWebKitNetworkProcessNetworkProcesscpp"></a>
<div class="modfile"><h4>Modified: branches/safari-609.2.9.0-branch/Source/WebKit/NetworkProcess/NetworkProcess.cpp (260954 => 260955)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-609.2.9.0-branch/Source/WebKit/NetworkProcess/NetworkProcess.cpp 2020-04-30 17:52:08 UTC (rev 260954)
+++ branches/safari-609.2.9.0-branch/Source/WebKit/NetworkProcess/NetworkProcess.cpp    2020-04-30 17:56:42 UTC (rev 260955)
</span><span class="lines">@@ -258,18 +258,10 @@
</span><span class="cx"> {
</span><span class="cx">     ASSERT(RunLoop::isMain());
</span><span class="cx"> 
</span><del>-    auto callbackAggregator = CallbackAggregator::create([this] {
-        ASSERT(RunLoop::isMain());
</del><ins>+    // Make sure we flush all cookies to disk before exiting.
+    platformSyncAllCookies([this] {
</ins><span class="cx">         stopRunLoop();
</span><span class="cx">     });
</span><del>-
-    // Make sure we flush all cookies and resource load statistics to disk before exiting.
-#if ENABLE(RESOURCE_LOAD_STATISTICS)
-    forEachNetworkSession([&] (auto& networkSession) {
-        networkSession.destroyResourceLoadStatistics([callbackAggregator = callbackAggregator.copyRef()] { });
-    });
-#endif
-    platformSyncAllCookies([callbackAggregator = callbackAggregator.copyRef()] { });
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void NetworkProcess::didCreateDownload()
</span></span></pre></div>
<a id="branchessafari609290branchSourceWebKitNetworkProcessNetworkSessioncpp"></a>
<div class="modfile"><h4>Modified: branches/safari-609.2.9.0-branch/Source/WebKit/NetworkProcess/NetworkSession.cpp (260954 => 260955)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-609.2.9.0-branch/Source/WebKit/NetworkProcess/NetworkSession.cpp 2020-04-30 17:52:08 UTC (rev 260954)
+++ branches/safari-609.2.9.0-branch/Source/WebKit/NetworkProcess/NetworkSession.cpp    2020-04-30 17:56:42 UTC (rev 260955)
</span><span class="lines">@@ -122,17 +122,17 @@
</span><span class="cx"> NetworkSession::~NetworkSession()
</span><span class="cx"> {
</span><span class="cx"> #if ENABLE(RESOURCE_LOAD_STATISTICS)
</span><del>-    destroyResourceLoadStatistics([] { });
</del><ins>+    destroyResourceLoadStatistics();
</ins><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(RESOURCE_LOAD_STATISTICS)
</span><del>-void NetworkSession::destroyResourceLoadStatistics(CompletionHandler<void()>&& completionHandler)
</del><ins>+void NetworkSession::destroyResourceLoadStatistics()
</ins><span class="cx"> {
</span><span class="cx">     if (!m_resourceLoadStatistics)
</span><del>-        return completionHandler();
</del><ins>+        return;
</ins><span class="cx"> 
</span><del>-    m_resourceLoadStatistics->didDestroyNetworkSession(WTFMove(completionHandler));
</del><ins>+    m_resourceLoadStatistics->didDestroyNetworkSession();
</ins><span class="cx">     m_resourceLoadStatistics = nullptr;
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="lines">@@ -157,7 +157,7 @@
</span><span class="cx">     if (auto* storageSession = networkStorageSession())
</span><span class="cx">         storageSession->setResourceLoadStatisticsEnabled(enable);
</span><span class="cx">     if (!enable) {
</span><del>-        destroyResourceLoadStatistics([] { });
</del><ins>+        destroyResourceLoadStatistics();
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -181,13 +181,10 @@
</span><span class="cx"> 
</span><span class="cx"> void NetworkSession::recreateResourceLoadStatisticStore(CompletionHandler<void()>&& completionHandler)
</span><span class="cx"> {
</span><del>-    destroyResourceLoadStatistics([this, weakThis = makeWeakPtr(*this), completionHandler = WTFMove(completionHandler)] () mutable {
-        if (!weakThis)
-            return completionHandler();
-        m_resourceLoadStatistics = WebResourceLoadStatisticsStore::create(*this, m_resourceLoadStatisticsDirectory, m_shouldIncludeLocalhostInResourceLoadStatistics);
-        m_resourceLoadStatistics->populateMemoryStoreFromDisk(WTFMove(completionHandler));
-        forwardResourceLoadStatisticsSettings();
-    });
</del><ins>+    destroyResourceLoadStatistics();
+    m_resourceLoadStatistics = WebResourceLoadStatisticsStore::create(*this, m_resourceLoadStatisticsDirectory, m_shouldIncludeLocalhostInResourceLoadStatistics);
+    m_resourceLoadStatistics->populateMemoryStoreFromDisk(WTFMove(completionHandler));
+    forwardResourceLoadStatisticsSettings();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void NetworkSession::forwardResourceLoadStatisticsSettings()
</span></span></pre></div>
<a id="branchessafari609290branchSourceWebKitNetworkProcessNetworkSessionh"></a>
<div class="modfile"><h4>Modified: branches/safari-609.2.9.0-branch/Source/WebKit/NetworkProcess/NetworkSession.h (260954 => 260955)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-609.2.9.0-branch/Source/WebKit/NetworkProcess/NetworkSession.h   2020-04-30 17:52:08 UTC (rev 260954)
+++ branches/safari-609.2.9.0-branch/Source/WebKit/NetworkProcess/NetworkSession.h      2020-04-30 17:56:42 UTC (rev 260955)
</span><span class="lines">@@ -100,7 +100,6 @@
</span><span class="cx">     void setShouldDowngradeReferrerForTesting(bool);
</span><span class="cx">     bool shouldDowngradeReferrer() const;
</span><span class="cx">     void setThirdPartyCookieBlockingMode(WebCore::ThirdPartyCookieBlockingMode);
</span><del>-    void destroyResourceLoadStatistics(CompletionHandler<void()>&&);
</del><span class="cx"> #endif
</span><span class="cx">     void storeAdClickAttribution(WebCore::AdClickAttribution&&);
</span><span class="cx">     void handleAdClickAttributionConversion(WebCore::AdClickAttribution::Conversion&&, const URL& requestURL, const WebCore::ResourceRequest& redirectRequest);
</span><span class="lines">@@ -139,6 +138,7 @@
</span><span class="cx">     NetworkSession(NetworkProcess&, const NetworkSessionCreationParameters&);
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(RESOURCE_LOAD_STATISTICS)
</span><ins>+    void destroyResourceLoadStatistics();
</ins><span class="cx">     void forwardResourceLoadStatisticsSettings();
</span><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre></div>
<a id="branchessafari609290branchSourceWebKitUIProcessNetworkNetworkProcessProxycpp"></a>
<div class="modfile"><h4>Modified: branches/safari-609.2.9.0-branch/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp (260954 => 260955)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-609.2.9.0-branch/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp 2020-04-30 17:52:08 UTC (rev 260954)
+++ branches/safari-609.2.9.0-branch/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp    2020-04-30 17:56:42 UTC (rev 260955)
</span><span class="lines">@@ -91,6 +91,9 @@
</span><span class="cx">     , m_throttler(*this, processPool.shouldTakeUIBackgroundAssertion())
</span><span class="cx"> {
</span><span class="cx">     connect();
</span><ins>+
+    if (auto* websiteDataStore = m_processPool.websiteDataStore())
+        m_websiteDataStores.set(websiteDataStore->sessionID(), makeRef(*websiteDataStore));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> NetworkProcessProxy::~NetworkProcessProxy()
</span><span class="lines">@@ -1167,6 +1170,7 @@
</span><span class="cx"> #if ENABLE(INDEXED_DATABASE)
</span><span class="cx">         createSymLinkForFileUpgrade(store->resolvedIndexedDatabaseDirectory());
</span><span class="cx"> #endif
</span><ins>+        m_websiteDataStores.set(sessionID, WTFMove(store));
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1174,6 +1178,8 @@
</span><span class="cx"> {
</span><span class="cx">     if (canSendMessage())
</span><span class="cx">         send(Messages::NetworkProcess::DestroySession { sessionID }, 0);
</span><ins>+    if (!sessionID.isEphemeral())
+        m_websiteDataStores.remove(sessionID);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> WebsiteDataStore* NetworkProcessProxy::websiteDataStoreFromSessionID(PAL::SessionID sessionID)
</span></span></pre></div>
<a id="branchessafari609290branchSourceWebKitUIProcessNetworkNetworkProcessProxyh"></a>
<div class="modfile"><h4>Modified: branches/safari-609.2.9.0-branch/Source/WebKit/UIProcess/Network/NetworkProcessProxy.h (260954 => 260955)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-609.2.9.0-branch/Source/WebKit/UIProcess/Network/NetworkProcessProxy.h   2020-04-30 17:52:08 UTC (rev 260954)
+++ branches/safari-609.2.9.0-branch/Source/WebKit/UIProcess/Network/NetworkProcessProxy.h      2020-04-30 17:56:42 UTC (rev 260955)
</span><span class="lines">@@ -295,6 +295,8 @@
</span><span class="cx">     HashSet<WebUserContentControllerProxy*> m_webUserContentControllerProxies;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+    HashMap<PAL::SessionID, RefPtr<WebsiteDataStore>> m_websiteDataStores;
+
</ins><span class="cx">     std::unique_ptr<ProcessAssertion> m_uploadAssertion;
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>