- Revision
- 228828
- Author
- [email protected]
- Date
- 2018-02-20 11:27:26 -0800 (Tue, 20 Feb 2018)
Log Message
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: trunk/LayoutTests/ChangeLog (228827 => 228828)
--- trunk/LayoutTests/ChangeLog 2018-02-20 19:02:25 UTC (rev 228827)
+++ trunk/LayoutTests/ChangeLog 2018-02-20 19:27:26 UTC (rev 228828)
@@ -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-20 Nan Wang <[email protected]>
AX: AOM: Dispatch accessibleclick event
Modified: trunk/LayoutTests/platform/mac-wk2/TestExpectations (228827 => 228828)
--- trunk/LayoutTests/platform/mac-wk2/TestExpectations 2018-02-20 19:02:25 UTC (rev 228827)
+++ trunk/LayoutTests/platform/mac-wk2/TestExpectations 2018-02-20 19:27:26 UTC (rev 228828)
@@ -803,7 +803,7 @@
[ HighSierra+ ] http/tests/resourceLoadStatistics/partitioned-cookies-with-and-without-user-interaction.html [ Pass ]
[ HighSierra+ ] http/tests/resourceLoadStatistics/partitioned-and-unpartitioned-cookie-with-partitioning-timeout.html [ Pass ]
[ HighSierra+ ] http/tests/resourceLoadStatistics/third-party-cookie-with-and-without-user-interaction.html [ Pass ]
-[ HighSierra+ ] http/tests/resourceLoadStatistics/partitioned-and-unpartitioned-cookie-deletion.html [ Pass Failure ]
+[ HighSierra+ ] http/tests/resourceLoadStatistics/partitioned-and-unpartitioned-cookie-deletion.html [ Pass ]
[ HighSierra+ ] http/tests/resourceLoadStatistics/non-prevalent-resources-can-access-cookies-in-a-third-party-context.html [ Pass ]
[ HighSierra+ ] http/tests/resourceLoadStatistics/add-partitioning-to-redirect.html [ Pass ]
[ HighSierra+ ] http/tests/resourceLoadStatistics/add-blocking-to-redirect.html [ Pass ]
Modified: trunk/LayoutTests/platform/wk2/TestExpectations (228827 => 228828)
--- trunk/LayoutTests/platform/wk2/TestExpectations 2018-02-20 19:02:25 UTC (rev 228827)
+++ trunk/LayoutTests/platform/wk2/TestExpectations 2018-02-20 19:27:26 UTC (rev 228828)
@@ -692,7 +692,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: trunk/Source/WebKit/ChangeLog (228827 => 228828)
--- trunk/Source/WebKit/ChangeLog 2018-02-20 19:02:25 UTC (rev 228827)
+++ trunk/Source/WebKit/ChangeLog 2018-02-20 19:27:26 UTC (rev 228828)
@@ -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-20 Zan Dobersek <[email protected]>
[Cairo] Drop target GraphicsContext usage in Cairo operations
Modified: trunk/Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.cpp (228827 => 228828)
--- trunk/Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.cpp 2018-02-20 19:02:25 UTC (rev 228827)
+++ trunk/Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.cpp 2018-02-20 19:27:26 UTC (rev 228828)
@@ -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: trunk/Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.h (228827 => 228828)
--- trunk/Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.h 2018-02-20 19:02:25 UTC (rev 228827)
+++ trunk/Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.h 2018-02-20 19:27:26 UTC (rev 228828)
@@ -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;