<!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>[279354] trunk/Source/WebKit</title>
</head>
<body>

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

<h3>Log Message</h3>
<pre>NetworkProcessProxy::networkProcessDidTerminate() should copy process pools before iterating over them
https://bugs.webkit.org/show_bug.cgi?id=227468

Reviewed by Alex Christensen.

* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::networkProcessDidTerminate):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKitChangeLog">trunk/Source/WebKit/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitSharedAPIAPIURLRequestcpp">trunk/Source/WebKit/Shared/API/APIURLRequest.cpp</a></li>
<li><a href="#trunkSourceWebKitUIProcessAPICocoaWKProcessPoolmm">trunk/Source/WebKit/UIProcess/API/Cocoa/WKProcessPool.mm</a></li>
<li><a href="#trunkSourceWebKitUIProcessCocoaPreferenceObservermm">trunk/Source/WebKit/UIProcess/Cocoa/PreferenceObserver.mm</a></li>
<li><a href="#trunkSourceWebKitUIProcessCocoaWKFullKeyboardAccessWatchermm">trunk/Source/WebKit/UIProcess/Cocoa/WKFullKeyboardAccessWatcher.mm</a></li>
<li><a href="#trunkSourceWebKitUIProcessCocoaWebInspectorPreferenceObservermm">trunk/Source/WebKit/UIProcess/Cocoa/WebInspectorPreferenceObserver.mm</a></li>
<li><a href="#trunkSourceWebKitUIProcessCocoaWebProcessPoolCocoamm">trunk/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm</a></li>
<li><a href="#trunkSourceWebKitUIProcessLegacyGlobalSettingscpp">trunk/Source/WebKit/UIProcess/LegacyGlobalSettings.cpp</a></li>
<li><a href="#trunkSourceWebKitUIProcessNetworkNetworkProcessProxycpp">trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp</a></li>
<li><a href="#trunkSourceWebKitUIProcessPluginsPluginProcessProxycpp">trunk/Source/WebKit/UIProcess/Plugins/PluginProcessProxy.cpp</a></li>
<li><a href="#trunkSourceWebKitUIProcessWebMemoryPressureHandlercpp">trunk/Source/WebKit/UIProcess/WebMemoryPressureHandler.cpp</a></li>
<li><a href="#trunkSourceWebKitUIProcessWebPageProxycpp">trunk/Source/WebKit/UIProcess/WebPageProxy.cpp</a></li>
<li><a href="#trunkSourceWebKitUIProcessWebProcessPoolcpp">trunk/Source/WebKit/UIProcess/WebProcessPool.cpp</a></li>
<li><a href="#trunkSourceWebKitUIProcessWebProcessPoolh">trunk/Source/WebKit/UIProcess/WebProcessPool.h</a></li>
<li><a href="#trunkSourceWebKitUIProcessWebsiteDataWebsiteDataStorecpp">trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp</a></li>
<li><a href="#trunkSourceWebKitUIProcessgtkWebTextCheckercpp">trunk/Source/WebKit/UIProcess/gtk/WebTextChecker.cpp</a></li>
<li><a href="#trunkSourceWebKitUIProcesslinuxMemoryPressureMonitorcpp">trunk/Source/WebKit/UIProcess/linux/MemoryPressureMonitor.cpp</a></li>
<li><a href="#trunkSourceWebKitUIProcessmacWindowServerConnectionmm">trunk/Source/WebKit/UIProcess/mac/WindowServerConnection.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ChangeLog (279353 => 279354)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ChangeLog    2021-06-29 00:21:51 UTC (rev 279353)
+++ trunk/Source/WebKit/ChangeLog       2021-06-29 00:24:54 UTC (rev 279354)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2021-06-28  Chris Dumez  <cdumez@apple.com>
+
+        NetworkProcessProxy::networkProcessDidTerminate() should copy process pools before iterating over them
+        https://bugs.webkit.org/show_bug.cgi?id=227468
+
+        Reviewed by Alex Christensen.
+
+        * UIProcess/Network/NetworkProcessProxy.cpp:
+        (WebKit::NetworkProcessProxy::networkProcessDidTerminate):
+
</ins><span class="cx"> 2021-06-28  Sihui Liu  <sihui_liu@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Nullptr crash in ResourceLoadStatisticsDatabaseStore::allAttributedPrivateClickMeasurement
</span></span></pre></div>
<a id="trunkSourceWebKitSharedAPIAPIURLRequestcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Shared/API/APIURLRequest.cpp (279353 => 279354)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Shared/API/APIURLRequest.cpp 2021-06-29 00:21:51 UTC (rev 279353)
+++ trunk/Source/WebKit/Shared/API/APIURLRequest.cpp    2021-06-29 00:24:54 UTC (rev 279354)
</span><span class="lines">@@ -48,7 +48,7 @@
</span><span class="cx"> {
</span><span class="cx">     ResourceRequest::setDefaultTimeoutInterval(timeoutInterval);
</span><span class="cx"> 
</span><del>-    for (auto* processPool : WebProcessPool::allProcessPools())
</del><ins>+    for (auto& processPool : WebProcessPool::allProcessPools())
</ins><span class="cx">         processPool->setDefaultRequestTimeoutInterval(timeoutInterval);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessAPICocoaWKProcessPoolmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKProcessPool.mm (279353 => 279354)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKProcessPool.mm 2021-06-29 00:21:51 UTC (rev 279353)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKProcessPool.mm    2021-06-29 00:24:54 UTC (rev 279354)
</span><span class="lines">@@ -176,7 +176,7 @@
</span><span class="cx"> + (NSArray<WKProcessPool *> *)_allProcessPoolsForTesting
</span><span class="cx"> {
</span><span class="cx">     return createNSArray(WebKit::WebProcessPool::allProcessPools(), [] (auto& pool) {
</span><del>-        return wrapper(*pool);
</del><ins>+        return wrapper(pool.get());
</ins><span class="cx">     }).autorelease();
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessCocoaPreferenceObservermm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/Cocoa/PreferenceObserver.mm (279353 => 279354)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/Cocoa/PreferenceObserver.mm        2021-06-29 00:21:51 UTC (rev 279353)
+++ trunk/Source/WebKit/UIProcess/Cocoa/PreferenceObserver.mm   2021-06-29 00:24:54 UTC (rev 279354)
</span><span class="lines">@@ -180,7 +180,7 @@
</span><span class="cx">         if (encodedValue)
</span><span class="cx">             encodedString = String(encodedValue.get());
</span><span class="cx"> 
</span><del>-        for (auto* processPool : WebKit::WebProcessPool::allProcessPools())
</del><ins>+        for (auto& processPool : WebKit::WebProcessPool::allProcessPools())
</ins><span class="cx">             processPool->notifyPreferencesChanged(domain.get(), key.get(), encodedString);
</span><span class="cx">     });
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessCocoaWKFullKeyboardAccessWatchermm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/Cocoa/WKFullKeyboardAccessWatcher.mm (279353 => 279354)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/Cocoa/WKFullKeyboardAccessWatcher.mm       2021-06-29 00:21:51 UTC (rev 279353)
+++ trunk/Source/WebKit/UIProcess/Cocoa/WKFullKeyboardAccessWatcher.mm  2021-06-29 00:24:54 UTC (rev 279354)
</span><span class="lines">@@ -64,7 +64,7 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)notifyAllProcessPools
</span><span class="cx"> {
</span><del>-    for (auto* processPool : WebKit::WebProcessPool::allProcessPools())
</del><ins>+    for (auto& processPool : WebKit::WebProcessPool::allProcessPools())
</ins><span class="cx">         processPool->fullKeyboardAccessModeChanged(fullKeyboardAccessEnabled);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessCocoaWebInspectorPreferenceObservermm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/Cocoa/WebInspectorPreferenceObserver.mm (279353 => 279354)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/Cocoa/WebInspectorPreferenceObserver.mm    2021-06-29 00:21:51 UTC (rev 279353)
+++ trunk/Source/WebKit/UIProcess/Cocoa/WebInspectorPreferenceObserver.mm       2021-06-29 00:24:54 UTC (rev 279354)
</span><span class="lines">@@ -64,7 +64,7 @@
</span><span class="cx"> - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary<NSKeyValueChangeKey, id> *)change context:(void *)context
</span><span class="cx"> {
</span><span class="cx">     RunLoop::main().dispatch([] {
</span><del>-        for (auto* pool : WebKit::WebProcessPool::allProcessPools()) {
</del><ins>+        for (auto& pool : WebKit::WebProcessPool::allProcessPools()) {
</ins><span class="cx">             for (size_t i = 0; i < pool->processes().size(); ++i) {
</span><span class="cx">                 auto process = pool->processes()[i];
</span><span class="cx">                 process->enableRemoteInspectorIfNeeded();
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessCocoaWebProcessPoolCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm (279353 => 279354)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm       2021-06-29 00:21:51 UTC (rev 279353)
+++ trunk/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm  2021-06-29 00:24:54 UTC (rev 279354)
</span><span class="lines">@@ -913,7 +913,7 @@
</span><span class="cx"> 
</span><span class="cx"> void WebProcessPool::notifyProcessPoolsApplicationIsAboutToSuspend()
</span><span class="cx"> {
</span><del>-    for (auto* processPool : allProcessPools())
</del><ins>+    for (auto& processPool : allProcessPools())
</ins><span class="cx">         processPool->applicationIsAboutToSuspend();
</span><span class="cx"> }
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessLegacyGlobalSettingscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/LegacyGlobalSettings.cpp (279353 => 279354)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/LegacyGlobalSettings.cpp   2021-06-29 00:21:51 UTC (rev 279353)
+++ trunk/Source/WebKit/UIProcess/LegacyGlobalSettings.cpp      2021-06-29 00:24:54 UTC (rev 279354)
</span><span class="lines">@@ -42,7 +42,7 @@
</span><span class="cx"> void LegacyGlobalSettings::setCacheModel(CacheModel cacheModel)
</span><span class="cx"> {
</span><span class="cx">     m_cacheModel = cacheModel;
</span><del>-    for (auto processPool : WebProcessPool::allProcessPools())
</del><ins>+    for (auto& processPool : WebProcessPool::allProcessPools())
</ins><span class="cx">         processPool->setCacheModel(cacheModel);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessNetworkNetworkProcessProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp (279353 => 279354)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp    2021-06-29 00:21:51 UTC (rev 279353)
+++ trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp       2021-06-29 00:24:54 UTC (rev 279354)
</span><span class="lines">@@ -172,7 +172,7 @@
</span><span class="cx"> 
</span><span class="cx"> static bool anyProcessPoolAlwaysRunsAtBackgroundPriority()
</span><span class="cx"> {
</span><del>-    for (auto* processPool : WebProcessPool::allProcessPools()) {
</del><ins>+    for (auto& processPool : WebProcessPool::allProcessPools()) {
</ins><span class="cx">         if (processPool->alwaysRunsAtBackgroundPriority())
</span><span class="cx">             return true;
</span><span class="cx">     }
</span><span class="lines">@@ -181,7 +181,7 @@
</span><span class="cx"> 
</span><span class="cx"> static bool anyProcessPoolShouldTakeUIBackgroundAssertion()
</span><span class="cx"> {
</span><del>-    for (auto* processPool : WebProcessPool::allProcessPools()) {
</del><ins>+    for (auto& processPool : WebProcessPool::allProcessPools()) {
</ins><span class="cx">         if (processPool->shouldTakeUIBackgroundAssertion())
</span><span class="cx">             return true;
</span><span class="cx">     }
</span><span class="lines">@@ -323,7 +323,7 @@
</span><span class="cx">     if (defaultNetworkProcess() == this)
</span><span class="cx">         defaultNetworkProcess() = nullptr;
</span><span class="cx"> 
</span><del>-    for (auto* processPool : WebProcessPool::allProcessPools())
</del><ins>+    for (auto& processPool : WebProcessPool::allProcessPools())
</ins><span class="cx">         processPool->networkProcessDidTerminate(*this, reason);
</span><span class="cx">     for (auto& websiteDataStore : copyToVectorOf<Ref<WebsiteDataStore>>(m_websiteDataStores))
</span><span class="cx">         websiteDataStore->networkProcessDidTerminate(*this);
</span><span class="lines">@@ -1218,7 +1218,7 @@
</span><span class="cx"> 
</span><span class="cx"> void NetworkProcessProxy::setDomainsWithUserInteraction(HashSet<WebCore::RegistrableDomain>&& domains)
</span><span class="cx"> {
</span><del>-    for (auto* processPool : WebProcessPool::allProcessPools())
</del><ins>+    for (auto& processPool : WebProcessPool::allProcessPools())
</ins><span class="cx">         processPool->setDomainsWithUserInteraction(HashSet<WebCore::RegistrableDomain> { domains });
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1226,7 +1226,7 @@
</span><span class="cx"> {    
</span><span class="cx">     auto callbackAggregator = CallbackAggregator::create(WTFMove(completionHandler));
</span><span class="cx">     
</span><del>-    for (auto* processPool : WebProcessPool::allProcessPools())
</del><ins>+    for (auto& processPool : WebProcessPool::allProcessPools())
</ins><span class="cx">         processPool->setDomainsWithCrossPageStorageAccess(HashMap<TopFrameDomain, SubResourceDomain> { domains }, [callbackAggregator] { });
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1511,7 +1511,7 @@
</span><span class="cx"> 
</span><span class="cx"> static bool anyProcessPoolHasForegroundWebProcesses()
</span><span class="cx"> {
</span><del>-    for (auto* processPool : WebProcessPool::allProcessPools()) {
</del><ins>+    for (auto& processPool : WebProcessPool::allProcessPools()) {
</ins><span class="cx">         if (processPool->hasForegroundWebProcesses())
</span><span class="cx">             return true;
</span><span class="cx">     }
</span><span class="lines">@@ -1520,7 +1520,7 @@
</span><span class="cx"> 
</span><span class="cx"> static bool anyProcessPoolHasBackgroundWebProcesses()
</span><span class="cx"> {
</span><del>-    for (auto* processPool : WebProcessPool::allProcessPools()) {
</del><ins>+    for (auto& processPool : WebProcessPool::allProcessPools()) {
</ins><span class="cx">         if (processPool->hasBackgroundWebProcesses())
</span><span class="cx">             return true;
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessPluginsPluginProcessProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/Plugins/PluginProcessProxy.cpp (279353 => 279354)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/Plugins/PluginProcessProxy.cpp     2021-06-29 00:21:51 UTC (rev 279353)
+++ trunk/Source/WebKit/UIProcess/Plugins/PluginProcessProxy.cpp        2021-06-29 00:24:54 UTC (rev 279354)
</span><span class="lines">@@ -207,9 +207,8 @@
</span><span class="cx">         exitFullscreen();
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    const Vector<WebProcessPool*>& processPools = WebProcessPool::allProcessPools();
-    for (size_t i = 0; i < processPools.size(); ++i)
-        processPools[i]->sendToAllProcesses(Messages::PluginProcessConnectionManager::PluginProcessCrashed(m_pluginProcessToken));
</del><ins>+    for (auto& processPool : WebProcessPool::allProcessPools())
+        processPool->sendToAllProcesses(Messages::PluginProcessConnectionManager::PluginProcessCrashed(m_pluginProcessToken));
</ins><span class="cx"> 
</span><span class="cx">     // This will cause us to be deleted.
</span><span class="cx">     pluginProcessCrashedOrFailedToLaunch();
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessWebMemoryPressureHandlercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/WebMemoryPressureHandler.cpp (279353 => 279354)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/WebMemoryPressureHandler.cpp       2021-06-29 00:21:51 UTC (rev 279353)
+++ trunk/Source/WebKit/UIProcess/WebMemoryPressureHandler.cpp  2021-06-29 00:24:54 UTC (rev 279354)
</span><span class="lines">@@ -43,7 +43,7 @@
</span><span class="cx">         ViewSnapshotStore::singleton().discardSnapshotImages();
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-        for (auto* processPool : WebProcessPool::allProcessPools())
</del><ins>+        for (auto& processPool : WebProcessPool::allProcessPools())
</ins><span class="cx">             processPool->handleMemoryPressureWarning(critical);
</span><span class="cx">     });
</span><span class="cx">     memoryPressureHandler.install();
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessWebPageProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.cpp (279353 => 279354)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/WebPageProxy.cpp   2021-06-29 00:21:51 UTC (rev 279353)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.cpp      2021-06-29 00:24:54 UTC (rev 279354)
</span><span class="lines">@@ -5444,11 +5444,7 @@
</span><span class="cx">     if (processPools.isEmpty())
</span><span class="cx">         return nullptr;
</span><span class="cx">     
</span><del>-    auto processPool = processPools[0];
-    if (!processPool)
-        return nullptr;
-    
-    for (auto& webProcess : processPool->processes()) {
</del><ins>+    for (auto& webProcess : processPools[0]->processes()) {
</ins><span class="cx">         for (auto& page : webProcess->pages()) {
</span><span class="cx">             if (page->sessionID().isEphemeral())
</span><span class="cx">                 continue;
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessWebProcessPoolcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/WebProcessPool.cpp (279353 => 279354)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/WebProcessPool.cpp 2021-06-29 00:21:51 UTC (rev 279353)
+++ trunk/Source/WebKit/UIProcess/WebProcessPool.cpp    2021-06-29 00:24:54 UTC (rev 279354)
</span><span class="lines">@@ -174,9 +174,11 @@
</span><span class="cx">     return processPools;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-const Vector<WebProcessPool*>& WebProcessPool::allProcessPools()
</del><ins>+Vector<Ref<WebProcessPool>> WebProcessPool::allProcessPools()
</ins><span class="cx"> {
</span><del>-    return processPools();
</del><ins>+    return WTF::map(processPools(), [] (auto&& v) -> Ref<WebProcessPool> {
+        return *v;
+    });
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static HashSet<String, ASCIICaseInsensitiveHash>& globalURLSchemesWithCustomProtocolHandlers()
</span><span class="lines">@@ -2041,11 +2043,8 @@
</span><span class="cx">     WEBPROCESSPOOL_RELEASE_LOG_STATIC(ServiceWorker, "setUseSeparateServiceWorkerProcess: (useSeparateServiceWorkerProcess=%d)", useSeparateServiceWorkerProcess);
</span><span class="cx"> 
</span><span class="cx">     s_useSeparateServiceWorkerProcess = useSeparateServiceWorkerProcess;
</span><del>-    auto processPools = WTF::map(WebProcessPool::allProcessPools(), [](auto* pool) { return makeWeakPtr(pool); });
-    for (auto& processPool : processPools) {
-        if (processPool)
-            processPool->terminateServiceWorkers();
-    }
</del><ins>+    for (auto& processPool : allProcessPools())
+        processPool->terminateServiceWorkers();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(SERVICE_WORKER)
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessWebProcessPoolh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/WebProcessPool.h (279353 => 279354)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/WebProcessPool.h   2021-06-29 00:21:51 UTC (rev 279353)
+++ trunk/Source/WebKit/UIProcess/WebProcessPool.h      2021-06-29 00:24:54 UTC (rev 279354)
</span><span class="lines">@@ -138,7 +138,7 @@
</span><span class="cx"> 
</span><span class="cx">     API::ProcessPoolConfiguration& configuration() { return m_configuration.get(); }
</span><span class="cx"> 
</span><del>-    static const Vector<WebProcessPool*>& allProcessPools();
</del><ins>+    static Vector<Ref<WebProcessPool>> allProcessPools();
</ins><span class="cx"> 
</span><span class="cx">     template <typename T>
</span><span class="cx">     T* supplement()
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessWebsiteDataWebsiteDataStorecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp (279353 => 279354)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp   2021-06-29 00:21:51 UTC (rev 279353)
+++ trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp      2021-06-29 00:24:54 UTC (rev 279354)
</span><span class="lines">@@ -1288,7 +1288,7 @@
</span><span class="cx">         });
</span><span class="cx">     });
</span><span class="cx">     
</span><del>-    for (auto* processPool : WebProcessPool::allProcessPools())
</del><ins>+    for (auto& processPool : WebProcessPool::allProcessPools())
</ins><span class="cx">         processPool->sendResourceLoadStatisticsDataImmediately([wtfCallbackAggregator] { });
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1629,7 +1629,7 @@
</span><span class="cx">     if (processPools.isEmpty()) {
</span><span class="cx">         // Check if we're one of the legacy data stores.
</span><span class="cx">         for (auto& processPool : WebProcessPool::allProcessPools()) {
</span><del>-            processPools.add(processPool);
</del><ins>+            processPools.add(processPool.ptr());
</ins><span class="cx">             if (processPools.size() == limit)
</span><span class="cx">                 break;
</span><span class="cx">         }
</span><span class="lines">@@ -1911,7 +1911,7 @@
</span><span class="cx"> 
</span><span class="cx"> void WebsiteDataStore::setCacheModelSynchronouslyForTesting(CacheModel cacheModel)
</span><span class="cx"> {
</span><del>-    for (auto processPool : WebProcessPool::allProcessPools())
</del><ins>+    for (auto& processPool : WebProcessPool::allProcessPools())
</ins><span class="cx">         processPool->setCacheModelSynchronouslyForTesting(cacheModel);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessgtkWebTextCheckercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/gtk/WebTextChecker.cpp (279353 => 279354)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/gtk/WebTextChecker.cpp     2021-06-29 00:21:51 UTC (rev 279353)
+++ trunk/Source/WebKit/UIProcess/gtk/WebTextChecker.cpp        2021-06-29 00:24:54 UTC (rev 279354)
</span><span class="lines">@@ -51,9 +51,8 @@
</span><span class="cx"> 
</span><span class="cx"> static void updateStateForAllContexts()
</span><span class="cx"> {
</span><del>-    const Vector<WebProcessPool*>& contexts = WebProcessPool::allProcessPools();
-    for (size_t i = 0; i < contexts.size(); ++i)
-        contexts[i]->textCheckerStateChanged();
</del><ins>+    for (auto& processPool : WebProcessPool::allProcessPools())
+        processPool->textCheckerStateChanged();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebTextChecker::continuousSpellCheckingEnabledStateChanged(bool enabled)
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcesslinuxMemoryPressureMonitorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/linux/MemoryPressureMonitor.cpp (279353 => 279354)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/linux/MemoryPressureMonitor.cpp    2021-06-29 00:21:51 UTC (rev 279353)
+++ trunk/Source/WebKit/UIProcess/linux/MemoryPressureMonitor.cpp       2021-06-29 00:24:54 UTC (rev 279354)
</span><span class="lines">@@ -380,7 +380,7 @@
</span><span class="cx">             if (usedPercentage >= s_memoryPresurePercentageThreshold) {
</span><span class="cx">                 bool isCritical = (usedPercentage >= s_memoryPresurePercentageThresholdCritical);
</span><span class="cx">                 RunLoop::main().dispatch([isCritical] {
</span><del>-                    for (auto* processPool : WebProcessPool::allProcessPools())
</del><ins>+                    for (auto& processPool : WebProcessPool::allProcessPools())
</ins><span class="cx">                         processPool->sendMemoryPressureEvent(isCritical);
</span><span class="cx">                 });
</span><span class="cx">             }
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessmacWindowServerConnectionmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/mac/WindowServerConnection.mm (279353 => 279354)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/mac/WindowServerConnection.mm      2021-06-29 00:21:51 UTC (rev 279353)
+++ trunk/Source/WebKit/UIProcess/mac/WindowServerConnection.mm 2021-06-29 00:24:54 UTC (rev 279354)
</span><span class="lines">@@ -43,7 +43,7 @@
</span><span class="cx"> 
</span><span class="cx"> void WindowServerConnection::windowServerConnectionStateChanged()
</span><span class="cx"> {
</span><del>-    for (auto* processPool : WebProcessPool::allProcessPools())
</del><ins>+    for (auto& processPool : WebProcessPool::allProcessPools())
</ins><span class="cx">         processPool->windowServerConnectionStateChanged();
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>