https://bugs.webkit.org/show_bug.cgi?id=190055
<rdar://problem/
44843460>
Reviewed by Chris Dumez.
Source/WebCore:
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.
Source/WebKit:
* 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.
LayoutTests:
* 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.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236578
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2018-09-27 John Wilander <wilander@apple.com>
+
+ 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 <cdumez@apple.com>
Regression(r236512): fast/scrolling/scroll-animator-overlay-scrollbars-clicked.html and editing/pasteboard/emacs-ctrl-a-k-y.html are flaky
--- /dev/null
+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
+
--- /dev/null
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <script src="/js-test-resources/js-test.js"></script>
+ <script src="resources/util.js"></script>
+</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 = "http://localhost:8000/resourceLoadStatistics/do-not-capture-statistics-for-simple-top-navigations.html";
+ });
+ 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>
+2018-09-27 John Wilander <wilander@apple.com>
+
+ 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 <jer.noble@apple.com>
Unreviewed watchOS build fix; Fix declaration for ports which USE(ENCRYPTED_MEDIA) but don't
}
// Subframe stats
- decodeHashCountedSet(decoder, "subframeUnderTopFrameOrigins", subframeUnderTopFrameOrigins);
-
+ if (modelVersion >= 14)
+ decodeHashCountedSet(decoder, "subframeUnderTopFrameOrigins", subframeUnderTopFrameOrigins);
+
// Subresource stats
decodeHashCountedSet(decoder, "subresourceUnderTopFrameOrigins", subresourceUnderTopFrameOrigins);
decodeHashCountedSet(decoder, "subresourceUniqueRedirectsTo", subresourceUniqueRedirectsTo);
return false;
}
+ // Trigger re-classification based on model 14.
+ if (modelVersion < 14) {
+ isPrevalentResource = false;
+ isVeryPrevalentResource = false;
+ }
+
if (!decoder.decodeUInt32("dataRecordsRemoved", dataRecordsRemoved))
return false;
+2018-09-27 John Wilander <wilander@apple.com>
+
+ 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 <bfulgham@apple.com>
[iOS] Allow access to VoiceServices features needed for accessibility
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 };
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)