Closed Bug 618141 Opened 9 years ago Closed 9 years ago

IndexedDB: createObjectStore and createIndex should accept an optional object argument

Categories

(Core :: Storage: IndexedDB, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
Tracking Status
blocking2.0 --- betaN+

People

(Reporter: bent.mozilla, Assigned: bent.mozilla)

Details

Attachments

(1 file, 3 obsolete files)

The spec is being updated to make optional args on createObjectStore and createIndex properties of an optional JS object instead.
This is part of the last set of IndexedDB bugs we've deemed necessary in order to ship 2.0, blocking beta9.
blocking2.0: ? → beta9+
Attached patch Patch, v1 (obsolete) — Splinter Review
Test changes will follow.
Attachment #497516 - Flags: review?(jonas)
Attached patch Patch, v1.1 (obsolete) — Splinter Review
Now includes tests.
Attachment #497516 - Attachment is obsolete: true
Attachment #497606 - Flags: review?(jonas)
Attachment #497516 - Flags: review?(jonas)
Attached patch Patch, v1.2 (obsolete) — Splinter Review
Now throws for unrecognized properties, as well.
Attachment #497606 - Attachment is obsolete: true
Attachment #498209 - Flags: review?(jonas)
Attachment #497606 - Flags: review?(jonas)
Comment on attachment 498209 [details] [diff] [review]
Patch, v1.2

>+    for (size_t index = 0; index < ids.length(); index++) {
>+      jsid id = ids[index];
>+
>+      jsval val;
>+      JSString* str;
>+      if (!JS_IdToValue(aCx, id, &val) ||
>+          !(str = JS_ValueToString(aCx, val)) ||
>+          !JS_GetPropertyById(aCx, options, id, &val)) {
>+        return NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR;
>+      }

Just intern "keyPath" and "autoIncrement". That way you don't have to do id->string conversion and you can turn the string comparisons into id comparisons below.

r=me with that
Attachment #498209 - Flags: review?(jonas) → review+
Attached patch Patch, v1.3Splinter Review
Think it's ok to expose nsDOMClassInfo statics like this?
Attachment #498209 - Attachment is obsolete: true
Attachment #498658 - Flags: review?(jonas)
Comment on attachment 498658 [details] [diff] [review]
Patch, v1.3

I think it's fine to expose the statics like that. Another solution would be to create a separate class like we do for nsGkAtoms etc.

r=me
Attachment #498658 - Flags: review?(jonas) → review+
http://hg.mozilla.org/mozilla-central/rev/2d71a4dfb17b
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
As per today's meeting, beta 9 will be a time-based release. Marking these all betaN+. Please move it back to beta9+ if you believe it MUST be in the next beta (ie: trunk is in an unshippable state without this)
blocking2.0: beta9+ → betaN+
Component: DOM → DOM: IndexedDB
Version: Trunk → unspecified
You need to log in before you can comment on or make changes to this bug.