Title: [118042] branches/chromium/1132/Source/WebCore/Modules/indexeddb
Revision
118042
Author
[email protected]
Date
2012-05-22 13:37:27 -0700 (Tue, 22 May 2012)

Log Message

Merge 116562 - 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):

[email protected]
Review URL: https://chromiumcodereview.appspot.com/10422005

Modified Paths

Diff

Modified: branches/chromium/1132/Source/WebCore/Modules/indexeddb/IDBBackingStore.h (118041 => 118042)


--- branches/chromium/1132/Source/WebCore/Modules/indexeddb/IDBBackingStore.h	2012-05-22 20:37:14 UTC (rev 118041)
+++ branches/chromium/1132/Source/WebCore/Modules/indexeddb/IDBBackingStore.h	2012-05-22 20:37:27 UTC (rev 118042)
@@ -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: branches/chromium/1132/Source/WebCore/Modules/indexeddb/IDBLevelDBBackingStore.cpp (118041 => 118042)


--- branches/chromium/1132/Source/WebCore/Modules/indexeddb/IDBLevelDBBackingStore.cpp	2012-05-22 20:37:14 UTC (rev 118041)
+++ branches/chromium/1132/Source/WebCore/Modules/indexeddb/IDBLevelDBBackingStore.cpp	2012-05-22 20:37:27 UTC (rev 118042)
@@ -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: branches/chromium/1132/Source/WebCore/Modules/indexeddb/IDBLevelDBBackingStore.h (118041 => 118042)


--- branches/chromium/1132/Source/WebCore/Modules/indexeddb/IDBLevelDBBackingStore.h	2012-05-22 20:37:14 UTC (rev 118041)
+++ branches/chromium/1132/Source/WebCore/Modules/indexeddb/IDBLevelDBBackingStore.h	2012-05-22 20:37:27 UTC (rev 118042)
@@ -93,7 +93,7 @@
     public:
         static PassRefPtr<Transaction> create(IDBLevelDBBackingStore*);
         virtual void begin();
-        virtual void commit();
+        virtual bool commit();
         virtual void rollback();
 
     private:

Modified: branches/chromium/1132/Source/WebCore/Modules/indexeddb/IDBTransactionBackendImpl.cpp (118041 => 118042)


--- branches/chromium/1132/Source/WebCore/Modules/indexeddb/IDBTransactionBackendImpl.cpp	2012-05-22 20:37:14 UTC (rev 118041)
+++ branches/chromium/1132/Source/WebCore/Modules/indexeddb/IDBTransactionBackendImpl.cpp	2012-05-22 20:37:27 UTC (rev 118042)
@@ -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