IndexedDB: Handle LevelDB database corruption
authorjsbell@chromium.org <jsbell@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 12 Mar 2012 19:57:00 +0000 (19:57 +0000)
committerjsbell@chromium.org <jsbell@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 12 Mar 2012 19:57:00 +0000 (19:57 +0000)
commit68cb5685a03a9a92c1a2c88c7e4f9493eb3ba17e
tree24c2ca7efa3376101dbad8289abec2c6edb2655b
parentd2ccb42216fa8e155a5fec778d35bc346fa586d0
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.gyp: Skip LevelDBTest.cpp in shared component builds due to webkit_support dependency
* WebKit.gypi: Add LevelDBTest.cpp
* 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@110463 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.gyp
Source/WebKit/chromium/WebKit.gypi
Source/WebKit/chromium/tests/LevelDBTest.cpp [new file with mode: 0644]