IndexedDB: Database enumeration should not include failed opens
commitfb7282a3c0353cb2bb880e8f48c1655f129cdb97
authorjsbell@chromium.org <jsbell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Mon, 11 Aug 2014 23:30:55 +0000 (11 23:30 +0000)
committerjsbell@chromium.org <jsbell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Mon, 11 Aug 2014 23:32:14 +0000 (11 23:32 +0000)
tree861771d170b1a85714afa68aa1988e92ba9e7514
parent93413fb5df4156148d96049f57772581f9109dd1
IndexedDB: Database enumeration should not include failed opens

When a database is first opened, metadata is written to the backing
store. This metadata is retained even if the open is eventually
aborted. This would show up when the (nonstandard) getDatabaseNames
method was used... such as by the inspector. The inspector would
then attempt to open the database and implicitly create it!

As a quick fix, ignore databases with the default version (this case)
when enumerating. A longer term fix would be to not write the metadata
separately from the upgrade transaction, but we must still cope with
stale metadata in existing backing stores.

BUG=395472
R=cmumford@chromium.org,dgrogan@chromium.org

Review URL: https://codereview.chromium.org/429713002

Cr-Commit-Position: refs/heads/master@{#288826}
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@288826 0039d316-1c4b-4281-b951-d872f2087c98
content/browser/indexed_db/indexed_db_backing_store.cc
content/browser/indexed_db/indexed_db_backing_store_unittest.cc