• jsbell@chromium.org's avatar
    IndexedDB: Prevent store/index deletion from racing ahead of use · 12c33772
    jsbell@chromium.org authored
    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
    12c33772
indexed_db_database_unittest.cc 13.9 KB