Changeset 245931 in webkit
- Timestamp:
- May 30, 2019, 5:30:30 PM (7 years ago)
- Location:
- branches/safari-607-branch/Source/WebKit
- Files:
-
- 3 edited
-
ChangeLog (modified) (1 diff)
-
UIProcess/WebProcessCache.cpp (modified) (2 diffs)
-
UIProcess/WebProcessProxy.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/safari-607-branch/Source/WebKit/ChangeLog
r245930 r245931 1 2019-05-30 Kocsen Chung <kocsen_chung@apple.com> 2 3 Apply patch. rdar://problem/51264847 4 5 2019-05-30 Chris Dumez <cdumez@apple.com> 6 7 <rdar://problem/50435250> v2: CrashTracer: Crash in WebProcessCache::removeProcess 8 9 Reviewed by Geoff Garen. 10 11 * UIProcess/WebProcessCache.cpp: 12 (WebKit::WebProcessCache::removeProcess): 13 This code change is to avoid crashing if my speculative fix below does not work. If 14 WebProcessCache::removeProcess() gets called with a process whole registrable domain 15 is empty (or null), remove it the slow way from the HashMap instead of trying to look 16 up the bad registrable domain in the HashMap. This ensures we do no crash but still 17 remove the process we're supposed to evict. 18 19 * UIProcess/WebProcessProxy.cpp: 20 (WebKit::WebProcessProxy::canTerminateChildProcess): 21 This is a speculative fix for the crash which aligns the branch with trunk. There is 22 a period of time where a SuspendedPageProxy can exist for a given process but the 23 WebProcessPool is no longer aware of it. This is when we're about to use the 24 SuspendedPageProxy for a load. If WebProcessProxy::maybeShutDown() gets called during 25 this period of time, canTerminateChildProcess() would incorrectly return true and we 26 would cache the WebProcess even though it is about to do a load. The new code relies 27 on m_suspendedPageCount which is a lot more reliable than asking the process pool. 28 1 29 2019-05-30 Kocsen Chung <kocsen_chung@apple.com> 2 30 -
branches/safari-607-branch/Source/WebKit/UIProcess/WebProcessCache.cpp
r244190 r245931 192 192 193 193 std::unique_ptr<CachedProcess> cachedProcess; 194 auto it = m_processesPerRegistrableDomain.find(process.registrableDomain()); 195 if (it != m_processesPerRegistrableDomain.end() && &it->value->process() == &process) { 196 cachedProcess = WTFMove(it->value); 197 m_processesPerRegistrableDomain.remove(it); 194 auto registrableDomain = process.registrableDomain(); 195 ASSERT(!registrableDomain.isEmpty()); 196 if (registrableDomain.isEmpty()) { 197 for (auto it = m_processesPerRegistrableDomain.begin(); it != m_processesPerRegistrableDomain.end(); ++it) { 198 if (&it->value->process() == &process) { 199 cachedProcess = WTFMove(it->value); 200 m_processesPerRegistrableDomain.remove(it); 201 break; 202 } 203 } 198 204 } else { 205 auto it = m_processesPerRegistrableDomain.find(registrableDomain); 206 if (it != m_processesPerRegistrableDomain.end() && &it->value->process() == &process) { 207 cachedProcess = WTFMove(it->value); 208 m_processesPerRegistrableDomain.remove(it); 209 } 210 } 211 212 if (!cachedProcess) { 199 213 for (auto& pair : m_pendingAddRequests) { 200 214 if (&pair.value->process() == &process) { … … 205 219 } 206 220 } 221 207 222 ASSERT(cachedProcess); 208 223 if (!cachedProcess) -
branches/safari-607-branch/Source/WebKit/UIProcess/WebProcessProxy.cpp
r245930 r245931 1004 1004 bool WebProcessProxy::canTerminateChildProcess() 1005 1005 { 1006 if (!m_pageMap.isEmpty() || m_ processPool->hasSuspendedPageFor(*this)|| !m_provisionalPages.isEmpty() || m_isInProcessCache)1006 if (!m_pageMap.isEmpty() || m_suspendedPageCount || !m_provisionalPages.isEmpty() || m_isInProcessCache) 1007 1007 return false; 1008 1008
Note:
See TracChangeset
for help on using the changeset viewer.