Changeset 274269 in webkit
- Timestamp:
- Mar 11, 2021 12:41:24 AM (17 months ago)
- Location:
- trunk
- Files:
-
- 2 added
- 8 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/storage/indexeddb/transaction-state-active-after-creation-expected.txt (added)
-
LayoutTests/storage/indexeddb/transaction-state-active-after-creation.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/Modules/indexeddb/IDBTransaction.cpp (modified) (2 diffs)
-
Source/WebCore/dom/EventLoop.cpp (modified) (1 diff)
-
Source/WebCore/dom/EventLoop.h (modified) (1 diff)
-
Source/WebCore/dom/Microtasks.cpp (modified) (1 diff)
-
Source/WebCore/dom/Microtasks.h (modified) (2 diffs)
-
Source/WebCore/dom/TaskSource.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r274267 r274269 1 2021-03-11 Sihui Liu <sihui_liu@apple.com> 2 3 Indexed DB transactions outdated immediately after it just created 4 https://bugs.webkit.org/show_bug.cgi?id=216769 5 <rdar://problem/69321075> 6 7 Reviewed by Ryosuke Niwa. 8 9 * storage/indexeddb/transaction-state-active-after-creation-expected.txt: Added. 10 * storage/indexeddb/transaction-state-active-after-creation.html: Added. 11 1 12 2021-03-10 Rob Buis <rbuis@igalia.com> 2 13 -
trunk/Source/WebCore/ChangeLog
r274267 r274269 1 2021-03-11 Sihui Liu <sihui_liu@apple.com> 2 3 Indexed DB transactions outdated immediately after it just created 4 https://bugs.webkit.org/show_bug.cgi?id=216769 5 <rdar://problem/69321075> 6 7 Reviewed by Ryosuke Niwa. 8 9 Test: storage/indexeddb/transaction-state-active-after-creation.html 10 11 Set transaction inactive in microtask checkpoint according to spec: 12 https://html.spec.whatwg.org/#perform-a-microtask-checkpoint 13 14 * Modules/indexeddb/IDBTransaction.cpp: 15 (WebCore::IDBTransaction::IDBTransaction): 16 * dom/EventLoop.cpp: 17 (WebCore::EventLoopTaskGroup::runAtEndOfMicrotaskCheckpoint): 18 * dom/EventLoop.h: 19 * dom/Microtasks.cpp: 20 (WebCore::MicrotaskQueue::performMicrotaskCheckpoint): 21 (WebCore::MicrotaskQueue::addCheckpointTask): 22 * dom/Microtasks.h: 23 * dom/TaskSource.h: 24 1 25 2021-03-10 Rob Buis <rbuis@igalia.com> 2 26 -
trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp
r273138 r274269 34 34 #include "Event.h" 35 35 #include "EventDispatcher.h" 36 #include "EventLoop.h" 36 37 #include "EventNames.h" 37 38 #include "EventQueue.h" … … 98 99 ASSERT(context); 99 100 100 JSC::VM& vm = context->vm(); 101 vm.whenIdle([protectedThis = makeRef(*this)]() { 101 context->eventLoop().runAtEndOfMicrotaskCheckpoint([protectedThis = makeRef(*this)] { 102 102 protectedThis->deactivate(); 103 103 }); -
trunk/Source/WebCore/dom/EventLoop.cpp
r269227 r274269 181 181 } 182 182 183 void EventLoopTaskGroup::runAtEndOfMicrotaskCheckpoint(EventLoop::TaskFunction&& function) 184 { 185 if (m_state == State::Stopped || !m_eventLoop) 186 return; 187 188 microtaskQueue().addCheckpointTask(makeUnique<EventLoopFunctionDispatchTask>(TaskSource::IndexedDB, *this, WTFMove(function))); 189 } 190 183 191 } // namespace WebCore -
trunk/Source/WebCore/dom/EventLoop.h
r269275 r274269 183 183 void performMicrotaskCheckpoint(); 184 184 185 void runAtEndOfMicrotaskCheckpoint(EventLoop::TaskFunction&&); 186 185 187 private: 186 188 enum class State : uint8_t { Running, Suspended, ReadyToStop, Stopped }; -
trunk/Source/WebCore/dom/Microtasks.cpp
r253091 r274269 68 68 vm().finalizeSynchronousJSExecution(); 69 69 m_microtaskQueue = WTFMove(toKeep); 70 71 auto checkpointTasks = std::exchange(m_checkpointTasks, { }); 72 for (auto& checkpointTask : checkpointTasks) { 73 auto* group = checkpointTask->group(); 74 if (!group || group->isStoppedPermanently()) 75 continue; 76 77 if (group->isSuspended()) { 78 m_checkpointTasks.append(WTFMove(checkpointTask)); 79 continue; 80 } 81 82 checkpointTask->execute(); 83 } 84 } 85 86 void MicrotaskQueue::addCheckpointTask(std::unique_ptr<EventLoopTask>&& task) 87 { 88 m_checkpointTasks.append(WTFMove(task)); 70 89 } 71 90 -
trunk/Source/WebCore/dom/Microtasks.h
r253091 r274269 42 42 WEBCORE_EXPORT void performMicrotaskCheckpoint(); 43 43 44 WEBCORE_EXPORT void addCheckpointTask(std::unique_ptr<EventLoopTask>&&); 45 44 46 private: 45 47 JSC::VM& vm() const { return m_vm.get(); } … … 49 51 // For the main thread the VM lives forever. For workers it's lifetime is tied to our owning WorkerGlobalScope. Regardless, we retain the VM here to be safe. 50 52 Ref<JSC::VM> m_vm; 53 54 Vector<std::unique_ptr<EventLoopTask>> m_checkpointTasks; 51 55 }; 52 56 -
trunk/Source/WebCore/dom/TaskSource.h
r269348 r274269 34 34 FontLoading, 35 35 IdleTask, 36 IndexedDB, 36 37 MediaElement, 37 38 Microtask, 38 39 Networking, 39 40 PostedMessageQueue, 41 Speech, 40 42 UserInteraction, 41 43 WebGL, 42 44 WebXR, 43 Speech,44 45 45 46 // Internal to WebCore
Note: See TracChangeset
for help on using the changeset viewer.