Bug 758497: Mimic [EnforceRange] for cursor.advance until we get new WebIDL bindings. r=sicking
authorKyle Huey <khuey@kylehuey.com>
Fri, 29 Jun 2012 09:48:34 -0700
changeset 97921 333849115ee218b202f8c05534804113efa02c47
parent 97920 939191463ed488cfadc032a4fb57e2d28eaf2dfe
child 97922 5424f28013c674fe90a3cdd87459b9ff2c57adf3
push id23010
push userkhuey@mozilla.com
push dateFri, 29 Jun 2012 17:39:48 +0000
treeherdermozilla-central@027b86239bf3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssicking
bugs758497
milestone16.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 758497: Mimic [EnforceRange] for cursor.advance until we get new WebIDL bindings. r=sicking
dom/indexedDB/IDBCursor.cpp
dom/indexedDB/nsIIDBCursor.idl
--- a/dom/indexedDB/IDBCursor.cpp
+++ b/dom/indexedDB/IDBCursor.cpp
@@ -740,21 +740,21 @@ IDBCursor::Delete(JSContext* aCx,
   jsval key;
   nsresult rv = objectKey.ToJSVal(aCx, &key);
   NS_ENSURE_SUCCESS(rv, rv);
 
   return mObjectStore->Delete(key, aCx, _retval);
 }
 
 NS_IMETHODIMP
-IDBCursor::Advance(PRInt32 aCount)
+IDBCursor::Advance(PRInt64 aCount)
 {
   NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
 
-  if (aCount < 1) {
+  if (aCount < 1 || aCount > PR_UINT32_MAX) {
     return NS_ERROR_TYPE_ERR;
   }
 
   Key key;
   return ContinueInternal(key, aCount);
 }
 
 void
--- a/dom/indexedDB/nsIIDBCursor.idl
+++ b/dom/indexedDB/nsIIDBCursor.idl
@@ -8,17 +8,17 @@
 
 interface nsIIDBRequest;
 
 /**
  * IDBCursor interface.  See
  * http://dev.w3.org/2006/webapi/WebSimpleDB/#idl-def-IDBCursor for more
  * information.
  */
-[scriptable, builtinclass, uuid(01136b3a-d84c-487c-b929-f5d012346c44)]
+[scriptable, builtinclass, uuid(148579a3-6b28-4b2a-92c3-ff5719e8e03e)]
 interface nsIIDBCursor : nsISupports
 {
   // "next", "nextunique", "prev" or "prevunique"
   readonly attribute DOMString direction;
 
   readonly attribute nsISupports source;
 
   [implicit_jscontext]
@@ -36,10 +36,10 @@ interface nsIIDBCursor : nsISupports
   [implicit_jscontext]
   nsIIDBRequest update(in jsval value);
 
   // Success fires IDBTransactionEvent, result == null
   [implicit_jscontext]
   nsIIDBRequest delete();
 
   void
-  advance(in long count);
+  advance(in long long count);
 };