Changeset 218116 in webkit
- Timestamp:
- Jun 12, 2017, 11:49:06 AM (8 years ago)
- Location:
- tags/Safari-604.1.25/Source/WebKit2
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
tags/Safari-604.1.25/Source/WebKit2/ChangeLog
r218115 r218116 1 2017-06-12 Matthew Hanson <matthew_hanson@apple.com> 2 3 Cherry-pick r218002. rdar://problem/32679311 4 5 2017-06-09 Chris Dumez <cdumez@apple.com> 6 7 Avoid some ref counting churn in WebResourceLoadStatisticsStore 8 https://bugs.webkit.org/show_bug.cgi?id=173168 9 10 Reviewed by Brent Fulgham. 11 12 Move the protectedThis around instead of ref'ing it every time we capture it 13 in a lambda. Also add a missing protectedThis in WebResourceLoadStatisticsStore::removeDataRecords() 14 which likely fixes crashes. 15 16 * UIProcess/WebResourceLoadStatisticsStore.cpp: 17 (WebKit::WebResourceLoadStatisticsStore::removeDataRecords): 18 (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData): 19 1 20 2017-06-12 Matthew Hanson <matthew_hanson@apple.com> 2 21 -
tags/Safari-604.1.25/Source/WebKit2/UIProcess/WebProcessProxy.cpp
r218115 r218116 210 210 } 211 211 212 void WebProcessProxy::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores(OptionSet<WebsiteDataType> dataTypes, Vector<String>&& topPrivatelyControlledDomains, bool shouldNotifyPage, std::function<void(Vector<String>)>completionHandler)212 void WebProcessProxy::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores(OptionSet<WebsiteDataType> dataTypes, Vector<String>&& topPrivatelyControlledDomains, bool shouldNotifyPage, Function<void(Vector<String>)>&& completionHandler) 213 213 { 214 214 struct CallbackAggregator : ThreadSafeRefCounted<CallbackAggregator> { 215 explicit CallbackAggregator( std::function<void(Vector<String>)>completionHandler)215 explicit CallbackAggregator(Function<void(Vector<String>)>&& completionHandler) 216 216 : completionHandler(WTFMove(completionHandler)) 217 217 { … … 242 242 243 243 unsigned pendingCallbacks = 0; 244 std::function<void(Vector<String>)> completionHandler;244 Function<void(Vector<String>)> completionHandler; 245 245 Vector<String> domainsWithDeletedWebsiteData; 246 246 }; -
tags/Safari-604.1.25/Source/WebKit2/UIProcess/WebProcessProxy.h
r218115 r218116 142 142 void deleteWebsiteData(WebCore::SessionID, OptionSet<WebsiteDataType>, std::chrono::system_clock::time_point modifiedSince, Function<void()> completionHandler); 143 143 void deleteWebsiteDataForOrigins(WebCore::SessionID, OptionSet<WebsiteDataType>, const Vector<WebCore::SecurityOriginData>&, Function<void()> completionHandler); 144 static void deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores(OptionSet<WebsiteDataType>, Vector<String>&& topPrivatelyControlledDomains, bool shouldNotifyPages, std::function<void(Vector<String>)>completionHandler);144 static void deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores(OptionSet<WebsiteDataType>, Vector<String>&& topPrivatelyControlledDomains, bool shouldNotifyPages, Function<void(Vector<String>)>&& completionHandler); 145 145 static void topPrivatelyControlledDomainsWithWebiteData(OptionSet<WebsiteDataType> dataTypes, bool shouldNotifyPage, Function<void(HashSet<String>&&)> completionHandler); 146 146 static void notifyPageStatisticsAndDataRecordsProcessed(); -
tags/Safari-604.1.25/Source/WebKit2/UIProcess/WebResourceLoadStatisticsStore.cpp
r218115 r218116 120 120 // Switch to the main thread to get the default website data store 121 121 RunLoop::main().dispatch([prevalentResourceDomains = CrossThreadCopier<Vector<String>>::copy(prevalentResourceDomains), this, protectedThis = makeRef(*this)] () mutable { 122 WebProcessProxy::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores(dataTypesToRemove, WTFMove(prevalentResourceDomains), notifyPages, [this ](Vector<String> domainsWithDeletedWebsiteData) mutable {122 WebProcessProxy::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores(dataTypesToRemove, WTFMove(prevalentResourceDomains), notifyPages, [this, protectedThis = WTFMove(protectedThis)](Vector<String> domainsWithDeletedWebsiteData) mutable { 123 123 // But always touch the ResourceLoadStatistics store on the worker queue. 124 m_statisticsQueue->dispatch([ this, protectedThis = makeRef(*this), topDomains = CrossThreadCopier<Vector<String>>::copy(domainsWithDeletedWebsiteData)] () mutable {125 this->coreStore().updateStatisticsForRemovedDataRecords(topDomains);126 this->coreStore().dataRecordsWereRemoved();124 m_statisticsQueue->dispatch([protectedThis = WTFMove(protectedThis), topDomains = CrossThreadCopier<Vector<String>>::copy(domainsWithDeletedWebsiteData)] () mutable { 125 protectedThis->coreStore().updateStatisticsForRemovedDataRecords(topDomains); 126 protectedThis->coreStore().dataRecordsWereRemoved(); 127 127 }); 128 128 }); … … 216 216 // Switch to the main thread to get the default website data store 217 217 RunLoop::main().dispatch([this, protectedThis = makeRef(*this)] () mutable { 218 WebProcessProxy::topPrivatelyControlledDomainsWithWebiteData(dataTypesToRemove, notifyPages, [this, protectedThis = makeRef(*this)] (HashSet<String>&& topPrivatelyControlledDomainsWithWebsiteData) mutable {218 WebProcessProxy::topPrivatelyControlledDomainsWithWebiteData(dataTypesToRemove, notifyPages, [this, protectedThis = WTFMove(protectedThis)] (HashSet<String>&& topPrivatelyControlledDomainsWithWebsiteData) mutable { 219 219 // But always touch the ResourceLoadStatistics store on the worker queue 220 m_statisticsQueue->dispatch([ this, protectedThis = makeRef(*this), topDomains = CrossThreadCopier<HashSet<String>>::copy(topPrivatelyControlledDomainsWithWebsiteData)] () mutable {221 this->coreStore().handleFreshStartWithEmptyOrNoStore(WTFMove(topDomains));220 m_statisticsQueue->dispatch([protectedThis = WTFMove(protectedThis), topDomains = CrossThreadCopier<HashSet<String>>::copy(topPrivatelyControlledDomainsWithWebsiteData)] () mutable { 221 protectedThis->coreStore().handleFreshStartWithEmptyOrNoStore(WTFMove(topDomains)); 222 222 }); 223 223 });
Note:
See TracChangeset
for help on using the changeset viewer.