Title: [134968] trunk/Source/WebCore
Revision
134968
Author
alecfl...@chromium.org
Date
2012-11-16 10:33:48 -0800 (Fri, 16 Nov 2012)

Log Message

IndexedDB: add missing 'explicit' and fix backing store release
https://bugs.webkit.org/show_bug.cgi?id=102450

Reviewed by Tony Chang.

A inconsequential regression was introduced in http://trac.webkit.org/changeset/134129
which resulted in objects sticking around a bit longer than
expected. This makes sure the LevelDBTransaction is released
at the moment of commit/rollback rather than when IDBTransactionBackendImpl
is destroyed.

No new tests, this is just internal state that will affect
some future refactoring.

* Modules/indexeddb/IDBBackingStore.h:
(Cursor):
(Transaction):
(WebCore::IDBBackingStore::Transaction::reset):
* Modules/indexeddb/IDBTransactionBackendImpl.cpp:
(WebCore::IDBTransactionBackendImpl::abort):
(WebCore::IDBTransactionBackendImpl::commit):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (134967 => 134968)


--- trunk/Source/WebCore/ChangeLog	2012-11-16 18:30:47 UTC (rev 134967)
+++ trunk/Source/WebCore/ChangeLog	2012-11-16 18:33:48 UTC (rev 134968)
@@ -1,3 +1,27 @@
+2012-11-16  Alec Flett  <alecfl...@chromium.org>
+
+        IndexedDB: add missing 'explicit' and fix backing store release
+        https://bugs.webkit.org/show_bug.cgi?id=102450
+
+        Reviewed by Tony Chang.
+
+        A inconsequential regression was introduced in http://trac.webkit.org/changeset/134129
+        which resulted in objects sticking around a bit longer than
+        expected. This makes sure the LevelDBTransaction is released
+        at the moment of commit/rollback rather than when IDBTransactionBackendImpl
+        is destroyed.
+
+        No new tests, this is just internal state that will affect
+        some future refactoring.
+
+        * Modules/indexeddb/IDBBackingStore.h:
+        (Cursor):
+        (Transaction):
+        (WebCore::IDBBackingStore::Transaction::reset):
+        * Modules/indexeddb/IDBTransactionBackendImpl.cpp:
+        (WebCore::IDBTransactionBackendImpl::abort):
+        (WebCore::IDBTransactionBackendImpl::commit):
+
 2012-11-16  Dimitri Glazkov  <dglaz...@chromium.org>
 
         [Chromium] One last tweak to WebCore.gypi to make Win build not sad.

Modified: trunk/Source/WebCore/Modules/indexeddb/IDBBackingStore.h (134967 => 134968)


--- trunk/Source/WebCore/Modules/indexeddb/IDBBackingStore.h	2012-11-16 18:30:47 UTC (rev 134967)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBBackingStore.h	2012-11-16 18:33:48 UTC (rev 134968)
@@ -118,7 +118,7 @@
             , m_cursorOptions(cursorOptions)
         {
         }
-        Cursor(const IDBBackingStore::Cursor* other);
+        explicit Cursor(const IDBBackingStore::Cursor* other);
 
         PassRefPtr<IDBKey> key() const { return m_currentKey; }
         bool continueFunction(const IDBKey* = 0, IteratorState = Seek);
@@ -149,10 +149,11 @@
 
     class Transaction {
     public:
-        Transaction(IDBBackingStore*);
+        explicit Transaction(IDBBackingStore*);
         void begin();
         bool commit();
         void rollback();
+        void reset() { m_backingStore = 0; m_transaction = 0; }
 
         static LevelDBTransaction* levelDBTransactionFrom(Transaction* transaction)
         {

Modified: trunk/Source/WebCore/Modules/indexeddb/IDBTransactionBackendImpl.cpp (134967 => 134968)


--- trunk/Source/WebCore/Modules/indexeddb/IDBTransactionBackendImpl.cpp	2012-11-16 18:30:47 UTC (rev 134967)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBTransactionBackendImpl.cpp	2012-11-16 18:33:48 UTC (rev 134968)
@@ -130,7 +130,7 @@
     // are fired, as the script callbacks may release references and allow the backing store
     // itself to be released, and order is critical.
     closeOpenCursors();
-    m_transaction = 0;
+    m_transaction.reset();
 
     // Transactions must also be marked as completed before the front-end is notified, as
     // the transaction completion unblocks operations like closing connections.
@@ -216,7 +216,7 @@
     // are fired, as the script callbacks may release references and allow the backing store
     // itself to be released, and order is critical.
     closeOpenCursors();
-    m_transaction = 0;
+    m_transaction.reset();
 
     // Transactions must also be marked as completed before the front-end is notified, as
     // the transaction completion unblocks operations like closing connections.
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to