Changeset 286800 in webkit
- Timestamp:
- Dec 9, 2021, 1:14:04 PM (5 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 4 edited
-
ChangeLog (modified) (1 diff)
-
UIProcess/WebProcessCache.cpp (modified) (1 diff)
-
UIProcess/WebProcessProxy.cpp (modified) (2 diffs)
-
UIProcess/WebProcessProxy.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r286799 r286800 1 2021-12-09 Chris Dumez <cdumez@apple.com> 2 3 [WPE] Crash under WebProcessProxy::setIsInProcessCache when closing web view in debug builds 4 https://bugs.webkit.org/show_bug.cgi?id=233933 5 6 Reviewed by Geoffrey Garen. 7 8 The crash would occur because the WebProcessPool destructor would call WebProcessCache::clear() 9 which would destroy WebProcessCache::CachedProcess objects, causing 10 WebProcessProxy::setIsInProcessCache(false) to get called. Previously, this call to 11 setIsInProcessCache() would convert the WeakPtr the WebProcessProxy held to its process pool 12 into a RefPtr, thus causing the WebProcessPool to get ref'd while in the middle of destruction. 13 14 To address the issue, the setIsInProcessCache() setter now takes a WillShutDown flag that gets 15 set in the CachedProcess destructor and which causes setIsInProcessCache() to return early 16 right after setting the m_isInProcessCache flag, without trying to send IPC to the WebProcess 17 or trying to ref the WebProcessPool. 18 19 * UIProcess/WebProcessCache.cpp: 20 (WebKit::WebProcessCache::CachedProcess::~CachedProcess): 21 * UIProcess/WebProcessProxy.cpp: 22 (WebKit::WebProcessProxy::setIsInProcessCache): 23 * UIProcess/WebProcessProxy.h: 24 1 25 2021-12-08 BJ Burg <bburg@apple.com> 2 26 -
trunk/Source/WebKit/UIProcess/WebProcessCache.cpp
r285594 r286800 295 295 m_process->platformResumeProcess(); 296 296 #endif 297 m_process->setIsInProcessCache(false );297 m_process->setIsInProcessCache(false, WebProcessProxy::WillShutDown::Yes); 298 298 m_process->shutDown(); 299 299 } -
trunk/Source/WebKit/UIProcess/WebProcessProxy.cpp
r286455 r286800 310 310 #endif 311 311 312 void WebProcessProxy::setIsInProcessCache(bool value )312 void WebProcessProxy::setIsInProcessCache(bool value, WillShutDown willShutDown) 313 313 { 314 314 WEBPROCESSPROXY_RELEASE_LOG(Process, "setIsInProcessCache(%d)", value); … … 321 321 ASSERT(m_isInProcessCache != value); 322 322 m_isInProcessCache = value; 323 324 // No point in doing anything else if the process is about to shut down. 325 ASSERT(willShutDown == WillShutDown::No || !value); 326 if (willShutDown == WillShutDown::Yes) 327 return; 323 328 324 329 send(Messages::WebProcess::SetIsInProcessCache(m_isInProcessCache), 0); -
trunk/Source/WebKit/UIProcess/WebProcessProxy.h
r286455 r286800 157 157 WebCore::RegistrableDomain registrableDomain() const { return m_registrableDomain.value_or(WebCore::RegistrableDomain { }); } 158 158 const std::optional<WebCore::RegistrableDomain>& optionalRegistrableDomain() const { return m_registrableDomain; } 159 void setIsInProcessCache(bool); 159 160 enum class WillShutDown : bool { No, Yes }; 161 void setIsInProcessCache(bool, WillShutDown = WillShutDown::No); 160 162 bool isInProcessCache() const { return m_isInProcessCache; } 161 163
Note:
See TracChangeset
for help on using the changeset viewer.