Use protectedThis for the 'updatePrevalentDomainsToPartitionOrBlockCookies' lambda
authorbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 11 Jan 2018 00:06:55 +0000 (00:06 +0000)
committerbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 11 Jan 2018 00:06:55 +0000 (00:06 +0000)
https://bugs.webkit.org/show_bug.cgi?id=181452
<rdar://problem/36416912>

Reviewed by Chris Dumez.

We forgot to use a 'protectedThis' back in r225006 for one of the lambdas used by
the WebsiteDataStore for processing.

* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@226742 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit/ChangeLog
Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp

index 0ffe3f1..db33578 100644 (file)
@@ -1,3 +1,17 @@
+2018-01-10  Brent Fulgham  <bfulgham@apple.com>
+
+        Use protectedThis for the 'updatePrevalentDomainsToPartitionOrBlockCookies' lambda
+        https://bugs.webkit.org/show_bug.cgi?id=181452
+        <rdar://problem/36416912>
+        
+        Reviewed by Chris Dumez.
+
+        We forgot to use a 'protectedThis' back in r225006 for one of the lambdas used by
+        the WebsiteDataStore for processing.
+
+        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
+        (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
+
 2018-01-09  John Wilander  <wilander@apple.com>
 
         Storage Access API: Turn feature on by default in WebPreferences.yaml
index 4d95f6c..2b50367 100644 (file)
@@ -1401,7 +1401,7 @@ void WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback(Functio
     }
 
 #if HAVE(CFNETWORK_STORAGE_PARTITIONING)
-    m_resourceLoadStatistics = WebResourceLoadStatisticsStore::create(m_configuration.resourceLoadStatisticsDirectory, WTFMove(callback), [this] (const Vector<String>& domainsToPartition, const Vector<String>& domainsToBlock, const Vector<String>& domainsToNeitherPartitionNorBlock, ShouldClearFirst shouldClearFirst) {
+    m_resourceLoadStatistics = WebResourceLoadStatisticsStore::create(m_configuration.resourceLoadStatisticsDirectory, WTFMove(callback), [this, protectedThis = makeRef(*this)] (const Vector<String>& domainsToPartition, const Vector<String>& domainsToBlock, const Vector<String>& domainsToNeitherPartitionNorBlock, ShouldClearFirst shouldClearFirst) {
         updatePrevalentDomainsToPartitionOrBlockCookies(domainsToPartition, domainsToBlock, domainsToNeitherPartitionNorBlock, shouldClearFirst);
     }, [this, protectedThis = makeRef(*this)] (const String& resourceDomain, const String& firstPartyDomain, uint64_t frameID, uint64_t pageID, WTF::CompletionHandler<void(bool hasAccess)>&& callback) {
         hasStorageAccessForFrameHandler(resourceDomain, firstPartyDomain, frameID, pageID, WTFMove(callback));