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

Side by Side Diff: sdk/lib/web_sql/dartium/web_sql_dartium.dart

Issue 1173403004: Changed to use JSInterop (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Re-gen'd somehow diffs stopped showing up in CL Created 5 years, 5 months 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
« no previous file with comments | « sdk/lib/web_gl/dartium/web_gl_dartium.dart ('k') | tools/dom/scripts/css_code_generator.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /** 1 /**
2 * An API for storing data in the browser that can be queried with SQL. 2 * An API for storing data in the browser that can be queried with SQL.
3 * 3 *
4 * **Caution:** this specification is no longer actively maintained by the Web 4 * **Caution:** this specification is no longer actively maintained by the Web
5 * Applications Working Group and may be removed at any time. 5 * Applications Working Group and may be removed at any time.
6 * See [the W3C Web SQL Database specification](http://www.w3.org/TR/webdatabase /) 6 * See [the W3C Web SQL Database specification](http://www.w3.org/TR/webdatabase /)
7 * for more information. 7 * for more information.
8 * 8 *
9 * The [dart:indexed_db] APIs is a recommended alternatives. 9 * The [dart:indexed_db] APIs is a recommended alternatives.
10 */ 10 */
(...skipping 15 matching lines...) Expand all
26 26
27 // FIXME: Can we make this private? 27 // FIXME: Can we make this private?
28 final web_sqlBlinkMap = { 28 final web_sqlBlinkMap = {
29 'Database': () => SqlDatabase, 29 'Database': () => SqlDatabase,
30 'SQLError': () => SqlError, 30 'SQLError': () => SqlError,
31 'SQLResultSet': () => SqlResultSet, 31 'SQLResultSet': () => SqlResultSet,
32 'SQLResultSetRowList': () => SqlResultSetRowList, 32 'SQLResultSetRowList': () => SqlResultSetRowList,
33 'SQLTransaction': () => SqlTransaction, 33 'SQLTransaction': () => SqlTransaction,
34 34
35 }; 35 };
36
36 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 37 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
37 // for details. All rights reserved. Use of this source code is governed by a 38 // for details. All rights reserved. Use of this source code is governed by a
38 // BSD-style license that can be found in the LICENSE file. 39 // BSD-style license that can be found in the LICENSE file.
39 40
40 // WARNING: Do not edit - generated code. 41 // WARNING: Do not edit - generated code.
41 42
42 43
43 @DomName('SQLStatementCallback') 44 @DomName('SQLStatementCallback')
44 // http://www.w3.org/TR/webdatabase/#sqlstatementcallback 45 // http://www.w3.org/TR/webdatabase/#sqlstatementcallback
45 @Experimental() // deprecated 46 @Experimental() // deprecated
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 @DomName('Database') 89 @DomName('Database')
89 @SupportedBrowser(SupportedBrowser.CHROME) 90 @SupportedBrowser(SupportedBrowser.CHROME)
90 @SupportedBrowser(SupportedBrowser.SAFARI) 91 @SupportedBrowser(SupportedBrowser.SAFARI)
91 @Experimental() 92 @Experimental()
92 // http://www.w3.org/TR/webdatabase/#asynchronous-database-api 93 // http://www.w3.org/TR/webdatabase/#asynchronous-database-api
93 @Experimental() // deprecated 94 @Experimental() // deprecated
94 class SqlDatabase extends NativeFieldWrapperClass2 { 95 class SqlDatabase extends NativeFieldWrapperClass2 {
95 // To suppress missing implicit constructor warnings. 96 // To suppress missing implicit constructor warnings.
96 factory SqlDatabase._() { throw new UnsupportedError("Not supported"); } 97 factory SqlDatabase._() { throw new UnsupportedError("Not supported"); }
97 98
99 static SqlDatabase internalCreateSqlDatabase() {
100 return new SqlDatabase._internalWrap();
101 }
102
103 JsObject blink_jsObject = null;
104
105 factory SqlDatabase._internalWrap() {
106 return new SqlDatabase._internal();
107 }
108
109 SqlDatabase._internal() { }
110
111 bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical( this, other);
112
98 /// Checks if this type is supported on the current platform. 113 /// Checks if this type is supported on the current platform.
99 static bool get supported => true; 114 static bool get supported => true;
100 115
101 @DomName('Database.version') 116 @DomName('Database.version')
102 @DocsEditable() 117 @DocsEditable()
103 String get version => _blink.BlinkDatabase.instance.version_Getter_(this); 118 String get version => _blink.BlinkDatabase.instance.version_Getter_(unwrap_jso (this));
104 119
105 void changeVersion(String oldVersion, String newVersion, [SqlTransactionCallba ck callback, SqlTransactionErrorCallback errorCallback, VoidCallback successCall back]) { 120 void changeVersion(String oldVersion, String newVersion, [SqlTransactionCallba ck callback, SqlTransactionErrorCallback errorCallback, VoidCallback successCall back]) {
106 if (successCallback != null) { 121 if (successCallback != null) {
107 _blink.BlinkDatabase.instance.changeVersion_Callback_5_(this, oldVersion, newVersion, callback, errorCallback, successCallback); 122 _blink.BlinkDatabase.instance.changeVersion_Callback_5_(unwrap_jso(this), oldVersion, newVersion, unwrap_jso(callback), unwrap_jso(errorCallback), unwrap_ jso(successCallback));
108 return; 123 return;
109 } 124 }
110 if (errorCallback != null) { 125 if (errorCallback != null) {
111 _blink.BlinkDatabase.instance.changeVersion_Callback_4_(this, oldVersion, newVersion, callback, errorCallback); 126 _blink.BlinkDatabase.instance.changeVersion_Callback_4_(unwrap_jso(this), oldVersion, newVersion, unwrap_jso(callback), unwrap_jso(errorCallback));
112 return; 127 return;
113 } 128 }
114 if (callback != null) { 129 if (callback != null) {
115 _blink.BlinkDatabase.instance.changeVersion_Callback_3_(this, oldVersion, newVersion, callback); 130 _blink.BlinkDatabase.instance.changeVersion_Callback_3_(unwrap_jso(this), oldVersion, newVersion, unwrap_jso(callback));
116 return; 131 return;
117 } 132 }
118 _blink.BlinkDatabase.instance.changeVersion_Callback_2_(this, oldVersion, ne wVersion); 133 _blink.BlinkDatabase.instance.changeVersion_Callback_2_(unwrap_jso(this), ol dVersion, newVersion);
119 return; 134 return;
120 } 135 }
121 136
122 void readTransaction(SqlTransactionCallback callback, [SqlTransactionErrorCall back errorCallback, VoidCallback successCallback]) { 137 void readTransaction(SqlTransactionCallback callback, [SqlTransactionErrorCall back errorCallback, VoidCallback successCallback]) {
123 if (successCallback != null) { 138 if (successCallback != null) {
124 _blink.BlinkDatabase.instance.readTransaction_Callback_3_(this, callback, errorCallback, successCallback); 139 _blink.BlinkDatabase.instance.readTransaction_Callback_3_(unwrap_jso(this) , unwrap_jso(callback), unwrap_jso(errorCallback), unwrap_jso(successCallback));
125 return; 140 return;
126 } 141 }
127 if (errorCallback != null) { 142 if (errorCallback != null) {
128 _blink.BlinkDatabase.instance.readTransaction_Callback_2_(this, callback, errorCallback); 143 _blink.BlinkDatabase.instance.readTransaction_Callback_2_(unwrap_jso(this) , unwrap_jso(callback), unwrap_jso(errorCallback));
129 return; 144 return;
130 } 145 }
131 _blink.BlinkDatabase.instance.readTransaction_Callback_1_(this, callback); 146 _blink.BlinkDatabase.instance.readTransaction_Callback_1_(unwrap_jso(this), unwrap_jso(callback));
132 return; 147 return;
133 } 148 }
134 149
135 void transaction(SqlTransactionCallback callback, [SqlTransactionErrorCallback errorCallback, VoidCallback successCallback]) { 150 void transaction(SqlTransactionCallback callback, [SqlTransactionErrorCallback errorCallback, VoidCallback successCallback]) {
136 if (successCallback != null) { 151 if (successCallback != null) {
137 _blink.BlinkDatabase.instance.transaction_Callback_3_(this, callback, erro rCallback, successCallback); 152 _blink.BlinkDatabase.instance.transaction_Callback_3_(unwrap_jso(this), un wrap_jso(callback), unwrap_jso(errorCallback), unwrap_jso(successCallback));
138 return; 153 return;
139 } 154 }
140 if (errorCallback != null) { 155 if (errorCallback != null) {
141 _blink.BlinkDatabase.instance.transaction_Callback_2_(this, callback, erro rCallback); 156 _blink.BlinkDatabase.instance.transaction_Callback_2_(unwrap_jso(this), un wrap_jso(callback), unwrap_jso(errorCallback));
142 return; 157 return;
143 } 158 }
144 _blink.BlinkDatabase.instance.transaction_Callback_1_(this, callback); 159 _blink.BlinkDatabase.instance.transaction_Callback_1_(unwrap_jso(this), unwr ap_jso(callback));
145 return; 160 return;
146 } 161 }
147 162
148 } 163 }
149 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 164 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
150 // for details. All rights reserved. Use of this source code is governed by a 165 // for details. All rights reserved. Use of this source code is governed by a
151 // BSD-style license that can be found in the LICENSE file. 166 // BSD-style license that can be found in the LICENSE file.
152 167
153 // WARNING: Do not edit - generated code. 168 // WARNING: Do not edit - generated code.
154 169
155 170
156 @DocsEditable() 171 @DocsEditable()
157 @DomName('SQLError') 172 @DomName('SQLError')
158 // http://www.w3.org/TR/webdatabase/#sqlerror 173 // http://www.w3.org/TR/webdatabase/#sqlerror
159 @Experimental() // deprecated 174 @Experimental() // deprecated
160 class SqlError extends NativeFieldWrapperClass2 { 175 class SqlError extends NativeFieldWrapperClass2 {
161 // To suppress missing implicit constructor warnings. 176 // To suppress missing implicit constructor warnings.
162 factory SqlError._() { throw new UnsupportedError("Not supported"); } 177 factory SqlError._() { throw new UnsupportedError("Not supported"); }
163 178
179 static SqlError internalCreateSqlError() {
180 return new SqlError._internalWrap();
181 }
182
183 JsObject blink_jsObject = null;
184
185 factory SqlError._internalWrap() {
186 return new SqlError._internal();
187 }
188
189 SqlError._internal() { }
190
191 bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical( this, other);
192
164 @DomName('SQLError.CONSTRAINT_ERR') 193 @DomName('SQLError.CONSTRAINT_ERR')
165 @DocsEditable() 194 @DocsEditable()
166 static const int CONSTRAINT_ERR = 6; 195 static const int CONSTRAINT_ERR = 6;
167 196
168 @DomName('SQLError.DATABASE_ERR') 197 @DomName('SQLError.DATABASE_ERR')
169 @DocsEditable() 198 @DocsEditable()
170 static const int DATABASE_ERR = 1; 199 static const int DATABASE_ERR = 1;
171 200
172 @DomName('SQLError.QUOTA_ERR') 201 @DomName('SQLError.QUOTA_ERR')
173 @DocsEditable() 202 @DocsEditable()
(...skipping 14 matching lines...) Expand all
188 @DomName('SQLError.UNKNOWN_ERR') 217 @DomName('SQLError.UNKNOWN_ERR')
189 @DocsEditable() 218 @DocsEditable()
190 static const int UNKNOWN_ERR = 0; 219 static const int UNKNOWN_ERR = 0;
191 220
192 @DomName('SQLError.VERSION_ERR') 221 @DomName('SQLError.VERSION_ERR')
193 @DocsEditable() 222 @DocsEditable()
194 static const int VERSION_ERR = 2; 223 static const int VERSION_ERR = 2;
195 224
196 @DomName('SQLError.code') 225 @DomName('SQLError.code')
197 @DocsEditable() 226 @DocsEditable()
198 int get code => _blink.BlinkSQLError.instance.code_Getter_(this); 227 int get code => _blink.BlinkSQLError.instance.code_Getter_(unwrap_jso(this));
199 228
200 @DomName('SQLError.message') 229 @DomName('SQLError.message')
201 @DocsEditable() 230 @DocsEditable()
202 String get message => _blink.BlinkSQLError.instance.message_Getter_(this); 231 String get message => _blink.BlinkSQLError.instance.message_Getter_(unwrap_jso (this));
203 232
204 } 233 }
205 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 234 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
206 // for details. All rights reserved. Use of this source code is governed by a 235 // for details. All rights reserved. Use of this source code is governed by a
207 // BSD-style license that can be found in the LICENSE file. 236 // BSD-style license that can be found in the LICENSE file.
208 237
209 // WARNING: Do not edit - generated code. 238 // WARNING: Do not edit - generated code.
210 239
211 240
212 @DocsEditable() 241 @DocsEditable()
213 @DomName('SQLResultSet') 242 @DomName('SQLResultSet')
214 // http://www.w3.org/TR/webdatabase/#sqlresultset 243 // http://www.w3.org/TR/webdatabase/#sqlresultset
215 @Experimental() // deprecated 244 @Experimental() // deprecated
216 class SqlResultSet extends NativeFieldWrapperClass2 { 245 class SqlResultSet extends NativeFieldWrapperClass2 {
217 // To suppress missing implicit constructor warnings. 246 // To suppress missing implicit constructor warnings.
218 factory SqlResultSet._() { throw new UnsupportedError("Not supported"); } 247 factory SqlResultSet._() { throw new UnsupportedError("Not supported"); }
219 248
249 static SqlResultSet internalCreateSqlResultSet() {
250 return new SqlResultSet._internalWrap();
251 }
252
253 JsObject blink_jsObject = null;
254
255 factory SqlResultSet._internalWrap() {
256 return new SqlResultSet._internal();
257 }
258
259 SqlResultSet._internal() { }
260
261 bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical( this, other);
262
220 @DomName('SQLResultSet.insertId') 263 @DomName('SQLResultSet.insertId')
221 @DocsEditable() 264 @DocsEditable()
222 int get insertId => _blink.BlinkSQLResultSet.instance.insertId_Getter_(this); 265 int get insertId => _blink.BlinkSQLResultSet.instance.insertId_Getter_(unwrap_ jso(this));
223 266
224 @DomName('SQLResultSet.rows') 267 @DomName('SQLResultSet.rows')
225 @DocsEditable() 268 @DocsEditable()
226 SqlResultSetRowList get rows => _blink.BlinkSQLResultSet.instance.rows_Getter_ (this); 269 SqlResultSetRowList get rows => wrap_jso(_blink.BlinkSQLResultSet.instance.row s_Getter_(unwrap_jso(this)));
227 270
228 @DomName('SQLResultSet.rowsAffected') 271 @DomName('SQLResultSet.rowsAffected')
229 @DocsEditable() 272 @DocsEditable()
230 int get rowsAffected => _blink.BlinkSQLResultSet.instance.rowsAffected_Getter_ (this); 273 int get rowsAffected => _blink.BlinkSQLResultSet.instance.rowsAffected_Getter_ (unwrap_jso(this));
231 274
232 } 275 }
233 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 276 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
234 // for details. All rights reserved. Use of this source code is governed by a 277 // for details. All rights reserved. Use of this source code is governed by a
235 // BSD-style license that can be found in the LICENSE file. 278 // BSD-style license that can be found in the LICENSE file.
236 279
237 // WARNING: Do not edit - generated code. 280 // WARNING: Do not edit - generated code.
238 281
239 282
240 @DocsEditable() 283 @DocsEditable()
241 @DomName('SQLResultSetRowList') 284 @DomName('SQLResultSetRowList')
242 // http://www.w3.org/TR/webdatabase/#sqlresultsetrowlist 285 // http://www.w3.org/TR/webdatabase/#sqlresultsetrowlist
243 @Experimental() // deprecated 286 @Experimental() // deprecated
244 class SqlResultSetRowList extends NativeFieldWrapperClass2 with ListMixin<Map>, ImmutableListMixin<Map> implements List<Map> { 287 class SqlResultSetRowList extends NativeFieldWrapperClass2 with ListMixin<Map>, ImmutableListMixin<Map> implements List<Map> {
245 // To suppress missing implicit constructor warnings. 288 // To suppress missing implicit constructor warnings.
246 factory SqlResultSetRowList._() { throw new UnsupportedError("Not supported"); } 289 factory SqlResultSetRowList._() { throw new UnsupportedError("Not supported"); }
247 290
291 static SqlResultSetRowList internalCreateSqlResultSetRowList() {
292 return new SqlResultSetRowList._internalWrap();
293 }
294
295 JsObject blink_jsObject = null;
296
297 factory SqlResultSetRowList._internalWrap() {
298 return new SqlResultSetRowList._internal();
299 }
300
301 SqlResultSetRowList._internal() { }
302
303 bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical( this, other);
304
248 @DomName('SQLResultSetRowList.length') 305 @DomName('SQLResultSetRowList.length')
249 @DocsEditable() 306 @DocsEditable()
250 int get length => _blink.BlinkSQLResultSetRowList.instance.length_Getter_(this ); 307 int get length => _blink.BlinkSQLResultSetRowList.instance.length_Getter_(unwr ap_jso(this));
251 308
252 Map operator[](int index) { 309 Map operator[](int index) {
253 if (index < 0 || index >= length) 310 if (index < 0 || index >= length)
254 throw new RangeError.index(index, this); 311 throw new RangeError.index(index, this);
255 return _blink.BlinkSQLResultSetRowList.instance.item_Callback_1_(this, index ); 312 return _blink.BlinkSQLResultSetRowList.instance.item_Callback_1_(unwrap_jso( this), index);
256 } 313 }
257 314
258 Map _nativeIndexedGetter(int index) => _blink.BlinkSQLResultSetRowList.instanc e.item_Callback_1_(this, index); 315 Map _nativeIndexedGetter(int index) => _blink.BlinkSQLResultSetRowList.instanc e.item_Callback_1_(unwrap_jso(this), index);
259 316
260 void operator[]=(int index, Map value) { 317 void operator[]=(int index, Map value) {
261 throw new UnsupportedError("Cannot assign element of immutable List."); 318 throw new UnsupportedError("Cannot assign element of immutable List.");
262 } 319 }
263 // -- start List<Map> mixins. 320 // -- start List<Map> mixins.
264 // Map is the element type. 321 // Map is the element type.
265 322
266 323
267 void set length(int value) { 324 void set length(int value) {
268 throw new UnsupportedError("Cannot resize immutable List."); 325 throw new UnsupportedError("Cannot resize immutable List.");
269 } 326 }
(...skipping 20 matching lines...) Expand all
290 } 347 }
291 if (len == 0) throw new StateError("No elements"); 348 if (len == 0) throw new StateError("No elements");
292 throw new StateError("More than one element"); 349 throw new StateError("More than one element");
293 } 350 }
294 351
295 Map elementAt(int index) => this[index]; 352 Map elementAt(int index) => this[index];
296 // -- end List<Map> mixins. 353 // -- end List<Map> mixins.
297 354
298 @DomName('SQLResultSetRowList.item') 355 @DomName('SQLResultSetRowList.item')
299 @DocsEditable() 356 @DocsEditable()
300 Map item(int index) => _blink.BlinkSQLResultSetRowList.instance.item_Callback_ 1_(this, index); 357 Map item(int index) => _blink.BlinkSQLResultSetRowList.instance.item_Callback_ 1_(unwrap_jso(this), index);
301 358
302 } 359 }
303 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 360 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
304 // for details. All rights reserved. Use of this source code is governed by a 361 // for details. All rights reserved. Use of this source code is governed by a
305 // BSD-style license that can be found in the LICENSE file. 362 // BSD-style license that can be found in the LICENSE file.
306 363
307 // WARNING: Do not edit - generated code. 364 // WARNING: Do not edit - generated code.
308 365
309 366
310 @DocsEditable() 367 @DocsEditable()
311 @DomName('SQLTransaction') 368 @DomName('SQLTransaction')
312 @SupportedBrowser(SupportedBrowser.CHROME) 369 @SupportedBrowser(SupportedBrowser.CHROME)
313 @SupportedBrowser(SupportedBrowser.SAFARI) 370 @SupportedBrowser(SupportedBrowser.SAFARI)
314 @Experimental() 371 @Experimental()
315 // http://www.w3.org/TR/webdatabase/#sqltransaction 372 // http://www.w3.org/TR/webdatabase/#sqltransaction
316 @deprecated // deprecated 373 @deprecated // deprecated
317 class SqlTransaction extends NativeFieldWrapperClass2 { 374 class SqlTransaction extends NativeFieldWrapperClass2 {
318 // To suppress missing implicit constructor warnings. 375 // To suppress missing implicit constructor warnings.
319 factory SqlTransaction._() { throw new UnsupportedError("Not supported"); } 376 factory SqlTransaction._() { throw new UnsupportedError("Not supported"); }
320 377
378 static SqlTransaction internalCreateSqlTransaction() {
379 return new SqlTransaction._internalWrap();
380 }
381
382 JsObject blink_jsObject = null;
383
384 factory SqlTransaction._internalWrap() {
385 return new SqlTransaction._internal();
386 }
387
388 SqlTransaction._internal() { }
389
390 bool operator ==(other) => unwrap_jso(other) == unwrap_jso(this) || identical( this, other);
391
321 @DomName('SQLTransaction.executeSql') 392 @DomName('SQLTransaction.executeSql')
322 @DocsEditable() 393 @DocsEditable()
323 void executeSql(String sqlStatement, List<Object> arguments, [SqlStatementCall back callback, SqlStatementErrorCallback errorCallback]) => _blink.BlinkSQLTrans action.instance.executeSql_Callback_4_(this, sqlStatement, arguments, callback, errorCallback); 394 void executeSql(String sqlStatement, List<Object> arguments, [SqlStatementCall back callback, SqlStatementErrorCallback errorCallback]) => _blink.BlinkSQLTrans action.instance.executeSql_Callback_4_(unwrap_jso(this), sqlStatement, arguments , unwrap_jso(callback), unwrap_jso(errorCallback));
324 395
325 } 396 }
OLDNEW
« no previous file with comments | « sdk/lib/web_gl/dartium/web_gl_dartium.dart ('k') | tools/dom/scripts/css_code_generator.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698