IndexedDB: Prevent store/index deletion from racing ahead of use
commit12c3377275cca0293f62e69de943c2cf6e3ea644
authorjsbell@chromium.org <jsbell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Thu, 22 May 2014 19:42:42 +0000 (22 19:42 +0000)
committerjsbell@chromium.org <jsbell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Thu, 22 May 2014 19:42:42 +0000 (22 19:42 +0000)
tree916663a4aafb28984232f64621a38ca095317ad0
parent8ed02f6e8f5200f6034f3f3ecd82a0dc8e1acf36
IndexedDB: Prevent store/index deletion from racing ahead of use

In the Indexed DB spec, schema updates occur synchronously from the
perspective of script, e.g. you can create a store then use it
immediately without waiting for a request to complete. That model was
carried through to the back end, but with a subtle issue that the
deletion of a store or index could "race ahead" of a previously
requested use of it.

Change store/index deletion to take place in order with other
requests, so do all the work (in-memory and backing store) during the
scheduled operation, rather than on IPC receipt. Also change
store/index creation to do all the work (in-memory and backing store)
synchronously, since index population is already preemptively done.

And since this requires shuffling when the "abort" operations should
be queued, rework the API there slightly.

BUG=370056,368271, 362723
R=cmumford@chromium.org,ericu@chromium.org

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@272282 0039d316-1c4b-4281-b951-d872f2087c98
content/browser/indexed_db/indexed_db_database.cc
content/browser/indexed_db/indexed_db_database.h
content/browser/indexed_db/indexed_db_database_unittest.cc
content/browser/indexed_db/indexed_db_fake_backing_store.cc
content/browser/indexed_db/indexed_db_fake_backing_store.h
content/browser/indexed_db/indexed_db_transaction.cc
content/browser/indexed_db/indexed_db_transaction.h
content/browser/indexed_db/indexed_db_transaction_unittest.cc
content/browser/indexed_db/mock_indexed_db_callbacks.cc
content/browser/indexed_db/mock_indexed_db_callbacks.h