Changeset 129038 in webkit
- Timestamp:
- Sep 19, 2012 1:35:19 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r129037 r129038 1 2012-09-19 Joshua Bell <jsbell@chromium.org> 2 3 IndexedDB: Free up resources used by completed cursors earlier 4 https://bugs.webkit.org/show_bug.cgi?id=97023 5 6 Reviewed by Tony Chang. 7 8 Test to exercise cursor methods after the cursor has been run to the end. 9 10 * storage/indexeddb/cursor-finished-expected.txt: Added. 11 * storage/indexeddb/cursor-finished.html: Added. 12 * storage/indexeddb/resources/cursor-finished.js: Added. 13 (test): 14 (prepareDatabase): 15 (onDeleteSuccess): 16 (onUpgradeNeeded): 17 (onOpenSuccess): 18 (onCursorSuccess): 19 1 20 2012-09-19 David Grogan <dgrogan@chromium.org> 2 21 -
trunk/Source/WebCore/ChangeLog
r129037 r129038 1 2012-09-19 Joshua Bell <jsbell@chromium.org> 2 3 IndexedDB: Free up resources used by completed cursors earlier 4 https://bugs.webkit.org/show_bug.cgi?id=97023 5 6 Reviewed by Tony Chang. 7 8 Prior to this patch, IDBCursor objects are kept around by their parent 9 IDBTransaction until the transaction finishes. It's possible to release 10 references to them earlier, when the cursor has been "run to the end", 11 as no further events will fire and all calls to continue() etc should fail. 12 13 This change tells the cursor it's done when "null" finally comes through in 14 the IDBRequest, and the cursor then lets transaction know it can be 15 forgotten. 16 17 The added test doesn't distinguish the new behavior, but does exercise 18 "finished" cursors and apparently we didn't have tests for these before. 19 20 Test: storage/indexeddb/cursor-finished.html 21 22 * Modules/indexeddb/IDBCursor.cpp: 23 (WebCore::IDBCursor::close): Make idempotent; notify transaction. 24 * Modules/indexeddb/IDBRequest.cpp: 25 (WebCore::IDBRequest::onSuccess): Tell cursor it's finished before releasing. 26 * Modules/indexeddb/IDBTransaction.cpp: 27 (WebCore::IDBTransaction::OpenCursorNotifier::~OpenCursorNotifier): 28 (WebCore): 29 (WebCore::IDBTransaction::OpenCursorNotifier::cursorFinished): New method for explicit notification. 30 * Modules/indexeddb/IDBTransaction.h: 31 (OpenCursorNotifier): 32 1 33 2012-09-19 David Grogan <dgrogan@chromium.org> 2 34 -
trunk/Source/WebCore/Modules/indexeddb/IDBCursor.cpp
r128789 r129038 255 255 void IDBCursor::close() 256 256 { 257 ASSERT(m_request); 258 m_request->finishCursor(); 259 m_request.clear(); 257 m_transactionNotifier.cursorFinished(); 258 if (m_request) { 259 m_request->finishCursor(); 260 m_request.clear(); 261 } 260 262 } 261 263 -
trunk/Source/WebCore/Modules/indexeddb/IDBRequest.cpp
r128789 r129038 380 380 { 381 381 m_result = IDBAny::create(value); 382 m_pendingCursor.clear(); 382 if (m_pendingCursor) { 383 m_pendingCursor->close(); 384 m_pendingCursor.clear(); 385 } 383 386 enqueueEvent(createSuccessEvent()); 384 387 } -
trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp
r128533 r129038 233 233 IDBTransaction::OpenCursorNotifier::~OpenCursorNotifier() 234 234 { 235 m_transaction->unregisterOpenCursor(m_cursor); 235 if (m_cursor) 236 m_transaction->unregisterOpenCursor(m_cursor); 237 } 238 239 void IDBTransaction::OpenCursorNotifier::cursorFinished() 240 { 241 if (m_cursor) { 242 m_transaction->unregisterOpenCursor(m_cursor); 243 m_cursor = 0; 244 m_transaction.clear(); 245 } 236 246 } 237 247 -
trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.h
r126254 r129038 87 87 OpenCursorNotifier(PassRefPtr<IDBTransaction>, IDBCursor*); 88 88 ~OpenCursorNotifier(); 89 void cursorFinished(); 89 90 private: 90 91 RefPtr<IDBTransaction> m_transaction;
Note: See TracChangeset
for help on using the changeset viewer.