Title: [221431] trunk/Source
Revision
221431
Author
cdu...@apple.com
Date
2017-08-31 11:52:11 -0700 (Thu, 31 Aug 2017)

Log Message

Use WTF::crossThreadCopy() in more places
https://bugs.webkit.org/show_bug.cgi?id=176169

Reviewed by Andreas Kling.

Use WTF::crossThreadCopy() in more places to make code more concise.

Source/WebCore:

* Modules/indexeddb/IDBValue.cpp:
(WebCore::IDBValue::setAsIsolatedCopy):

Source/WebKit:

* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::removeDataRecords):
(WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData):
(WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdateForDomains):
(WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioning):
(WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains):
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (221430 => 221431)


--- trunk/Source/WebCore/ChangeLog	2017-08-31 18:48:45 UTC (rev 221430)
+++ trunk/Source/WebCore/ChangeLog	2017-08-31 18:52:11 UTC (rev 221431)
@@ -1,3 +1,15 @@
+2017-08-31  Chris Dumez  <cdu...@apple.com>
+
+        Use WTF::crossThreadCopy() in more places
+        https://bugs.webkit.org/show_bug.cgi?id=176169
+
+        Reviewed by Andreas Kling.
+
+        Use WTF::crossThreadCopy() in more places to make code more concise.
+
+        * Modules/indexeddb/IDBValue.cpp:
+        (WebCore::IDBValue::setAsIsolatedCopy):
+
 2017-08-31  Jer Noble  <jer.no...@apple.com>
 
         MSE-to-Canvas painting can become "stuck" during heavy workloads

Modified: trunk/Source/WebCore/Modules/indexeddb/IDBValue.cpp (221430 => 221431)


--- trunk/Source/WebCore/Modules/indexeddb/IDBValue.cpp	2017-08-31 18:48:45 UTC (rev 221430)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBValue.cpp	2017-08-31 18:52:11 UTC (rev 221431)
@@ -75,8 +75,8 @@
     ASSERT(m_blobURLs.isEmpty() && m_blobFilePaths.isEmpty());
 
     m_data = other.m_data;
-    m_blobURLs = CrossThreadCopier<Vector<String>>::copy(other.m_blobURLs);
-    m_blobFilePaths = CrossThreadCopier<Vector<String>>::copy(other.m_blobFilePaths);
+    m_blobURLs = crossThreadCopy(other.m_blobURLs);
+    m_blobFilePaths = crossThreadCopy(other.m_blobFilePaths);
 }
 
 IDBValue IDBValue::isolatedCopy() const

Modified: trunk/Source/WebKit/ChangeLog (221430 => 221431)


--- trunk/Source/WebKit/ChangeLog	2017-08-31 18:48:45 UTC (rev 221430)
+++ trunk/Source/WebKit/ChangeLog	2017-08-31 18:52:11 UTC (rev 221431)
@@ -1,3 +1,21 @@
+2017-08-31  Chris Dumez  <cdu...@apple.com>
+
+        Use WTF::crossThreadCopy() in more places
+        https://bugs.webkit.org/show_bug.cgi?id=176169
+
+        Reviewed by Andreas Kling.
+
+        Use WTF::crossThreadCopy() in more places to make code more concise.
+
+        * UIProcess/WebResourceLoadStatisticsStore.cpp:
+        (WebKit::WebResourceLoadStatisticsStore::removeDataRecords):
+        (WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData):
+        (WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdateForDomains):
+        (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioning):
+        (WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains):
+        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
+        (WebKit::WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains):
+
 2017-08-31  Youenn Fablet  <you...@apple.com>
 
         Take into account removed caches in Caches::remove assertion

Modified: trunk/Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.cpp (221430 => 221431)


--- trunk/Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.cpp	2017-08-31 18:48:45 UTC (rev 221430)
+++ trunk/Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.cpp	2017-08-31 18:52:11 UTC (rev 221431)
@@ -188,9 +188,9 @@
     
     setDataRecordsBeingRemoved(true);
 
