Fix Resource Timing buffer edge cases for WPT
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 28 Feb 2019 19:09:32 +0000 (19:09 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 28 Feb 2019 19:09:32 +0000 (19:09 +0000)
commitc514a8c9aa47ec87ebadc13614008eb119b4ebe7
treed3e56e2e3e761461029b54b18b362114787deab9
parentd19c3ffb67a88a09f6cc9eb0754a35b78b9e48e8
Fix Resource Timing buffer edge cases for WPT
https://bugs.webkit.org/show_bug.cgi?id=193213

Patch by Charles Vazac <cvazac@akamai.com> on 2019-02-28
Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

* web-platform-tests/resource-timing/buffer-full-add-after-full-event.html:
* web-platform-tests/resource-timing/buffer-full-add-entries-during-callback-that-drop-expected.txt:
* web-platform-tests/resource-timing/buffer-full-add-then-clear-expected.txt:
* web-platform-tests/resource-timing/buffer-full-then-increased-expected.txt:

Source/WebCore:

Test coverage by LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer*.html

* page/Performance.cpp:
(WebCore::Performance::resourceTimingBufferFullTimerFired): Only dispatch the
resourcetimingbufferfull event if the buffer is still full (as it may have been cleared or
expanded). Also, avoid infinite loops if we aren't able to decrease the number of entries in
the secondary buffer.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@242209 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/http/tests/performance/performance-resource-timing-resourcetimingbufferfull-shrinking-buffer-crash-expected.txt
LayoutTests/http/tests/performance/performance-resource-timing-resourcetimingbufferfull-shrinking-buffer-crash.html
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-add-entries-during-callback-that-drop-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-add-then-clear-expected.txt
LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-then-increased-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/page/Performance.cpp