Changeset 258530 in webkit
- Timestamp:
- Mar 16, 2020 5:03:57 PM (4 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r258529 r258530 1 2020-03-16 Chris Dumez <cdumez@apple.com> 2 3 Crash under WebCookieCache::clearForHost() 4 https://bugs.webkit.org/show_bug.cgi?id=209149 5 <rdar://problem/60453086> 6 7 Reviewed by Darin Adler. 8 9 Alternative fix for Bug 209149 based on comments from Darin. 10 11 * WebProcess/WebPage/WebCookieCache.cpp: 12 (WebKit::WebCookieCache::clearForHost): 13 (WebKit::WebCookieCache::pruneCacheIfNecessary): 14 1 15 2020-03-16 Tim Horton <timothy_horton@apple.com> 2 16 -
trunk/Source/WebKit/WebProcess/WebPage/WebCookieCache.cpp
r258521 r258530 103 103 void WebCookieCache::clearForHost(const String& host) 104 104 { 105 auto it = m_hostsWithInMemoryStorage.find(host);106 if ( it == m_hostsWithInMemoryStorage.end())105 String removedHost = m_hostsWithInMemoryStorage.take(host); 106 if (removedHost.isNull()) 107 107 return; 108 108 109 m_hostsWithInMemoryStorage.remove(it); 110 inMemoryStorageSession().deleteCookiesForHostnames(Vector<String> { host }); 109 inMemoryStorageSession().deleteCookiesForHostnames(Vector<String> { removedHost }); 111 110 #if HAVE(COOKIE_CHANGE_LISTENER_API) 112 WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::UnsubscribeFromCookieChangeNotifications(HashSet<String> { host }), 0);111 WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::UnsubscribeFromCookieChangeNotifications(HashSet<String> { removedHost }), 0); 113 112 #endif 114 113 } … … 119 118 static const unsigned maxCachedHosts = 5; 120 119 121 while (m_hostsWithInMemoryStorage.size() >= maxCachedHosts) { 122 String hostToRemove = *m_hostsWithInMemoryStorage.random(); 123 clearForHost(hostToRemove); 124 } 120 while (m_hostsWithInMemoryStorage.size() >= maxCachedHosts) 121 clearForHost(*m_hostsWithInMemoryStorage.random()); 125 122 } 126 123
Note: See TracChangeset
for help on using the changeset viewer.