IndexedDB: Handle LevelDB database corruption
authorjsbell@chromium.org <jsbell@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 10 Mar 2012 03:10:08 +0000 (03:10 +0000)
committerjsbell@chromium.org <jsbell@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 10 Mar 2012 03:10:08 +0000 (03:10 +0000)
commita7994fac03d4d72928a42982eacc000da55c86d1
tree22400679ca64902e03be34164a6344671228db44
parent0727f3bf19330d2f3bbd9ac8d25da959c1d60471
IndexedDB: Handle LevelDB database corruption
https://bugs.webkit.org/show_bug.cgi?id=79413

Source/WebCore:

Add LevelDBDatabase::destroy() method so that clients can retry if open() fails.

Reviewed by Tony Chang.

Test: webkit_unit_tests --gtest_filter='LevelDBDatabaseTest.CorruptionTest'

* Modules/indexeddb/IDBLevelDBBackingStore.cpp: Implement open/destroy/open strategy.
(WebCore::IDBLevelDBBackingStore::open):
* platform/leveldb/LevelDBDatabase.cpp:
(WebCore::LevelDBDatabase::destroy):
(WebCore):
* platform/leveldb/LevelDBDatabase.h:
(LevelDBDatabase):

Source/WebKit/chromium:

Reviewed by Tony Chang.

* WebKit.gypi:
* tests/LevelDBTest.cpp: Added.
(WebCore):
(SimpleComparator):
(WebCore::SimpleComparator::compare):
(WebCore::SimpleComparator::name):
(WebCore::encodeString):
(WebCore::TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@110363 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/Modules/indexeddb/IDBLevelDBBackingStore.cpp
Source/WebCore/platform/leveldb/LevelDBDatabase.cpp
Source/WebCore/platform/leveldb/LevelDBDatabase.h
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/WebKit.gypi
Source/WebKit/chromium/tests/LevelDBTest.cpp [new file with mode: 0644]