Last Comment Bug 698440 - IndexedDB: Implement optional version syntax.
: IndexedDB: Implement optional version syntax.
Status: RESOLVED FIXED
: dev-doc-complete
Product: Core
Classification: Components
Component: DOM: IndexedDB (show other bugs)
: unspecified
: All All
: -- normal (vote)
: ---
Assigned To: Kyle Huey [:khuey] (khuey@mozilla.com)
:
Mentors:
Depends on:
Blocks: idb
  Show dependency treegraph
 
Reported: 2011-10-31 08:15 PDT by Kyle Huey [:khuey] (khuey@mozilla.com)
Modified: 2015-12-01 01:53 PST (History)
6 users (show)
khuey: in‑testsuite+
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Patch (4.60 KB, patch)
2011-10-31 08:15 PDT, Kyle Huey [:khuey] (khuey@mozilla.com)
bent.mozilla: review+
Details | Diff | Splinter Review

Description Kyle Huey [:khuey] (khuey@mozilla.com) 2011-10-31 08:15:54 PDT
Created attachment 570711 [details] [diff] [review]
Patch
Comment 1 Jonas Sicking (:sicking) PTO Until July 5th 2011-10-31 09:37:52 PDT
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?
Comment 2 Kyle Huey [:khuey] (khuey@mozilla.com) 2011-10-31 09:39:08 PDT
It's not testing anything with objectStores, but it is testing the version bits.

Adding more tests isn't hard.
Comment 3 Ben Turner (not reading bugmail, use the needinfo flag!) 2011-11-01 14:25:37 PDT
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.
Comment 4 Kyle Huey [:khuey] (khuey@mozilla.com) 2011-11-02 05:56:14 PDT
https://hg.mozilla.org/integration/mozilla-inbound/rev/80af665378fd
Comment 5 Marco Bonardo [::mak] 2011-11-03 08:20:36 PDT
https://hg.mozilla.org/mozilla-central/rev/80af665378fd
Comment 6 Chris Mills (Mozilla, MDN editor) [:cmills] 2015-12-01 01:53:19 PST
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

Note You need to log in before you can comment on or make changes to this bug.