Title: [218115] tags/Safari-604.1.25/Source/WebKit2

Diff

Modified: tags/Safari-604.1.25/Source/WebKit2/ChangeLog (218114 => 218115)


--- tags/Safari-604.1.25/Source/WebKit2/ChangeLog	2017-06-12 18:45:38 UTC (rev 218114)
+++ tags/Safari-604.1.25/Source/WebKit2/ChangeLog	2017-06-12 18:49:02 UTC (rev 218115)
@@ -1,3 +1,20 @@
+2017-06-12  Matthew Hanson  <matthew_han...@apple.com>
+
+        Cherry-pick r217991. rdar://problem/32594952
+
+    2017-06-09  Chris Dumez  <cdu...@apple.com>
+
+            Make sure |this| is protected in lambda capture in WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData()
+            https://bugs.webkit.org/show_bug.cgi?id=173163
+
+            Reviewed by Brent Fulgham.
+
+            Make sure |this| is protected in lambda capture in WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData()
+            or it may end up getting destroyed before the lambda executing and crash when calling m_statisticsQueue->dispatch().
+
+            * UIProcess/WebResourceLoadStatisticsStore.cpp:
+            (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData):
+
 2017-06-09  Daewoong Jang  <daewoong.j...@navercorp.com>
 
         Use WTF::getCurrentProcessID() instead of getpid()

Modified: tags/Safari-604.1.25/Source/WebKit2/UIProcess/WebProcessProxy.cpp (218114 => 218115)


--- tags/Safari-604.1.25/Source/WebKit2/UIProcess/WebProcessProxy.cpp	2017-06-12 18:45:38 UTC (rev 218114)
+++ tags/Safari-604.1.25/Source/WebKit2/UIProcess/WebProcessProxy.cpp	2017-06-12 18:49:02 UTC (rev 218115)
@@ -265,10 +265,10 @@
     }
 }
 
-void WebProcessProxy::topPrivatelyControlledDomainsWithWebiteData(OptionSet<WebsiteDataType> dataTypes, bool shouldNotifyPage, std::function<void(HashSet<String>&&)> completionHandler)
+void WebProcessProxy::topPrivatelyControlledDomainsWithWebiteData(OptionSet<WebsiteDataType> dataTypes, bool shouldNotifyPage, Function<void(HashSet<String>&&)> completionHandler)
 {
     struct CallbackAggregator : ThreadSafeRefCounted<CallbackAggregator> {
-        explicit CallbackAggregator(std::function<void(HashSet<String>&&)> completionHandler)
+        explicit CallbackAggregator(Function<void(HashSet<String>&&)>&& completionHandler)
             : completionHandler(WTFMove(completionHandler))
         {
         }
@@ -298,7 +298,7 @@
         }
         
         unsigned pendingCallbacks = 0;
-        std::function<void(HashSet<String>&&)> completionHandler;
+        Function<void(HashSet<String>&&)> completionHandler;
         HashSet<String> domainsWithDeletedWebsiteData;
     };
     

Modified: tags/Safari-604.1.25/Source/WebKit2/UIProcess/WebProcessProxy.h (218114 => 218115)


--- tags/Safari-604.1.25/Source/WebKit2/UIProcess/WebProcessProxy.h	2017-06-12 18:45:38 UTC (rev 218114)
+++ tags/Safari-604.1.25/Source/WebKit2/UIProcess/WebProcessProxy.h	2017-06-12 18:49:02 UTC (rev 218115)
@@ -142,7 +142,7 @@
     void deleteWebsiteData(WebCore::SessionID, OptionSet<WebsiteDataType>, std::chrono::system_clock::time_point modifiedSince, Function<void()> completionHandler);
     void deleteWebsiteDataForOrigins(WebCore::SessionID, OptionSet<WebsiteDataType>, const Vector<WebCore::SecurityOriginData>&, Function<void()> completionHandler);
     static void deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores(OptionSet<WebsiteDataType>, Vector<String>&& topPrivatelyControlledDomains, bool shouldNotifyPages, std::function<void(Vector<String>)> completionHandler);
-    static void topPrivatelyControlledDomainsWithWebiteData(OptionSet<WebsiteDataType> dataTypes, bool shouldNotifyPage, std::function<void(HashSet<String>&&)> completionHandler);
+    static void topPrivatelyControlledDomainsWithWebiteData(OptionSet<WebsiteDataType> dataTypes, bool shouldNotifyPage, Function<void(HashSet<String>&&)> completionHandler);
     static void notifyPageStatisticsAndDataRecordsProcessed();
 
     void enableSuddenTermination();

Modified: tags/Safari-604.1.25/Source/WebKit2/UIProcess/WebResourceLoadStatisticsStore.cpp (218114 => 218115)


--- tags/Safari-604.1.25/Source/WebKit2/UIProcess/WebResourceLoadStatisticsStore.cpp	2017-06-12 18:45:38 UTC (rev 218114)
+++ tags/Safari-604.1.25/Source/WebKit2/UIProcess/WebResourceLoadStatisticsStore.cpp	2017-06-12 18:49:02 UTC (rev 218115)
@@ -215,7 +215,7 @@
     
     // Switch to the main thread to get the default website data store
     RunLoop::main().dispatch([this, protectedThis = makeRef(*this)] () mutable {
-        WebProcessProxy::topPrivatelyControlledDomainsWithWebiteData(dataTypesToRemove, notifyPages, [this](HashSet<String>&& topPrivatelyControlledDomainsWithWebsiteData) mutable {
+        WebProcessProxy::topPrivatelyControlledDomainsWithWebiteData(dataTypesToRemove, notifyPages, [this, protectedThis = makeRef(*this)] (HashSet<String>&& topPrivatelyControlledDomainsWithWebsiteData) mutable {
             // But always touch the ResourceLoadStatistics store on the worker queue
             m_statisticsQueue->dispatch([this, protectedThis = makeRef(*this), topDomains = CrossThreadCopier<HashSet<String>>::copy(topPrivatelyControlledDomainsWithWebsiteData)] () mutable {
                 this->coreStore().handleFreshStartWithEmptyOrNoStore(WTFMove(topDomains));
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to