Changeset 280977 in webkit
- Timestamp:
- Aug 12, 2021, 12:25:04 PM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
-
ChangeLog (modified) (1 diff)
-
page/Performance.cpp (modified) (4 diffs)
-
page/Performance.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r280976 r280977 1 2021-08-12 Alex Christensen <achristensen@webkit.org> 2 3 Migrate Performance::resourceTimingBufferFullTimerFired to HTML event loop 4 https://bugs.webkit.org/show_bug.cgi?id=229044 5 6 Reviewed by Geoff Garen. 7 8 Covered by existing tests. 9 There should be no change in behavior. 10 11 * page/Performance.cpp: 12 (WebCore::Performance::Performance): 13 (WebCore::Performance::addResourceTiming): 14 (WebCore::Performance::dispatchResourceTimingBufferFullEvent): 15 (WebCore::Performance::contextDestroyed): Deleted. 16 (WebCore::Performance::resourceTimingBufferFullTimerFired): Deleted. 17 * page/Performance.h: 18 1 19 2021-08-12 Jer Noble <jer.noble@apple.com> 2 20 -
trunk/Source/WebCore/page/Performance.cpp
r279203 r280977 61 61 Performance::Performance(ScriptExecutionContext* context, MonotonicTime timeOrigin) 62 62 : ContextDestructionObserver(context) 63 , m_resourceTimingBufferFullTimer(*this, &Performance::resourceTimingBufferFullTimerFired) // FIXME: Migrate this to the event loop as well.64 63 , m_timeOrigin(timeOrigin) 65 64 { … … 68 67 69 68 Performance::~Performance() = default; 70 71 void Performance::contextDestroyed()72 {73 m_resourceTimingBufferFullTimer.stop();74 ContextDestructionObserver::contextDestroyed();75 }76 69 77 70 DOMHighResTimeStamp Performance::now() const … … 264 257 265 258 if (isResourceTimingBufferFull()) { 266 ASSERT(!m_resourceTimingBufferFullTimer.isActive());267 259 m_backupResourceTimingBuffer.append(WTFMove(entry)); 268 260 m_waitingForBackupBufferToBeProcessed = true; 269 m_resourceTimingBufferFullTimer.startOneShot(0_s); 261 auto* context = scriptExecutionContext(); 262 if (!context) 263 return; 264 context->eventLoop().queueTask(TaskSource::PerformanceTimeline, [protectedThis = makeRef(*this)] { 265 protectedThis->dispatchResourceTimingBufferFullEvent(); 266 }); 270 267 return; 271 268 } … … 280 277 } 281 278 282 void Performance::resourceTimingBufferFullTimerFired() 283 { 284 ASSERT(scriptExecutionContext()); 279 void Performance::dispatchResourceTimingBufferFullEvent() 280 { 281 if (!scriptExecutionContext()) 282 return; 285 283 286 284 while (!m_backupResourceTimingBuffer.isEmpty()) { -
trunk/Source/WebCore/page/Performance.h
r279203 r280977 120 120 Performance(ScriptExecutionContext*, MonotonicTime timeOrigin); 121 121 122 void contextDestroyed() override;123 124 122 EventTargetInterface eventTargetInterface() const final { return PerformanceEventTargetInterfaceType; } 125 123 … … 128 126 129 127 bool isResourceTimingBufferFull() const; 130 void resourceTimingBufferFullTimerFired();128 void dispatchResourceTimingBufferFullEvent(); 131 129 132 130 void queueEntry(PerformanceEntry&); … … 140 138 unsigned m_resourceTimingBufferSize { 150 }; 141 139 142 Timer m_resourceTimingBufferFullTimer;143 140 Vector<RefPtr<PerformanceEntry>> m_backupResourceTimingBuffer; 144 141
Note:
See TracChangeset
for help on using the changeset viewer.