The default bug view has changed. See this FAQ.

IndexedDB: Implement optional version syntax.

RESOLVED FIXED

Status

()

Core
DOM: IndexedDB
RESOLVED FIXED
6 years ago
a year ago

People

(Reporter: khuey, Assigned: khuey)

Tracking

({dev-doc-complete})

unspecified
dev-doc-complete
Points:
---
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

4.60 KB, patch
Ben Turner (not reading bugmail, use the needinfo flag!)
: review+
Details | Diff | Splinter Review
Created attachment 570711 [details] [diff] [review]
Patch
Attachment #570711 - Flags: review?(bent.mozilla)
The tests here look a bit lacking. Is it really testing that opening an existing database opens it with the database's existing version and objectStores, and that if there exists no database, a new one is created with version 1?
It's not testing anything with objectStores, but it is testing the version bits.

Adding more tests isn't hard.
Comment on attachment 570711 [details] [diff] [review]
Patch

Review of attachment 570711 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/indexedDB/IDBFactory.cpp
@@ +380,5 @@
>  NS_IMETHODIMP
>  IDBFactory::Open(const nsAString& aName,
>                   PRInt64 aVersion,
>                   JSContext* aCx,
> +                 PRUint8 aArgc,

Nit: This isn't argc, it's the number of optional args passed. Call it 'aOptionalArgCount'

::: dom/indexedDB/OpenDatabaseHelper.cpp
@@ +753,5 @@
> +    // treat it as if version 1 were requested.
> +    if (mCurrentVersion == 0) {
> +      mRequestedVersion = 1;
> +    }
> +    // Otherwise, treat it as if the current version were requested.

Nit: move this comment inside the else block.

::: dom/indexedDB/nsIIDBFactory.idl
@@ +56,2 @@
>    nsIIDBOpenDBRequest
> +  open(in AString name, [optional] in long long version);

Nit: Each arg gets its own line.
Attachment #570711 - Flags: review?(bent.mozilla) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/80af665378fd
Flags: in-testsuite+
Target Milestone: --- → mozilla10
https://hg.mozilla.org/mozilla-central/rev/80af665378fd
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Keywords: dev-doc-needed
Component: DOM → DOM: IndexedDB
Target Milestone: mozilla10 → ---
Already documented, see

https://developer.mozilla.org/en-US/docs/Web/API/IDBFactory/open

note added to 

https://developer.mozilla.org/en-US/Firefox/Releases/10#IndexedDB
Keywords: dev-doc-needed → dev-doc-complete
You need to log in before you can comment on or make changes to this bug.