Title: [228999] releases/WebKitGTK/webkit-2.20
Revision
228999
Author
[email protected]
Date
2018-02-26 02:45:40 -0800 (Mon, 26 Feb 2018)

Log Message

Merge r228828 - Make WebResourceLoadStatisticsStore::processStatisticsAndDataRecords() call WebProcessProxy::notifyPageStatisticsAndDataRecordsProcessed() in a proper callback
https://bugs.webkit.org/show_bug.cgi?id=182719
<rdar://problem/37517370>

Reviewed by Brent Fulgham.

Source/WebKit:

This will allow the page notification, statistics pruning, and persistence write
to be done at the right time and hopefully stabilize the layout tests including:
http/tests/resourceLoadStatistics/partitioned-and-unpartitioned-cookie-deletion.html

* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::removeDataRecords):
    Now takes a callback parameter.
(WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords):
* UIProcess/WebResourceLoadStatisticsStore.h:
    Now calls WebProcessProxy::notifyPageStatisticsAndDataRecordsProcessed()
    in a callback provided to WebResourceLoadStatisticsStore::removeDataRecords().

LayoutTests:

* platform/mac-wk2/TestExpectations:
    Marked http/tests/resourceLoadStatistics/partitioned-and-unpartitioned-cookie-deletion.html
    as [ Pass ].
* platform/wk2/TestExpectations:
    Marked http/tests/resourceLoadStatistics/clear-in-memory-and-persistent-store.html
    as [ Pass ]. This should have been done already in r227223:
    https://bugs.webkit.org/show_bug.cgi?id=181822

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.20/LayoutTests/ChangeLog (228998 => 228999)


--- releases/WebKitGTK/webkit-2.20/LayoutTests/ChangeLog	2018-02-26 10:45:34 UTC (rev 228998)
+++ releases/WebKitGTK/webkit-2.20/LayoutTests/ChangeLog	2018-02-26 10:45:40 UTC (rev 228999)
@@ -1,3 +1,19 @@
+2018-02-20  John Wilander  <[email protected]>
+
+        Make WebResourceLoadStatisticsStore::processStatisticsAndDataRecords() call WebProcessProxy::notifyPageStatisticsAndDataRecordsProcessed() in a proper callback
+        https://bugs.webkit.org/show_bug.cgi?id=182719
+        <rdar://problem/37517370>
+
+        Reviewed by Brent Fulgham.
+
+        * platform/mac-wk2/TestExpectations:
+            Marked http/tests/resourceLoadStatistics/partitioned-and-unpartitioned-cookie-deletion.html
+            as [ Pass ].
+        * platform/wk2/TestExpectations:
+            Marked http/tests/resourceLoadStatistics/clear-in-memory-and-persistent-store.html
+            as [ Pass ]. This should have been done already in r227223:
+            https://bugs.webkit.org/show_bug.cgi?id=181822
+
 2018-02-19  Dean Jackson  <[email protected]>
 
         Handle all writing-modes in downcast

Modified: releases/WebKitGTK/webkit-2.20/LayoutTests/platform/wk2/TestExpectations (228998 => 228999)


--- releases/WebKitGTK/webkit-2.20/LayoutTests/platform/wk2/TestExpectations	2018-02-26 10:45:34 UTC (rev 228998)
+++ releases/WebKitGTK/webkit-2.20/LayoutTests/platform/wk2/TestExpectations	2018-02-26 10:45:40 UTC (rev 228999)
@@ -693,7 +693,7 @@
 http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-redirect-collusion.html [ Pass ]
 http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-redirect-collusion.html [ Pass ]
 http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-unique-redirects-to.html [ Pass ]
-webkit.org/b/181223 http/tests/resourceLoadStatistics/clear-in-memory-and-persistent-store.html [ Skip ]
+http/tests/resourceLoadStatistics/clear-in-memory-and-persistent-store.html [ Pass ]
 http/tests/resourceLoadStatistics/grandfathering.html [ Pass ]
 webkit.org/b/180703 http/tests/resourceLoadStatistics/telemetry-generation.html [ Pass Failure ]
 http/tests/resourceLoadStatistics/prune-statistics.html [ Pass ]

Modified: releases/WebKitGTK/webkit-2.20/Source/WebKit/ChangeLog (228998 => 228999)


--- releases/WebKitGTK/webkit-2.20/Source/WebKit/ChangeLog	2018-02-26 10:45:34 UTC (rev 228998)
+++ releases/WebKitGTK/webkit-2.20/Source/WebKit/ChangeLog	2018-02-26 10:45:40 UTC (rev 228999)
@@ -1,3 +1,23 @@
+2018-02-20  John Wilander  <[email protected]>
+
+        Make WebResourceLoadStatisticsStore::processStatisticsAndDataRecords() call WebProcessProxy::notifyPageStatisticsAndDataRecordsProcessed() in a proper callback
+        https://bugs.webkit.org/show_bug.cgi?id=182719
+        <rdar://problem/37517370>
+
+        Reviewed by Brent Fulgham.
+
+        This will allow the page notification, statistics pruning, and persistence write
+        to be done at the right time and hopefully stabilize the layout tests including:
+        http/tests/resourceLoadStatistics/partitioned-and-unpartitioned-cookie-deletion.html
+
+        * UIProcess/WebResourceLoadStatisticsStore.cpp:
+        (WebKit::WebResourceLoadStatisticsStore::removeDataRecords):
+            Now takes a callback parameter.
+        (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords):
+        * UIProcess/WebResourceLoadStatisticsStore.h:
+            Now calls WebProcessProxy::notifyPageStatisticsAndDataRecordsProcessed()
+            in a callback provided to WebResourceLoadStatisticsStore::removeDataRecords().
+
 2018-02-21  Carlos Garcia Campos  <[email protected]>
 
         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.19.91 release.

