⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 280988 in webkit


Ignore:
Timestamp:
Aug 12, 2021, 3:27:09 PM (5 years ago)
Author:
achristensen@apple.com
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

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r280977 r280988  
     12021-08-12  Alex Christensen  <achristensen@webkit.org>
     2
     3        Unreviewed, reverting r280977.
     4
     5        Seems to have broken a test in debug
     6
     7        Reverted changeset:
     8
     9        "Migrate Performance::resourceTimingBufferFullTimerFired to
     10        HTML event loop"
     11        https://bugs.webkit.org/show_bug.cgi?id=229044
     12        https://commits.webkit.org/r280977
     13
    1142021-08-12  Alex Christensen  <achristensen@webkit.org>
    215
  • trunk/Source/WebCore/page/Performance.cpp

    r280977 r280988  
    6161Performance::Performance(ScriptExecutionContext* context, MonotonicTime timeOrigin)
    6262    : ContextDestructionObserver(context)
     63    , m_resourceTimingBufferFullTimer(*this, &Performance::resourceTimingBufferFullTimerFired) // FIXME: Migrate this to the event loop as well. https://bugs.webkit.org/show_bug.cgi?id=229044
    6364    , m_timeOrigin(timeOrigin)
    6465{
     
    6768
    6869Performance::~Performance() = default;
     70
     71void Performance::contextDestroyed()
     72{
     73    m_resourceTimingBufferFullTimer.stop();
     74    ContextDestructionObserver::contextDestroyed();
     75}
    6976
    7077DOMHighResTimeStamp Performance::now() const
     
    257264
    258265    if (isResourceTimingBufferFull()) {
     266        ASSERT(!m_resourceTimingBufferFullTimer.isActive());
    259267        m_backupResourceTimingBuffer.append(WTFMove(entry));
    260268        m_waitingForBackupBufferToBeProcessed = true;
    261         auto* context = scriptExecutionContext();
    262         if (!context)
    263             return;
    264         context->eventLoop().queueTask(TaskSource::PerformanceTimeline, [protectedThis = makeRef(*this)] {
    265             protectedThis->dispatchResourceTimingBufferFullEvent();
    266         });
     269        m_resourceTimingBufferFullTimer.startOneShot(0_s);
    267270        return;
    268271    }
     
    277280}
    278281
    279 void Performance::dispatchResourceTimingBufferFullEvent()
    280 {
    281     if (!scriptExecutionContext())
    282         return;
     282void Performance::resourceTimingBufferFullTimerFired()
     283{
     284    ASSERT(scriptExecutionContext());
    283285
    284286    while (!m_backupResourceTimingBuffer.isEmpty()) {
  • trunk/Source/WebCore/page/Performance.h

    r280977 r280988  
    120120    Performance(ScriptExecutionContext*, MonotonicTime timeOrigin);
    121121
     122    void contextDestroyed() override;
     123
    122124    EventTargetInterface eventTargetInterface() const final { return PerformanceEventTargetInterfaceType; }
    123125
     
    126128
    127129    bool isResourceTimingBufferFull() const;
    128     void dispatchResourceTimingBufferFullEvent();
     130    void resourceTimingBufferFullTimerFired();
    129131
    130132    void queueEntry(PerformanceEntry&);
     
    138140    unsigned m_resourceTimingBufferSize { 150 };
    139141
     142    Timer m_resourceTimingBufferFullTimer;
    140143    Vector<RefPtr<PerformanceEntry>> m_backupResourceTimingBuffer;
    141144
Note: See TracChangeset for help on using the changeset viewer.