Title: [280988] trunk/Source/WebCore
Revision
280988
Author
[email protected]
Date
2021-08-12 15:27:09 -0700 (Thu, 12 Aug 2021)

Log Message

Unreviewed, reverting r280977.

Seems to have broken a test in debug

Reverted changeset:

"Migrate Performance::resourceTimingBufferFullTimerFired to
HTML event loop"
https://bugs.webkit.org/show_bug.cgi?id=229044
https://commits.webkit.org/r280977

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (280987 => 280988)


--- trunk/Source/WebCore/ChangeLog	2021-08-12 22:24:55 UTC (rev 280987)
+++ trunk/Source/WebCore/ChangeLog	2021-08-12 22:27:09 UTC (rev 280988)
@@ -1,5 +1,18 @@
 2021-08-12  Alex Christensen  <[email protected]>
 
+        Unreviewed, reverting r280977.
+
+        Seems to have broken a test in debug
+
+        Reverted changeset:
+
+        "Migrate Performance::resourceTimingBufferFullTimerFired to
+        HTML event loop"
+        https://bugs.webkit.org/show_bug.cgi?id=229044
+        https://commits.webkit.org/r280977
+
+2021-08-12  Alex Christensen  <[email protected]>
+
         Migrate Performance::resourceTimingBufferFullTimerFired to HTML event loop
         https://bugs.webkit.org/show_bug.cgi?id=229044
 

Modified: trunk/Source/WebCore/page/Performance.cpp (280987 => 280988)


--- trunk/Source/WebCore/page/Performance.cpp	2021-08-12 22:24:55 UTC (rev 280987)
+++ trunk/Source/WebCore/page/Performance.cpp	2021-08-12 22:27:09 UTC (rev 280988)
@@ -60,6 +60,7 @@
 
 Performance::Performance(ScriptExecutionContext* context, MonotonicTime timeOrigin)
     : ContextDestructionObserver(context)
+    , m_resourceTimingBufferFullTimer(*this, &Performance::resourceTimingBufferFullTimerFired) // FIXME: Migrate this to the event loop as well. https://bugs.webkit.org/show_bug.cgi?id=229044
     , m_timeOrigin(timeOrigin)
 {
     ASSERT(m_timeOrigin);
@@ -67,6 +68,12 @@
 
 Performance::~Performance() = default;
 
+void Performance::contextDestroyed()
+{
+    m_resourceTimingBufferFullTimer.stop();
+    ContextDestructionObserver::contextDestroyed();
+}
+
 DOMHighResTimeStamp Performance::now() const
 {
     return nowInReducedResolutionSeconds().milliseconds();
@@ -256,14 +263,10 @@
     }
 
     if (isResourceTimingBufferFull()) {
+        ASSERT(!m_resourceTimingBufferFullTimer.isActive());
         m_backupResourceTimingBuffer.append(WTFMove(entry));
         m_waitingForBackupBufferToBeProcessed = true;
-        auto* context = scriptExecutionContext();
-        if (!context)
-            return;
-        context->eventLoop().queueTask(TaskSource::PerformanceTimeline, [protectedThis = makeRef(*this)] {
-            protectedThis->dispatchResourceTimingBufferFullEvent();
-        });
+        m_resourceTimingBufferFullTimer.startOneShot(0_s);
         return;
     }
 
@@ -276,10 +279,9 @@
     return m_resourceTimingBuffer.size() >= m_resourceTimingBufferSize;
 }
 
-void Performance::dispatchResourceTimingBufferFullEvent()
+void Performance::resourceTimingBufferFullTimerFired()
 {
-    if (!scriptExecutionContext())
-        return;
+    ASSERT(scriptExecutionContext());
 
     while (!m_backupResourceTimingBuffer.isEmpty()) {
         auto beforeCount = m_backupResourceTimingBuffer.size();

Modified: trunk/Source/WebCore/page/Performance.h (280987 => 280988)


--- trunk/Source/WebCore/page/Performance.h	2021-08-12 22:24:55 UTC (rev 280987)
+++ trunk/Source/WebCore/page/Performance.h	2021-08-12 22:27:09 UTC (rev 280988)
@@ -119,6 +119,8 @@
 private:
     Performance(ScriptExecutionContext*, MonotonicTime timeOrigin);
 
+    void contextDestroyed() override;
+
     EventTargetInterface eventTargetInterface() const final { return PerformanceEventTargetInterfaceType; }
 
     void refEventTarget() final { ref(); }
@@ -125,7 +127,7 @@
     void derefEventTarget() final { deref(); }
 
     bool isResourceTimingBufferFull() const;
-    void dispatchResourceTimingBufferFullEvent();
+    void resourceTimingBufferFullTimerFired();
 
     void queueEntry(PerformanceEntry&);
     void scheduleTaskIfNeeded();
@@ -137,6 +139,7 @@
     Vector<RefPtr<PerformanceEntry>> m_resourceTimingBuffer;
     unsigned m_resourceTimingBufferSize { 150 };
 
+    Timer m_resourceTimingBufferFullTimer;
     Vector<RefPtr<PerformanceEntry>> m_backupResourceTimingBuffer;
 
     // https://w3c.github.io/resource-timing/#dfn-resource-timing-buffer-full-flag
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to