Handling LevelDB errors encountered after open.
The previous IndexedDB implementation only checked for (and reported) corrupted LevelDB's during open. If they are determined to be corrupted during use then the database was simply closed. The page would be unaware of this, and would likely reopen the database at a later time (which would work) only to fail again during a read/write operation. There was no way for the page to get out of that corrupted state - the user would have to delete all origin data. This change will record the fact that the backing store was corrupted, and during open this would be read and, if present, result in the same dataLoss state being reported to the page in the upgradeneeded event. Also split IndexedDBBackingStore's REPORT_ERROR macro in two: REPORT_ERROR_UNTESTED (which calls NOTREACHED) and REPORT_ERROR. REPORT_ERROR is used for errors which are encountered during tests. This was done so that runtime errors could still be caught during a debug build run. BUG=322707 R=isherman@chromium.org, jochen@chromium.org, jsbell@chromium.org Review URL: https://codereview.chromium.org/197333009 Patch from Christopher Mumford <cmumford@chromium.org>. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@260147 0039d316-1c4b-4281-b951-d872f2087c98
Showing
This diff is collapsed.
Please register or sign in to comment