-    RunLoop::main().dispatch([prevalentResourceDomains = CrossThreadCopier<Vector<String>>::copy(prevalentResourceDomains), this, protectedThis = makeRef(*this)] () mutable {
+    RunLoop::main().dispatch([prevalentResourceDomains = crossThreadCopy(prevalentResourceDomains), this, protectedThis = makeRef(*this)] () mutable {
         WebProcessProxy::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores(WebResourceLoadStatisticsStore::monitoredDataTypes(), WTFMove(prevalentResourceDomains), m_parameters.shouldNotifyPagesWhenDataRecordsWereScanned, [this, protectedThis = WTFMove(protectedThis)](const HashSet<String>& domainsWithDeletedWebsiteData) mutable {
-            m_statisticsQueue->dispatch([this, protectedThis = WTFMove(protectedThis), topDomains = CrossThreadCopier<HashSet<String>>::copy(domainsWithDeletedWebsiteData)] () mutable {
+            m_statisticsQueue->dispatch([this, protectedThis = WTFMove(protectedThis), topDomains = crossThreadCopy(domainsWithDeletedWebsiteData)] () mutable {
                 for (auto& prevalentResourceDomain : topDomains) {
                     auto& statistic = ensureResourceStatisticsForPrimaryDomain(prevalentResourceDomain);
                     ++statistic.dataRecordsRemoved;
@@ -250,7 +250,7 @@
         // FIXME: This method being a static call on WebProcessProxy is wrong.
         // It should be on the data store that this object belongs to.
         WebProcessProxy::topPrivatelyControlledDomainsWithWebsiteData(WebResourceLoadStatisticsStore::monitoredDataTypes(), m_parameters.shouldNotifyPagesWhenDataRecordsWereScanned, [this, protectedThis = WTFMove(protectedThis)] (HashSet<String>&& topPrivatelyControlledDomainsWithWebsiteData) mutable {
-            m_statisticsQueue->dispatch([this, protectedThis = WTFMove(protectedThis), topDomains = CrossThreadCopier<HashSet<String>>::copy(topPrivatelyControlledDomainsWithWebsiteData)] () mutable {
+            m_statisticsQueue->dispatch([this, protectedThis = WTFMove(protectedThis), topDomains = crossThreadCopy(topPrivatelyControlledDomainsWithWebsiteData)] () mutable {
                 for (auto& topPrivatelyControlledDomain : topDomains) {
                     auto& statistic = ensureResourceStatisticsForPrimaryDomain(topPrivatelyControlledDomain);
                     statistic.grandfathered = true;
@@ -463,7 +463,7 @@
 {
     // Helper function used by testing system. Should only be called from the main thread.
     ASSERT(RunLoop::isMain());
-    m_statisticsQueue->dispatch([this, protectedThis = makeRef(*this), domainsToRemove = CrossThreadCopier<Vector<String>>::copy(domainsToRemove), domainsToAdd = CrossThreadCopier<Vector<String>>::copy(domainsToAdd), shouldClearFirst] {
+    m_statisticsQueue->dispatch([this, protectedThis = makeRef(*this), domainsToRemove = crossThreadCopy(domainsToRemove), domainsToAdd = crossThreadCopy(domainsToAdd), shouldClearFirst] {
         updateCookiePartitioningForDomains(domainsToRemove, domainsToAdd, shouldClearFirst);
     });
 }
@@ -661,7 +661,7 @@
     if (domainsToRemove.isEmpty() && domainsToAdd.isEmpty())
         return;
 
-    RunLoop::main().dispatch([this, protectedThis = makeRef(*this), domainsToRemove = CrossThreadCopier<Vector<String>>::copy(domainsToRemove), domainsToAdd = CrossThreadCopier<Vector<String>>::copy(domainsToAdd)] () {
+    RunLoop::main().dispatch([this, protectedThis = makeRef(*this), domainsToRemove = crossThreadCopy(domainsToRemove), domainsToAdd = crossThreadCopy(domainsToAdd)] () {
         m_updateCookiePartitioningForDomainsHandler(domainsToRemove, domainsToAdd, ShouldClearFirst::No);
     });
 }
@@ -672,7 +672,7 @@
     if (domainsToRemove.isEmpty() && domainsToAdd.isEmpty())
         return;
 
-    RunLoop::main().dispatch([this, shouldClearFirst, protectedThis = makeRef(*this), domainsToRemove = CrossThreadCopier<Vector<String>>::copy(domainsToRemove), domainsToAdd = CrossThreadCopier<Vector<String>>::copy(domainsToAdd)] () {
+    RunLoop::main().dispatch([this, shouldClearFirst, protectedThis = makeRef(*this), domainsToRemove = crossThreadCopy(domainsToRemove), domainsToAdd = crossThreadCopy(domainsToAdd)] () {
         m_updateCookiePartitioningForDomainsHandler(domainsToRemove, domainsToAdd, shouldClearFirst);
     });
 

Modified: trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp (221430 => 221431)


--- trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp	2017-08-31 18:48:45 UTC (rev 221430)
+++ trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp	2017-08-31 18:52:11 UTC (rev 221431)
@@ -511,7 +511,7 @@
 
 void WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains(OptionSet<WebsiteDataType> dataTypes, OptionSet<WebsiteDataFetchOption> fetchOptions, const Vector<String>& topPrivatelyControlledDomains, Function<void(Vector<WebsiteDataRecord>&&, HashSet<String>&&)>&& completionHandler)
 {
-    fetchDataAndApply(dataTypes, fetchOptions, m_queue.copyRef(), [topPrivatelyControlledDomains = CrossThreadCopier<Vector<String>>::copy(topPrivatelyControlledDomains), completionHandler = WTFMove(completionHandler)] (auto&& existingDataRecords) mutable {
+    fetchDataAndApply(dataTypes, fetchOptions, m_queue.copyRef(), [topPrivatelyControlledDomains = crossThreadCopy(topPrivatelyControlledDomains), completionHandler = WTFMove(completionHandler)] (auto&& existingDataRecords) mutable {
         ASSERT(!RunLoop::isMain());
 
         Vector<WebsiteDataRecord> matchingDataRecords;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to