Title: [116562] trunk/Source/WebCore
Revision
116562
Author
[email protected]
Date
2012-05-09 15:09:10 -0700 (Wed, 09 May 2012)

Log Message

IndexedDB: call abort handler when there are problems committing
https://bugs.webkit.org/show_bug.cgi?id=85841

Patch by Alec Flett <[email protected]> on 2012-05-09
Reviewed by Ojan Vafai.

No new tests. Every existing test that calls commit() is testing
the success side of this, and this only throws when there are
LevelDB errors, which is exactly what we're trying to diagnose
with this patch.

* Modules/indexeddb/IDBBackingStore.h:
(Transaction):
* Modules/indexeddb/IDBLevelDBBackingStore.cpp:
(WebCore::IDBLevelDBBackingStore::deleteDatabase):
(WebCore::IDBLevelDBBackingStore::Transaction::commit):
* Modules/indexeddb/IDBLevelDBBackingStore.h:
(Transaction):
* Modules/indexeddb/IDBTransactionBackendImpl.cpp:
(WebCore::IDBTransactionBackendImpl::commit):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (116561 => 116562)


--- trunk/Source/WebCore/ChangeLog	2012-05-09 22:06:27 UTC (rev 116561)
+++ trunk/Source/WebCore/ChangeLog	2012-05-09 22:09:10 UTC (rev 116562)
@@ -1,3 +1,25 @@
+2012-05-09  Alec Flett  <[email protected]>
+
+        IndexedDB: call abort handler when there are problems committing
+        https://bugs.webkit.org/show_bug.cgi?id=85841
+
+        Reviewed by Ojan Vafai.
+
+        No new tests. Every existing test that calls commit() is testing
+        the success side of this, and this only throws when there are
+        LevelDB errors, which is exactly what we're trying to diagnose
+        with this patch.
+
+        * Modules/indexeddb/IDBBackingStore.h:
+        (Transaction):
+        * Modules/indexeddb/IDBLevelDBBackingStore.cpp:
+        (WebCore::IDBLevelDBBackingStore::deleteDatabase):
+        (WebCore::IDBLevelDBBackingStore::Transaction::commit):
+        * Modules/indexeddb/IDBLevelDBBackingStore.h:
+        (Transaction):
+        * Modules/indexeddb/IDBTransactionBackendImpl.cpp:
+        (WebCore::IDBTransactionBackendImpl::commit):
+
 2012-05-09  Mark Pilgrim  <[email protected]>
 
         [Chromium] Remove PlatformSupport::loadPlatformImageResource, call loadResource directly

Modified: trunk/Source/WebCore/Modules/indexeddb/IDBBackingStore.h (116561 => 116562)


--- trunk/Source/WebCore/Modules/indexeddb/IDBBackingStore.h	2012-05-09 22:06:27 UTC (rev 116561)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBBackingStore.h	2012-05-09 22:09:10 UTC (rev 116562)
@@ -113,7 +113,7 @@
     public:
         virtual ~Transaction() { }
         virtual void begin() = 0;
-        virtual void commit() = 0;
+        virtual bool commit() = 0;
         virtual void rollback() = 0;
     };
     virtual PassRefPtr<Transaction> createTransaction() = 0;

Modified: trunk/Source/WebCore/Modules/indexeddb/IDBLevelDBBackingStore.cpp (116561 => 116562)


--- trunk/Source/WebCore/Modules/indexeddb/IDBLevelDBBackingStore.cpp	2012-05-09 22:06:27 UTC (rev 116561)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBLevelDBBackingStore.cpp	2012-05-09 22:09:10 UTC (rev 116562)
@@ -309,8 +309,7 @@
     const Vector<char> key = DatabaseNameKey::encode(m_identifier, name);
     m_currentTransaction->remove(key);
 
-    transaction->commit();
-    return true;
+    return transaction->commit();
 }
 
 static bool checkObjectStoreAndMetaDataType(const LevelDBIterator* it, const Vector<char>& stopKey, int64_t objectStoreId, int64_t metaDataType)
@@ -1575,11 +1574,12 @@
     m_backingStore->m_currentTransaction = LevelDBTransaction::create(m_backingStore->m_db.get());
 }
 
-void IDBLevelDBBackingStore::Transaction::commit()
+bool IDBLevelDBBackingStore::Transaction::commit()
 {
     ASSERT(m_backingStore->m_currentTransaction);
-    m_backingStore->m_currentTransaction->commit();
+    bool result = m_backingStore->m_currentTransaction->commit();
     m_backingStore->m_currentTransaction.clear();
+    return result;
 }
 
 void IDBLevelDBBackingStore::Transaction::rollback()

Modified: trunk/Source/WebCore/Modules/indexeddb/IDBLevelDBBackingStore.h (116561 => 116562)


--- trunk/Source/WebCore/Modules/indexeddb/IDBLevelDBBackingStore.h	2012-05-09 22:06:27 UTC (rev 116561)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBLevelDBBackingStore.h	2012-05-09 22:09:10 UTC (rev 116562)
@@ -93,7 +93,7 @@
     public:
         static PassRefPtr<Transaction> create(IDBLevelDBBackingStore*);
         virtual void begin();
-        virtual void commit();
+        virtual bool commit();
         virtual void rollback();
 
     private:

Modified: trunk/Source/WebCore/Modules/indexeddb/IDBTransactionBackendImpl.cpp (116561 => 116562)


--- trunk/Source/WebCore/Modules/indexeddb/IDBTransactionBackendImpl.cpp	2012-05-09 22:06:27 UTC (rev 116561)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBTransactionBackendImpl.cpp	2012-05-09 22:09:10 UTC (rev 116562)
@@ -197,8 +197,10 @@
 
     m_state = Finished;
     closeOpenCursors();
-    m_transaction->commit();
-    m_callbacks->onComplete();
+    if (m_transaction->commit())
+        m_callbacks->onComplete();
+    else
+        m_callbacks->onAbort();
     m_database->transactionCoordinator()->didFinishTransaction(this);
     m_database->transactionFinished(this);
     m_database = 0;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to