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

Side by Side Diff: sdk/lib/web_sql/dart2js/web_sql_dart2js.dart

Issue 17063007: Making all DOM types abstract and removing superfluous Dartium constructors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 6 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 | Annotate | Revision Log
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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 75
76 76
77 @DocsEditable 77 @DocsEditable
78 @DomName('Database') 78 @DomName('Database')
79 @SupportedBrowser(SupportedBrowser.CHROME) 79 @SupportedBrowser(SupportedBrowser.CHROME)
80 @SupportedBrowser(SupportedBrowser.SAFARI) 80 @SupportedBrowser(SupportedBrowser.SAFARI)
81 @Experimental 81 @Experimental
82 // http://www.w3.org/TR/webdatabase/#asynchronous-database-api 82 // http://www.w3.org/TR/webdatabase/#asynchronous-database-api
83 @Experimental // deprecated 83 @Experimental // deprecated
84 class SqlDatabase native "Database" { 84 class SqlDatabase native "Database" {
85 // To suppress missing implicit constructor warnings.
86 factory SqlDatabase._() { throw new UnsupportedError("Not supported"); }
85 87
86 /// Checks if this type is supported on the current platform. 88 /// Checks if this type is supported on the current platform.
87 static bool get supported => JS('bool', '!!(window.openDatabase)'); 89 static bool get supported => JS('bool', '!!(window.openDatabase)');
88 90
89 @DomName('Database.version') 91 @DomName('Database.version')
90 @DocsEditable 92 @DocsEditable
91 final String version; 93 final String version;
92 94
93 /** 95 /**
94 * Atomically update the database version to [newVersion], asynchronously 96 * Atomically update the database version to [newVersion], asynchronously
(...skipping 22 matching lines...) Expand all
117 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 119 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
118 // for details. All rights reserved. Use of this source code is governed by a 120 // for details. All rights reserved. Use of this source code is governed by a
119 // BSD-style license that can be found in the LICENSE file. 121 // BSD-style license that can be found in the LICENSE file.
120 122
121 123
122 @DocsEditable 124 @DocsEditable
123 @DomName('SQLError') 125 @DomName('SQLError')
124 // http://www.w3.org/TR/webdatabase/#sqlerror 126 // http://www.w3.org/TR/webdatabase/#sqlerror
125 @Experimental // deprecated 127 @Experimental // deprecated
126 class SqlError native "SQLError" { 128 class SqlError native "SQLError" {
129 // To suppress missing implicit constructor warnings.
130 factory SqlError._() { throw new UnsupportedError("Not supported"); }
127 131
128 @DomName('SQLError.CONSTRAINT_ERR') 132 @DomName('SQLError.CONSTRAINT_ERR')
129 @DocsEditable 133 @DocsEditable
130 static const int CONSTRAINT_ERR = 6; 134 static const int CONSTRAINT_ERR = 6;
131 135
132 @DomName('SQLError.DATABASE_ERR') 136 @DomName('SQLError.DATABASE_ERR')
133 @DocsEditable 137 @DocsEditable
134 static const int DATABASE_ERR = 1; 138 static const int DATABASE_ERR = 1;
135 139
136 @DomName('SQLError.QUOTA_ERR') 140 @DomName('SQLError.QUOTA_ERR')
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 172 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
169 // for details. All rights reserved. Use of this source code is governed by a 173 // for details. All rights reserved. Use of this source code is governed by a
170 // BSD-style license that can be found in the LICENSE file. 174 // BSD-style license that can be found in the LICENSE file.
171 175
172 176
173 @DocsEditable 177 @DocsEditable
174 @DomName('SQLException') 178 @DomName('SQLException')
175 // http://www.w3.org/TR/webdatabase/#sqlexception 179 // http://www.w3.org/TR/webdatabase/#sqlexception
176 @Experimental // deprecated 180 @Experimental // deprecated
177 class SqlException native "SQLException" { 181 class SqlException native "SQLException" {
182 // To suppress missing implicit constructor warnings.
183 factory SqlException._() { throw new UnsupportedError("Not supported"); }
178 184
179 @DomName('SQLException.CONSTRAINT_ERR') 185 @DomName('SQLException.CONSTRAINT_ERR')
180 @DocsEditable 186 @DocsEditable
181 static const int CONSTRAINT_ERR = 6; 187 static const int CONSTRAINT_ERR = 6;
182 188
183 @DomName('SQLException.DATABASE_ERR') 189 @DomName('SQLException.DATABASE_ERR')
184 @DocsEditable 190 @DocsEditable
185 static const int DATABASE_ERR = 1; 191 static const int DATABASE_ERR = 1;
186 192
187 @DomName('SQLException.QUOTA_ERR') 193 @DomName('SQLException.QUOTA_ERR')
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 225 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
220 // for details. All rights reserved. Use of this source code is governed by a 226 // for details. All rights reserved. Use of this source code is governed by a
221 // BSD-style license that can be found in the LICENSE file. 227 // BSD-style license that can be found in the LICENSE file.
222 228
223 229
224 @DocsEditable 230 @DocsEditable
225 @DomName('SQLResultSet') 231 @DomName('SQLResultSet')
226 // http://www.w3.org/TR/webdatabase/#sqlresultset 232 // http://www.w3.org/TR/webdatabase/#sqlresultset
227 @Experimental // deprecated 233 @Experimental // deprecated
228 class SqlResultSet native "SQLResultSet" { 234 class SqlResultSet native "SQLResultSet" {
235 // To suppress missing implicit constructor warnings.
236 factory SqlResultSet._() { throw new UnsupportedError("Not supported"); }
229 237
230 @DomName('SQLResultSet.insertId') 238 @DomName('SQLResultSet.insertId')
231 @DocsEditable 239 @DocsEditable
232 final int insertId; 240 final int insertId;
233 241
234 @DomName('SQLResultSet.rows') 242 @DomName('SQLResultSet.rows')
235 @DocsEditable 243 @DocsEditable
236 final SqlResultSetRowList rows; 244 final SqlResultSetRowList rows;
237 245
238 @DomName('SQLResultSet.rowsAffected') 246 @DomName('SQLResultSet.rowsAffected')
239 @DocsEditable 247 @DocsEditable
240 final int rowsAffected; 248 final int rowsAffected;
241 } 249 }
242 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 250 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
243 // for details. All rights reserved. Use of this source code is governed by a 251 // for details. All rights reserved. Use of this source code is governed by a
244 // BSD-style license that can be found in the LICENSE file. 252 // BSD-style license that can be found in the LICENSE file.
245 253
246 254
247 @DocsEditable 255 @DocsEditable
248 @DomName('SQLResultSetRowList') 256 @DomName('SQLResultSetRowList')
249 // http://www.w3.org/TR/webdatabase/#sqlresultsetrowlist 257 // http://www.w3.org/TR/webdatabase/#sqlresultsetrowlist
250 @Experimental // deprecated 258 @Experimental // deprecated
251 class SqlResultSetRowList extends Interceptor with ListMixin<Map>, ImmutableList Mixin<Map> implements JavaScriptIndexingBehavior, List<Map> native "SQLResultSet RowList" { 259 class SqlResultSetRowList extends Interceptor with ListMixin<Map>, ImmutableList Mixin<Map> implements JavaScriptIndexingBehavior, List<Map> native "SQLResultSet RowList" {
260 // To suppress missing implicit constructor warnings.
261 factory SqlResultSetRowList._() { throw new UnsupportedError("Not supported"); }
252 262
253 @DomName('SQLResultSetRowList.length') 263 @DomName('SQLResultSetRowList.length')
254 @DocsEditable 264 @DocsEditable
255 int get length => JS("int", "#.length", this); 265 int get length => JS("int", "#.length", this);
256 266
257 Map operator[](int index) { 267 Map operator[](int index) {
258 if (JS("bool", "# >>> 0 !== # || # >= #", index, 268 if (JS("bool", "# >>> 0 !== # || # >= #", index,
259 index, index, length)) 269 index, index, length))
260 throw new RangeError.range(index, 0, length); 270 throw new RangeError.range(index, 0, length);
261 return this.item(index); 271 return this.item(index);
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 326
317 327
318 @DocsEditable 328 @DocsEditable
319 @DomName('SQLTransaction') 329 @DomName('SQLTransaction')
320 @SupportedBrowser(SupportedBrowser.CHROME) 330 @SupportedBrowser(SupportedBrowser.CHROME)
321 @SupportedBrowser(SupportedBrowser.SAFARI) 331 @SupportedBrowser(SupportedBrowser.SAFARI)
322 @Experimental 332 @Experimental
323 // http://www.w3.org/TR/webdatabase/#sqltransaction 333 // http://www.w3.org/TR/webdatabase/#sqltransaction
324 @deprecated // deprecated 334 @deprecated // deprecated
325 class SqlTransaction native "SQLTransaction" { 335 class SqlTransaction native "SQLTransaction" {
336 // To suppress missing implicit constructor warnings.
337 factory SqlTransaction._() { throw new UnsupportedError("Not supported"); }
326 338
327 @DomName('SQLTransaction.executeSql') 339 @DomName('SQLTransaction.executeSql')
328 @DocsEditable 340 @DocsEditable
329 void executeSql(String sqlStatement, List arguments, [SqlStatementCallback cal lback, SqlStatementErrorCallback errorCallback]) native; 341 void executeSql(String sqlStatement, List arguments, [SqlStatementCallback cal lback, SqlStatementErrorCallback errorCallback]) native;
330 } 342 }
331 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 343 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
332 // for details. All rights reserved. Use of this source code is governed by a 344 // for details. All rights reserved. Use of this source code is governed by a
333 // BSD-style license that can be found in the LICENSE file. 345 // BSD-style license that can be found in the LICENSE file.
334 346
335 347
336 @DocsEditable 348 @DocsEditable
337 @DomName('SQLTransactionSync') 349 @DomName('SQLTransactionSync')
338 @SupportedBrowser(SupportedBrowser.CHROME) 350 @SupportedBrowser(SupportedBrowser.CHROME)
339 @SupportedBrowser(SupportedBrowser.SAFARI) 351 @SupportedBrowser(SupportedBrowser.SAFARI)
340 @Experimental 352 @Experimental
341 // http://www.w3.org/TR/webdatabase/#sqltransactionsync 353 // http://www.w3.org/TR/webdatabase/#sqltransactionsync
342 @Experimental // deprecated 354 @Experimental // deprecated
343 abstract class _SQLTransactionSync native "SQLTransactionSync" { 355 abstract class _SQLTransactionSync native "SQLTransactionSync" {
356 // To suppress missing implicit constructor warnings.
357 factory _SQLTransactionSync._() { throw new UnsupportedError("Not supported"); }
344 } 358 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698