Diff
Modified: trunk/LayoutTests/ChangeLog (236577 => 236578)
--- trunk/LayoutTests/ChangeLog 2018-09-27 22:37:01 UTC (rev 236577)
+++ trunk/LayoutTests/ChangeLog 2018-09-28 00:23:37 UTC (rev 236578)
@@ -1,3 +1,14 @@
+2018-09-27 John Wilander <[email protected]>
+
+ Resource Load Statistics: Non-redirected top frame navigation should not get captured in statistics
+ https://bugs.webkit.org/show_bug.cgi?id=190055
+ <rdar://problem/44843460>
+
+ Reviewed by Chris Dumez.
+
+ * http/tests/resourceLoadStatistics/do-not-capture-statistics-for-simple-top-navigations-expected.txt: Added.
+ * http/tests/resourceLoadStatistics/do-not-capture-statistics-for-simple-top-navigations.html: Added.
+
2018-09-27 Chris Dumez <[email protected]>
Regression(r236512): fast/scrolling/scroll-animator-overlay-scrollbars-clicked.html and editing/pasteboard/emacs-ctrl-a-k-y.html are flaky
Added: trunk/LayoutTests/http/tests/resourceLoadStatistics/do-not-capture-statistics-for-simple-top-navigations-expected.txt (0 => 236578)
--- trunk/LayoutTests/http/tests/resourceLoadStatistics/do-not-capture-statistics-for-simple-top-navigations-expected.txt (rev 0)
+++ trunk/LayoutTests/http/tests/resourceLoadStatistics/do-not-capture-statistics-for-simple-top-navigations-expected.txt 2018-09-28 00:23:37 UTC (rev 236578)
@@ -0,0 +1,11 @@
+Test that a non-redirected top frame navigation doesn't get captured in statistics.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS testRunner.isStatisticsRegisteredAsSubFrameUnder("http://localhost", "http://127.0.0.1") is false
+PASS testRunner.isStatisticsRegisteredAsSubFrameUnder("http://127.0.0.1", "http://localhost") is false
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/http/tests/resourceLoadStatistics/do-not-capture-statistics-for-simple-top-navigations.html (0 => 236578)
--- trunk/LayoutTests/http/tests/resourceLoadStatistics/do-not-capture-statistics-for-simple-top-navigations.html (rev 0)
+++ trunk/LayoutTests/http/tests/resourceLoadStatistics/do-not-capture-statistics-for-simple-top-navigations.html 2018-09-28 00:23:37 UTC (rev 236578)
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <script src=""
+ <script src=""
+</head>
+<body>
+<script>
+ description("Test that a non-redirected top frame navigation doesn't get captured in statistics.");
+ jsTestIsAsync = true;
+
+ function finishTest() {
+ shouldBeFalse('testRunner.isStatisticsRegisteredAsSubFrameUnder("http://localhost", "http://127.0.0.1")');
+ shouldBeFalse('testRunner.isStatisticsRegisteredAsSubFrameUnder("http://127.0.0.1", "http://localhost")');
+ setEnableFeature(false, finishJSTest);
+ }
+
+ function runTest() {
+ switch (document.location.host) {
+ case "127.0.0.1:8000":
+ setEnableFeature(true, function() {
+ if (testRunner.isStatisticsPrevalentResource("http://localhost:8000"))
+ testFailed("Localhost was classified as prevalent resource before the test starts.");
+ document.location.href = ""
+ });
+ break;
+ case "localhost:8000":
+ testRunner.setStatisticsNotifyPagesWhenDataRecordsWereScanned(true);
+ testRunner.installStatisticsDidScanDataRecordsCallback(finishTest);
+ testRunner.statisticsNotifyObserver();
+ break;
+ default:
+ testFailed("Unknown host: " + document.location.host);
+ finishTest();
+ }
+ }
+
+ if (window.testRunner && window.internals)
+ runTest();
+</script>
+</body>
+</html>
Modified: trunk/Source/WebCore/ChangeLog (236577 => 236578)
--- trunk/Source/WebCore/ChangeLog 2018-09-27 22:37:01 UTC (rev 236577)
+++ trunk/Source/WebCore/ChangeLog 2018-09-28 00:23:37 UTC (rev 236578)
@@ -1,3 +1,17 @@
+2018-09-27 John Wilander <[email protected]>
+
+ Resource Load Statistics: Non-redirected top frame navigation should not get captured in statistics
+ https://bugs.webkit.org/show_bug.cgi?id=190055
+ <rdar://problem/44843460>
+
+ Reviewed by Chris Dumez.
+
+ Test: http/tests/resourceLoadStatistics/do-not-capture-statistics-for-simple-top-navigations.html
+
+ * loader/ResourceLoadStatistics.cpp:
+ (WebCore::ResourceLoadStatistics::decode):
+ Corrects legacy statistics for frames and triggers a re-classification.
+
2018-09-27 Jer Noble <[email protected]>
Unreviewed watchOS build fix; Fix declaration for ports which USE(ENCRYPTED_MEDIA) but don't
Modified: trunk/Source/WebCore/loader/ResourceLoadStatistics.cpp (236577 => 236578)
--- trunk/Source/WebCore/loader/ResourceLoadStatistics.cpp 2018-09-27 22:37:01 UTC (rev 236577)
+++ trunk/Source/WebCore/loader/ResourceLoadStatistics.cpp 2018-09-28 00:23:37 UTC (rev 236578)
@@ -213,8 +213,9 @@
}
// Subframe stats
- decodeHashCountedSet(decoder, "subframeUnderTopFrameOrigins", subframeUnderTopFrameOrigins);
-
+ if (modelVersion >= 14)
+ decodeHashCountedSet(decoder, "subframeUnderTopFrameOrigins", subframeUnderTopFrameOrigins);
+
// Subresource stats
decodeHashCountedSet(decoder, "subresourceUnderTopFrameOrigins", subresourceUnderTopFrameOrigins);
decodeHashCountedSet(decoder, "subresourceUniqueRedirectsTo", subresourceUniqueRedirectsTo);
@@ -230,6 +231,12 @@
return false;
}
+ // Trigger re-classification based on model 14.
+ if (modelVersion < 14) {
+ isPrevalentResource = false;
+ isVeryPrevalentResource = false;
+ }
+
if (!decoder.decodeUInt32("dataRecordsRemoved", dataRecordsRemoved))
return false;
Modified: trunk/Source/WebKit/ChangeLog (236577 => 236578)
--- trunk/Source/WebKit/ChangeLog 2018-09-27 22:37:01 UTC (rev 236577)
+++ trunk/Source/WebKit/ChangeLog 2018-09-28 00:23:37 UTC (rev 236578)
@@ -1,3 +1,17 @@
+2018-09-27 John Wilander <[email protected]>
+
+ Resource Load Statistics: Non-redirected top frame navigation should not get captured in statistics
+ https://bugs.webkit.org/show_bug.cgi?id=190055
+ <rdar://problem/44843460>
+
+ Reviewed by Chris Dumez.
+
+ * UIProcess/ResourceLoadStatisticsMemoryStore.cpp:
+ Bumped the statisticsModelVersion to 14 to be able to
+ correct legacy statistics.
+ (WebKit::ResourceLoadStatisticsMemoryStore::logFrameNavigation):
+ Now skips capture if it's the main frame.
+
2018-09-27 Brent Fulgham <[email protected]>
[iOS] Allow access to VoiceServices features needed for accessibility
Modified: trunk/Source/WebKit/UIProcess/ResourceLoadStatisticsMemoryStore.cpp (236577 => 236578)
--- trunk/Source/WebKit/UIProcess/ResourceLoadStatisticsMemoryStore.cpp 2018-09-27 22:37:01 UTC (rev 236577)
+++ trunk/Source/WebKit/UIProcess/ResourceLoadStatisticsMemoryStore.cpp 2018-09-28 00:23:37 UTC (rev 236578)
@@ -46,7 +46,7 @@
namespace WebKit {
using namespace WebCore;
-constexpr unsigned statisticsModelVersion { 13 };
+constexpr unsigned statisticsModelVersion { 14 };
constexpr unsigned maxNumberOfRecursiveCallsInRedirectTraceBack { 50 };
constexpr Seconds minimumStatisticsProcessingInterval { 5_s };
constexpr unsigned operatingDatesWindow { 30 };
@@ -596,7 +596,7 @@
bool areTargetAndSourceDomainsAssociated = targetPrimaryDomain == sourcePrimaryDomain;
bool statisticsWereUpdated = false;
- if (targetHost != mainFrameHost && !(areTargetAndMainFrameDomainsAssociated || areTargetAndSourceDomainsAssociated)) {
+ if (!isMainFrame && targetHost != mainFrameHost && !(areTargetAndMainFrameDomainsAssociated || areTargetAndSourceDomainsAssociated)) {
auto& targetStatistics = ensureResourceStatisticsForPrimaryDomain(targetPrimaryDomain);
targetStatistics.lastSeen = ResourceLoadStatistics::reduceTimeResolution(WallTime::now());
if (targetStatistics.subframeUnderTopFrameOrigins.add(mainFramePrimaryDomain).isNewEntry)