Bug 90995 - IndexedDB: Verify internal "delete pending" flag on database
Summary: IndexedDB: Verify internal "delete pending" flag on database
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Joshua Bell
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-11 11:23 PDT by Joshua Bell
Modified: 2012-07-12 10:11 PDT (History)
4 users (show)

See Also:


Attachments
Patch (7.10 KB, patch)
2012-07-11 15:58 PDT, Joshua Bell
no flags Details | Formatted Diff | Diff
Patch (7.08 KB, patch)
2012-07-11 16:58 PDT, Joshua Bell
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joshua Bell 2012-07-11 11:23:20 PDT
The IDB spec http://dvcs.w3.org/hg/IndexedDB/raw-file/tip/Overview.html says:

Databases has a delete pending flag which is used during deletion. When a database is requested to be deleted the flag is set to true and all attempts at opening the database are stalled until the database can be deleted.

This implies that calls open following delete should succeed, yielding a new database with the same name as the old one. Note that a delete may be delayed arbitrarily. We do queue up open calls after deletes, but it's unclear from code inspection what the open() call actually gets - pointer to the same IDBDatabaseBackendImpl object? A reset version? Is the backing store reference retained or dropped?
Comment 1 Joshua Bell 2012-07-11 15:58:29 PDT
Created attachment 151809 [details]
Patch
Comment 2 Joshua Bell 2012-07-11 16:00:34 PDT
Turns out we already have the correct behavior here, so just adding a specific test for this.

dgrogan@, alecflett@ - how's it look?
Comment 3 Alec Flett 2012-07-11 16:15:06 PDT
Comment on attachment 151809 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=151809&action=review

> LayoutTests/storage/indexeddb/resources/database-deletepending-flag.js:33
> +            shouldBe("String(connection.version)", "String(version)");

Why the "String()" ?

Other than that, LGTM
Comment 4 Joshua Bell 2012-07-11 16:19:23 PDT
Comment on attachment 151809 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=151809&action=review

>> LayoutTests/storage/indexeddb/resources/database-deletepending-flag.js:33
>> +            shouldBe("String(connection.version)", "String(version)");
> 
> Why the "String()" ?
> 
> Other than that, LGTM

I was being clever and had version be a number, but IDBDatabase.version will currently give back a string; I could do version = '10' instead and we can update this with all of the other tests.
Comment 5 Joshua Bell 2012-07-11 16:58:38 PDT
Created attachment 151815 [details]
Patch
Comment 6 Joshua Bell 2012-07-11 16:58:57 PDT
tony@ - r?
Comment 7 WebKit Review Bot 2012-07-12 10:11:02 PDT
Comment on attachment 151815 [details]
Patch

Clearing flags on attachment: 151815

Committed r122475: <http://trac.webkit.org/changeset/122475>
Comment 8 WebKit Review Bot 2012-07-12 10:11:15 PDT
All reviewed patches have been landed.  Closing bug.