Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(772)

Side by Side Diff: third_party/WebKit/LayoutTests/imported/wpt/IndexedDB/interfaces.idl

Issue 2517743002: Import wpt@5a1f188e0536ad023936cc62f9a00617299dc192 (Closed)
Patch Set: rebased Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 enum IDBTransactionMode { 1 [Exposed=(Window,Worker)]
2 "readonly", 2 interface IDBRequest : EventTarget {
3 "readwrite", 3 readonly attribute any result;
4 "versionchange" 4 readonly attribute DOMException? error;
5 readonly attribute (IDBObjectStore or IDBIndex or IDBCursor)? source;
6 readonly attribute IDBTransaction? transaction;
7 readonly attribute IDBRequestReadyState readyState;
8
9 // Event handlers:
10 attribute EventHandler onsuccess;
11 attribute EventHandler onerror;
5 }; 12 };
6 13
7 enum IDBRequestReadyState { 14 enum IDBRequestReadyState {
8 "pending", 15 "pending",
9 "done" 16 "done"
10 };
11
12 [Exposed=(Window,Worker)]
13 interface IDBKeyRange {
14 readonly attribute any lower;
15 readonly attribute any upper;
16 readonly attribute boolean lowerOpen;
17 readonly attribute boolean upperOpen;
18 static IDBKeyRange only (any value);
19 static IDBKeyRange lowerBound (any lower, optional boolean open = false);
20 static IDBKeyRange upperBound (any upper, optional boolean open = false);
21 static IDBKeyRange bound (any lower, any upper, optional boolean lowerOpen = false, optional boolean upperOpen = false);
22 };
23
24 enum IDBCursorDirection {
25 "next",
26 "nextunique",
27 "prev",
28 "prevunique"
29 };
30
31 dictionary IDBObjectStoreParameters {
32 (DOMString or sequence<DOMString>)? keyPath = null;
33 boolean autoIncrement = false;
34 };
35
36 dictionary IDBIndexParameters {
37 boolean unique = false;
38 boolean multiEntry = false;
39 };
40
41 dictionary IDBVersionChangeEventInit : EventInit {
42 unsigned long long oldVersion = 0;
43 unsigned long long? newVersion = null;
44 };
45
46 [Exposed=(Window,Worker)]
47 interface IDBRequest : EventTarget {
48 readonly attribute any result;
49 readonly attribute DOMError error;
50 readonly attribute (IDBObjectStore or IDBIndex or IDBCursor)? source;
51 readonly attribute IDBTransaction transaction ;
52 readonly attribute IDBRequestReadyState readyState;
53 attribute EventHandler onsuccess;
54 attribute EventHandler onerror;
55 }; 17 };
56 18
57 [Exposed=(Window,Worker)] 19 [Exposed=(Window,Worker)]
58 interface IDBOpenDBRequest : IDBRequest { 20 interface IDBOpenDBRequest : IDBRequest {
59 attribute EventHandler onblocked; 21 // Event handlers:
60 attribute EventHandler onupgradeneeded; 22 attribute EventHandler onblocked;
23 attribute EventHandler onupgradeneeded;
61 }; 24 };
62 25
63 [Exposed=(Window,Worker), 26 [Exposed=(Window,Worker),
64 Constructor(DOMString type, optional IDBVersionChangeEventInit eventInitDict)] 27 Constructor(DOMString type, optional IDBVersionChangeEventInit eventInitDict)]
65 interface IDBVersionChangeEvent : Event { 28 interface IDBVersionChangeEvent : Event {
66 readonly attribute unsigned long long oldVersion; 29 readonly attribute unsigned long long oldVersion;
67 readonly attribute unsigned long long? newVersion; 30 readonly attribute unsigned long long? newVersion;
68 }; 31 };
69 32
70 [NoInterfaceObject] 33 dictionary IDBVersionChangeEventInit : EventInit {
71 interface IDBEnvironment { 34 unsigned long long oldVersion = 0;
72 readonly attribute IDBFactory indexedDB; 35 unsigned long long? newVersion = null;
36 };
37
38 partial interface WindowOrWorkerGlobalScope {
39 [SameObject] readonly attribute IDBFactory indexedDB;
73 }; 40 };
74 41
75 [Exposed=(Window,Worker)] 42 [Exposed=(Window,Worker)]
76 interface IDBFactory { 43 interface IDBFactory {
77 IDBOpenDBRequest open (DOMString name, [EnforceRange] optional unsigned long long version); 44 IDBOpenDBRequest open(DOMString name,
78 IDBOpenDBRequest deleteDatabase (DOMString name); 45 [EnforceRange] optional unsigned long long version);
79 short cmp (any first, any second); 46 IDBOpenDBRequest deleteDatabase(DOMString name);
47
48 short cmp(any first, any second);
80 }; 49 };
81 50
82 [Exposed=(Window,Worker)] 51 [Exposed=(Window,Worker)]
83 interface IDBDatabase : EventTarget { 52 interface IDBDatabase : EventTarget {
84 readonly attribute DOMString name; 53 readonly attribute DOMString name;
85 readonly attribute unsigned long long version; 54 readonly attribute unsigned long long version;
86 readonly attribute DOMStringList objectStoreNames; 55 readonly attribute DOMStringList objectStoreNames;
87 IDBObjectStore createObjectStore (DOMString name, optional IDBObjectStorePar ameters optionalParameters); 56
88 void deleteObjectStore (DOMString name); 57 IDBTransaction transaction((DOMString or sequence<DOMString>) storeNames,
89 IDBTransaction transaction ((DOMString or sequence<DOMString>) storeNames, o ptional IDBTransactionMode mode = "readonly"); 58 optional IDBTransactionMode mode = "readonly");
90 void close (); 59 void close();
91 attribute EventHandler onabort; 60
92 attribute EventHandler onclose; 61 IDBObjectStore createObjectStore(DOMString name,
93 attribute EventHandler onerror; 62 optional IDBObjectStoreParameters options);
94 attribute EventHandler onversionchange; 63 void deleteObjectStore(DOMString name);
64
65 // Event handlers:
66 attribute EventHandler onabort;
67 attribute EventHandler onclose;
68 attribute EventHandler onerror;
69 attribute EventHandler onversionchange;
70 };
71
72 dictionary IDBObjectStoreParameters {
73 (DOMString or sequence<DOMString>)? keyPath = null;
74 boolean autoIncrement = false;
95 }; 75 };
96 76
97 [Exposed=(Window,Worker)] 77 [Exposed=(Window,Worker)]
98 interface IDBObjectStore { 78 interface IDBObjectStore {
99 attribute DOMString name; 79 attribute DOMString name;
100 readonly attribute any keyPath; 80 readonly attribute any keyPath;
101 readonly attribute DOMStringList indexNames; 81 readonly attribute DOMStringList indexNames;
102 readonly attribute IDBTransaction transaction; 82 readonly attribute IDBTransaction transaction;
103 readonly attribute boolean autoIncrement; 83 readonly attribute boolean autoIncrement;
104 IDBRequest put (any value, optional any key); 84
105 IDBRequest add (any value, optional any key); 85 IDBRequest put(any value, optional any key);
106 IDBRequest delete (any key); 86 IDBRequest add(any value, optional any key);
107 IDBRequest get (any key); 87 IDBRequest delete(any query);
108 IDBRequest clear (); 88 IDBRequest clear();
109 IDBRequest openCursor (optional any range, optional IDBCursorDirection direc tion = "next"); 89 IDBRequest get(any query);
110 IDBIndex createIndex (DOMString name, (DOMString or sequence<DOMString>) k eyPath, optional IDBIndexParameters optionalParameters); 90 IDBRequest getKey(any query);
111 IDBIndex index (DOMString name); 91 IDBRequest getAll(optional any query,
112 void deleteIndex (DOMString indexName); 92 [EnforceRange] optional unsigned long count);
113 IDBRequest count (optional any key); 93 IDBRequest getAllKeys(optional any query,
94 [EnforceRange] optional unsigned long count);
95 IDBRequest count(optional any query);
96
97 IDBRequest openCursor(optional any query,
98 optional IDBCursorDirection direction = "next");
99 IDBRequest openKeyCursor(optional any query,
100 optional IDBCursorDirection direction = "next");
101
102 IDBIndex index(DOMString name);
103
104 IDBIndex createIndex(DOMString name,
105 (DOMString or sequence<DOMString>) keyPath,
106 optional IDBIndexParameters options);
107 void deleteIndex(DOMString indexName);
108 };
109
110 dictionary IDBIndexParameters {
111 boolean unique = false;
112 boolean multiEntry = false;
114 }; 113 };
115 114
116 [Exposed=(Window,Worker)] 115 [Exposed=(Window,Worker)]
117 interface IDBIndex { 116 interface IDBIndex {
118 attribute DOMString name; 117 attribute DOMString name;
119 readonly attribute IDBObjectStore objectStore; 118 readonly attribute IDBObjectStore objectStore;
120 readonly attribute any keyPath; 119 readonly attribute any keyPath;
121 readonly attribute boolean multiEntry; 120 readonly attribute boolean multiEntry;
122 readonly attribute boolean unique; 121 readonly attribute boolean unique;
123 IDBRequest openCursor (optional any range, optional IDBCursorDirection direc tion = "next"); 122
124 IDBRequest openKeyCursor (optional any range, optional IDBCursorDirection di rection = "next"); 123 IDBRequest get(any query);
125 IDBRequest get (any key); 124 IDBRequest getKey(any query);
126 IDBRequest getKey (any key); 125 IDBRequest getAll(optional any query,
127 IDBRequest count (optional any key); 126 [EnforceRange] optional unsigned long count);
127 IDBRequest getAllKeys(optional any query,
128 [EnforceRange] optional unsigned long count);
129 IDBRequest count(optional any query);
130
131 IDBRequest openCursor(optional any query,
132 optional IDBCursorDirection direction = "next");
133 IDBRequest openKeyCursor(optional any query,
134 optional IDBCursorDirection direction = "next");
135 };
136
137 [Exposed=(Window,Worker)]
138 interface IDBKeyRange {
139 readonly attribute any lower;
140 readonly attribute any upper;
141 readonly attribute boolean lowerOpen;
142 readonly attribute boolean upperOpen;
143
144 // Static construction methods:
145 static IDBKeyRange only(any value);
146 static IDBKeyRange lowerBound(any lower, optional boolean open = false);
147 static IDBKeyRange upperBound(any upper, optional boolean open = false);
148 static IDBKeyRange bound(any lower,
149 any upper,
150 optional boolean lowerOpen = false,
151 optional boolean upperOpen = false);
152
153 boolean includes(any key);
128 }; 154 };
129 155
130 [Exposed=(Window,Worker)] 156 [Exposed=(Window,Worker)]
131 interface IDBCursor { 157 interface IDBCursor {
132 readonly attribute (IDBObjectStore or IDBIndex) source; 158 readonly attribute (IDBObjectStore or IDBIndex) source;
133 readonly attribute IDBCursorDirection direction; 159 readonly attribute IDBCursorDirection direction;
134 readonly attribute any key; 160 readonly attribute any key;
135 readonly attribute any primaryKey; 161 readonly attribute any primaryKey;
136 IDBRequest update (any value); 162
137 void advance ([EnforceRange] unsigned long count); 163 void advance([EnforceRange] unsigned long count);
138 void continue (optional any key); 164 void continue(optional any key);
139 IDBRequest delete (); 165 void continuePrimaryKey(any key, any primaryKey);
166
167 IDBRequest update(any value);
168 IDBRequest delete();
169 };
170
171 enum IDBCursorDirection {
172 "next",
173 "nextunique",
174 "prev",
175 "prevunique"
140 }; 176 };
141 177
142 [Exposed=(Window,Worker)] 178 [Exposed=(Window,Worker)]
143 interface IDBCursorWithValue : IDBCursor { 179 interface IDBCursorWithValue : IDBCursor {
144 readonly attribute any value; 180 readonly attribute any value;
145 }; 181 };
146 182
147 [Exposed=(Window,Worker)] 183 [Exposed=(Window,Worker)]
148 interface IDBTransaction : EventTarget { 184 interface IDBTransaction : EventTarget {
149 readonly attribute IDBTransactionMode mode; 185 readonly attribute DOMStringList objectStoreNames;
150 readonly attribute IDBDatabase db; 186 readonly attribute IDBTransactionMode mode;
151 readonly attribute DOMError error; 187 readonly attribute IDBDatabase db;
152 IDBObjectStore objectStore (DOMString name); 188 readonly attribute DOMException error;
153 void abort (); 189
154 attribute EventHandler onabort; 190 IDBObjectStore objectStore(DOMString name);
155 attribute EventHandler oncomplete; 191 void abort();
156 attribute EventHandler onerror; 192
157 }; 193 // Event handlers:
194 attribute EventHandler onabort;
195 attribute EventHandler oncomplete;
196 attribute EventHandler onerror;
197 };
198
199 enum IDBTransactionMode {
200 "readonly",
201 "readwrite",
202 "versionchange"
203 };
204
205 interface DOMStringList {
206 readonly attribute unsigned long length;
207 getter DOMString (unsigned long index);
208 DOMString? item(unsigned long index);
209
210 boolean contains(DOMString str);
211 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698