Modified: releases/WebKitGTK/webkit-2.20/Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.cpp (228998 => 228999)


--- releases/WebKitGTK/webkit-2.20/Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.cpp	2018-02-26 10:45:34 UTC (rev 228998)
+++ releases/WebKitGTK/webkit-2.20/Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.cpp	2018-02-26 10:45:40 UTC (rev 228999)
@@ -185,12 +185,14 @@
     m_persistentStorage.finishAllPendingWorkSynchronously();
 }
     
-void WebResourceLoadStatisticsStore::removeDataRecords()
+void WebResourceLoadStatisticsStore::removeDataRecords(CompletionHandler<void()>&& callback)
 {
     ASSERT(!RunLoop::isMain());
     
-    if (!shouldRemoveDataRecords())
+    if (!shouldRemoveDataRecords()) {
+        callback();
         return;
+    }
 
 #if ENABLE(NETSCAPE_PLUGIN_API)
     m_activePluginTokens.clear();
@@ -199,19 +201,22 @@
 #endif
 
     auto prevalentResourceDomains = topPrivatelyControlledDomainsToRemoveWebsiteDataFor();
-    if (prevalentResourceDomains.isEmpty())
+    if (prevalentResourceDomains.isEmpty()) {
+        callback();
         return;
-    
+    }
+
     setDataRecordsBeingRemoved(true);
 
-    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 = crossThreadCopy(domainsWithDeletedWebsiteData)] () mutable {
+    RunLoop::main().dispatch([prevalentResourceDomains = crossThreadCopy(prevalentResourceDomains), callback = WTFMove(callback), this, protectedThis = makeRef(*this)] () mutable {
+        WebProcessProxy::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores(WebResourceLoadStatisticsStore::monitoredDataTypes(), WTFMove(prevalentResourceDomains), m_parameters.shouldNotifyPagesWhenDataRecordsWereScanned, [callback = WTFMove(callback), this, protectedThis = WTFMove(protectedThis)](const HashSet<String>& domainsWithDeletedWebsiteData) mutable {
+            m_statisticsQueue->dispatch([topDomains = crossThreadCopy(domainsWithDeletedWebsiteData), callback = WTFMove(callback), this, protectedThis = WTFMove(protectedThis)] () mutable {
                 for (auto& prevalentResourceDomain : topDomains) {
                     auto& statistic = ensureResourceStatisticsForPrimaryDomain(prevalentResourceDomain);
                     ++statistic.dataRecordsRemoved;
                 }
                 setDataRecordsBeingRemoved(false);
+                callback();
             });
         });
     });
@@ -264,17 +269,26 @@
                 setPrevalentResource(resourceStatistic);
         }
     }
-    removeDataRecords();
+    
+    if (m_parameters.shouldNotifyPagesWhenDataRecordsWereScanned) {
+        removeDataRecords([this, protectedThis = makeRef(*this)] {
+            ASSERT(!RunLoop::isMain());
 
-    pruneStatisticsIfNeeded();
+            pruneStatisticsIfNeeded();
+            m_persistentStorage.scheduleOrWriteMemoryStore(ResourceLoadStatisticsPersistentStorage::ForceImmediateWrite::No);
 
-    if (m_parameters.shouldNotifyPagesWhenDataRecordsWereScanned) {
-        RunLoop::main().dispatch([] {
-            WebProcessProxy::notifyPageStatisticsAndDataRecordsProcessed();
+            RunLoop::main().dispatch([] {
+                WebProcessProxy::notifyPageStatisticsAndDataRecordsProcessed();
+            });
         });
+    } else {
+        removeDataRecords([this, protectedThis = makeRef(*this)] {
+            ASSERT(!RunLoop::isMain());
+
+            pruneStatisticsIfNeeded();
+            m_persistentStorage.scheduleOrWriteMemoryStore(ResourceLoadStatisticsPersistentStorage::ForceImmediateWrite::No);
+        });
     }
-
-    m_persistentStorage.scheduleOrWriteMemoryStore(ResourceLoadStatisticsPersistentStorage::ForceImmediateWrite::No);
 }
 
 void WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated(Vector<WebCore::ResourceLoadStatistics>&& origins)

Modified: releases/WebKitGTK/webkit-2.20/Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.h (228998 => 228999)


--- releases/WebKitGTK/webkit-2.20/Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.h	2018-02-26 10:45:34 UTC (rev 228998)
+++ releases/WebKitGTK/webkit-2.20/Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.h	2018-02-26 10:45:40 UTC (rev 228999)
@@ -150,7 +150,7 @@
 private:
     WebResourceLoadStatisticsStore(const String&, Function<void(const String&)>&& testingCallback, bool isEphemeral, UpdatePrevalentDomainsToPartitionOrBlockCookiesHandler&&, HasStorageAccessForFrameHandler&&, GrantStorageAccessForFrameHandler&&, RemovePrevalentDomainsHandler&&);
 
-    void removeDataRecords();
+    void removeDataRecords(CompletionHandler<void()>&&);
 
     // IPC::MessageReceiver
     void didReceiveMessage(IPC::Connection&, IPC::Decoder&) override;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to