WebKit Bugzilla
Attachment 362095 Details for
Bug 193213
: Fix Resource Timing buffer edge cases for WPT
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-193213-20190214224400.patch (text/plain), 9.43 KB, created by
cvazac
on 2019-02-14 20:44:01 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
cvazac
Created:
2019-02-14 20:44:01 PST
Size:
9.43 KB
patch
obsolete
>Subversion Revision: 241496 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index b1935336e67dc9a6462f84b3211f9fa9dc14796e..7bd3db117d9c24434d4c0f43ad527386f8615220 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,18 @@ >+2019-02-14 Charles Vazac <cvazac@akamai.com> >+ >+ Fix Resource Timing buffer edge cases for WPT >+ https://bugs.webkit.org/show_bug.cgi?id=193213 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ 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. >+ > 2019-02-13 Joseph Pecoraro <pecoraro@apple.com> > > Web Inspector: Crash when inspecting an element that constantly changes visibility >diff --git a/Source/WebCore/page/Performance.cpp b/Source/WebCore/page/Performance.cpp >index d51b26d880ec895d7d699edfbcaba2e65a8465a5..a1cada98368fae8dde4489b8634067432e6d1f23 100644 >--- a/Source/WebCore/page/Performance.cpp >+++ b/Source/WebCore/page/Performance.cpp >@@ -212,11 +212,15 @@ bool Performance::isResourceTimingBufferFull() const > void Performance::resourceTimingBufferFullTimerFired() > { > while (!m_backupResourceTimingBuffer.isEmpty()) { >+ auto beforeCount = m_backupResourceTimingBuffer.size(); >+ > auto backupBuffer = WTFMove(m_backupResourceTimingBuffer); > ASSERT(m_backupResourceTimingBuffer.isEmpty()); > >- m_resourceTimingBufferFullFlag = true; >- dispatchEvent(Event::create(eventNames().resourcetimingbufferfullEvent, Event::CanBubble::No, Event::IsCancelable::No)); >+ if (isResourceTimingBufferFull()) { >+ m_resourceTimingBufferFullFlag = true; >+ dispatchEvent(Event::create(eventNames().resourcetimingbufferfullEvent, Event::CanBubble::No, Event::IsCancelable::No)); >+ } > > if (m_resourceTimingBufferFullFlag) { > for (auto& entry : backupBuffer) >@@ -239,6 +243,13 @@ void Performance::resourceTimingBufferFullTimerFired() > } else > m_backupResourceTimingBuffer.append(entry.copyRef()); > } >+ >+ auto afterCount = m_backupResourceTimingBuffer.size(); >+ >+ if (beforeCount <= afterCount) { >+ m_backupResourceTimingBuffer.clear(); >+ break; >+ } > } > m_waitingForBackupBufferToBeProcessed = false; > } >diff --git a/LayoutTests/imported/w3c/ChangeLog b/LayoutTests/imported/w3c/ChangeLog >index ce0540cfd917401df3c0d21ea179995c63b0ba92..46cd2e9513eb0fb9504bb42dc7b6bc7b6480e77f 100644 >--- a/LayoutTests/imported/w3c/ChangeLog >+++ b/LayoutTests/imported/w3c/ChangeLog >@@ -1,3 +1,15 @@ >+2019-02-14 Charles Vazac <cvazac@akamai.com> >+ >+ Fix Resource Timing buffer edge cases for WPT >+ https://bugs.webkit.org/show_bug.cgi?id=193213 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * 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: >+ > 2019-02-12 Rob Buis <rbuis@igalia.com> > > Align with Fetch on data: URLs >diff --git a/LayoutTests/http/tests/performance/performance-resource-timing-resourcetimingbufferfull-shrinking-buffer-crash-expected.txt b/LayoutTests/http/tests/performance/performance-resource-timing-resourcetimingbufferfull-shrinking-buffer-crash-expected.txt >index d0961e94a93ec60c1b1694a2cd5be9c85f1029e4..8eaa75e955a24ac0ddf7076688dc8047bb78b1ba 100644 >--- a/LayoutTests/http/tests/performance/performance-resource-timing-resourcetimingbufferfull-shrinking-buffer-crash-expected.txt >+++ b/LayoutTests/http/tests/performance/performance-resource-timing-resourcetimingbufferfull-shrinking-buffer-crash-expected.txt >@@ -19,12 +19,10 @@ performance.setResourceTimingBufferSize(1) > PASS resourcesAfterShrinkingBuffer = performance.getEntriesByType("resource"); resourcesAfterShrinkingBuffer.length is 2 > PASS resourcesAfterShrinkingBuffer[0] is originalResources[0] > PASS resourcesAfterShrinkingBuffer[1] is originalResources[1] >- >-Inside resourcetimingbufferfull 2 > PASS performance.clearResourceTimings(); performance.getEntriesByType("resource").length is 0 > > After resourcetimingbufferfull >-PASS resourcetimingbufferfullEventCount is 2 >+PASS resourcetimingbufferfullEventCount is 1 > PASS resourcesAfterClearing = performance.getEntriesByType("resource"); resourcesAfterClearing.length is 1 > PASS resourcesAfterClearing[0].initiatorType is "fetch" > PASS new URL(resourcesAfterClearing[0].name).search is "?resource=2" >diff --git a/LayoutTests/http/tests/performance/performance-resource-timing-resourcetimingbufferfull-shrinking-buffer-crash.html b/LayoutTests/http/tests/performance/performance-resource-timing-resourcetimingbufferfull-shrinking-buffer-crash.html >index eb2240478907ee8f920205f087e6b9d3c2cbd86c..312d58345fd4e8b310b57d6e893d1130eb7662be 100644 >--- a/LayoutTests/http/tests/performance/performance-resource-timing-resourcetimingbufferfull-shrinking-buffer-crash.html >+++ b/LayoutTests/http/tests/performance/performance-resource-timing-resourcetimingbufferfull-shrinking-buffer-crash.html >@@ -42,12 +42,11 @@ performance.onresourcetimingbufferfull = () => { > shouldBe('resourcesAfterShrinkingBuffer = performance.getEntriesByType("resource"); resourcesAfterShrinkingBuffer.length', '2'); > shouldBe('resourcesAfterShrinkingBuffer[0]', 'originalResources[0]'); > shouldBe('resourcesAfterShrinkingBuffer[1]', 'originalResources[1]'); >- } else if (resourcetimingbufferfullEventCount == 2) { > shouldBe('performance.clearResourceTimings(); performance.getEntriesByType("resource").length', '0'); > setTimeout(() => { > debug(''); > debug('After resourcetimingbufferfull'); >- shouldBe('resourcetimingbufferfullEventCount', '2'); >+ shouldBe('resourcetimingbufferfullEventCount', '1'); > shouldBe('resourcesAfterClearing = performance.getEntriesByType("resource"); resourcesAfterClearing.length', '1'); > shouldBeEqualToString('resourcesAfterClearing[0].initiatorType', 'fetch'); > shouldBeEqualToString('new URL(resourcesAfterClearing[0].name).search', '?resource=2'); >diff --git a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-add-entries-during-callback-that-drop-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-add-entries-during-callback-that-drop-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..1c02f020d4c02dc22a8de00871b4e0fff7b38336 >--- /dev/null >+++ b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-add-entries-during-callback-that-drop-expected.txt >@@ -0,0 +1,3 @@ >+ >+PASS Test that entries synchronously added to the buffer during the callback are dropped >+ >diff --git a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-add-then-clear-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-add-then-clear-expected.txt >index a0ea4c3d1f8bfcc71ea556ffabe055f2d88dc0ed..dcfe228549dfe03d05900623354536d288706b61 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-add-then-clear-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-add-then-clear-expected.txt >@@ -1,6 +1,3 @@ >-CONSOLE MESSAGE: line 2659: Error: assert_unreached: resourcetimingbufferfull should not fire Reached unreachable code > >-Harness Error (FAIL), message = Error: assert_unreached: resourcetimingbufferfull should not fire Reached unreachable code >- >-FAIL Test that if the buffer is cleared after entries were added to the secondary buffer, those entries make it into the primary one assert_equals: the last 3 resources should be in the buffer, since the first one was cleared expected 3 but got 0 >+PASS Test that if the buffer is cleared after entries were added to the secondary buffer, those entries make it into the primary one > >diff --git a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-then-increased-expected.txt b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-then-increased-expected.txt >index b47fa53c1923a6fa9773374ef1cb25b8b51bcb07..744558bf4e097c3b1e4947cffc0948b69ad38d87 100644 >--- a/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-then-increased-expected.txt >+++ b/LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer-full-then-increased-expected.txt >@@ -1,6 +1,3 @@ >-CONSOLE MESSAGE: line 2659: Error: assert_unreached: resourcetimingbufferfull should not fire Reached unreachable code > >-Harness Error (FAIL), message = Error: assert_unreached: resourcetimingbufferfull should not fire Reached unreachable code >- >-FAIL Test that overflowing the buffer and immediately increasing its limit does not trigger the resourcetimingbufferfull event assert_equals: All resources should be in the buffer, since its size was increased expected 3 but got 1 >+PASS Test that overflowing the buffer and immediately increasing its limit does not trigger the resourcetimingbufferfull event >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 193213
:
358530
|
358532
|
358540
|
358544
|
358552
|
358554
|
358555
|
360247
|
360249
|
360250
|
360253
|
360254
|
360255
|
360264
|
360268
|
360344
|
360345
|
362013
|
362014
|
362020
|
362021
|
362024
|
362025
|
362028
|
362034
|
362039
|
362060
|
362095
|
362115