Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / modules / indexeddb / IDBObjectStore.idl
index 9f7a6b6..2afdfe4 100644 (file)
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+// https://dvcs.w3.org/hg/IndexedDB/raw-file/default/Overview.html#idl-def-IDBObjectStore
+
+// FIXME: de-duplicate this when crbug.com/390758 is fixed.
+enum IDBCursorDirection {
+    "next",
+    "nextunique",
+    "prev",
+    "prevunique"
+};
+
 [
+    GarbageCollected,
 ] interface IDBObjectStore {
-    [TreatReturnedNullStringAs=Null] readonly attribute DOMString name;
-    [ImplementedAs=keyPathAny] readonly attribute IDBAny keyPath;
+    readonly attribute DOMString? name;
+    [CallWith=ScriptState] readonly attribute any keyPath;
     readonly attribute DOMStringList indexNames;
     readonly attribute IDBTransaction transaction;
     readonly attribute boolean autoIncrement;
 
     [CallWith=ScriptState, RaisesException] IDBRequest put(any value, [Default=Undefined] optional any key);
     [CallWith=ScriptState, RaisesException] IDBRequest add(any value, [Default=Undefined] optional any key);
-    [CallWith=ExecutionContext, ImplementedAs=deleteFunction, RaisesException] IDBRequest delete(any key);
-    [CallWith=ExecutionContext, RaisesException] IDBRequest clear();
-    [CallWith=ExecutionContext, RaisesException] IDBRequest get(any key);
-    [CallWith=ExecutionContext, RaisesException] IDBRequest openCursor([Default=Undefined] optional any range, [Default=NullString] optional DOMString direction);
-    [CallWith=ExecutionContext, RaisesException, RuntimeEnabled=IndexedDBExperimental] IDBRequest openKeyCursor([Default=Undefined] optional any range, [Default=NullString] optional DOMString direction);
-
-    [CallWith=ExecutionContext, RaisesException] IDBIndex createIndex(DOMString name, sequence<DOMString> keyPath, optional Dictionary options);
-    [CallWith=ExecutionContext, RaisesException] IDBIndex createIndex(DOMString name, DOMString keyPath, optional Dictionary options);
+    [CallWith=ScriptState, ImplementedAs=deleteFunction, RaisesException] IDBRequest delete(any key);
+    [CallWith=ScriptState, RaisesException] IDBRequest get(any key);
+    [CallWith=ScriptState, RaisesException] IDBRequest clear();
+    [CallWith=ScriptState, RaisesException] IDBRequest openCursor([Default=Undefined] optional any range, optional DOMString direction = "next");
+    [CallWith=ScriptState, RaisesException, RuntimeEnabled=IndexedDBExperimental] IDBRequest openKeyCursor([Default=Undefined] optional any range, optional IDBCursorDirection direction = "next");
+    // FIXME: should be union type http://crbug.com/240176
+    [CallWith=ScriptState, RaisesException] IDBIndex createIndex(DOMString name, DOMString keyPath, optional IDBIndexParameters options);
+    [CallWith=ScriptState, RaisesException] IDBIndex createIndex(DOMString name, sequence<DOMString> keyPath, optional IDBIndexParameters options);
     [RaisesException] IDBIndex index(DOMString name);
     [RaisesException] void deleteIndex(DOMString name);
-    [CallWith=ExecutionContext, RaisesException] IDBRequest count([Default=Undefined] optional any key);
+    [CallWith=ScriptState, RaisesException] IDBRequest count([Default=Undefined] optional any key);
 };