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

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

Issue 409053002: Use @Native annotation on dart2js DOM native classes (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 | 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 */
11 library dart.dom.web_sql; 11 library dart.dom.web_sql;
12 12
13 import 'dart:async'; 13 import 'dart:async';
14 import 'dart:collection'; 14 import 'dart:collection';
15 import 'dart:_internal' hide deprecated; 15 import 'dart:_internal' hide deprecated;
16 import 'dart:html'; 16 import 'dart:html';
17 import 'dart:html_common'; 17 import 'dart:html_common';
18 import 'dart:_js_helper' show convertDartClosureToJS, Creates, JSName; 18 import 'dart:_js_helper' show convertDartClosureToJS, Creates, JSName, Native;
19 import 'dart:_foreign_helper' show JS; 19 import 'dart:_foreign_helper' show JS;
20 import 'dart:_interceptors' show Interceptor; 20 import 'dart:_interceptors' show Interceptor;
21 // DO NOT EDIT - unless you are editing documentation as per: 21 // DO NOT EDIT - unless you are editing documentation as per:
22 // https://code.google.com/p/dart/wiki/ContributingHTMLDocumentation 22 // https://code.google.com/p/dart/wiki/ContributingHTMLDocumentation
23 // Auto-generated dart:audio library. 23 // Auto-generated dart:audio library.
24 24
25 25
26 26
27 27
28 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 28 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 // BSD-style license that can be found in the LICENSE file. 74 // BSD-style license that can be found in the LICENSE file.
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 extends Interceptor native "Database" { 84 @Native("Database")
85 class SqlDatabase extends Interceptor {
85 // To suppress missing implicit constructor warnings. 86 // To suppress missing implicit constructor warnings.
86 factory SqlDatabase._() { throw new UnsupportedError("Not supported"); } 87 factory SqlDatabase._() { throw new UnsupportedError("Not supported"); }
87 88
88 /// Checks if this type is supported on the current platform. 89 /// Checks if this type is supported on the current platform.
89 static bool get supported => JS('bool', '!!(window.openDatabase)'); 90 static bool get supported => JS('bool', '!!(window.openDatabase)');
90 91
91 @DomName('Database.version') 92 @DomName('Database.version')
92 @DocsEditable() 93 @DocsEditable()
93 final String version; 94 final String version;
94 95
(...skipping 23 matching lines...) Expand all
118 } 119 }
119 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 120 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
120 // for details. All rights reserved. Use of this source code is governed by a 121 // for details. All rights reserved. Use of this source code is governed by a
121 // BSD-style license that can be found in the LICENSE file. 122 // BSD-style license that can be found in the LICENSE file.
122 123
123 124
124 @DocsEditable() 125 @DocsEditable()
125 @DomName('SQLError') 126 @DomName('SQLError')
126 // http://www.w3.org/TR/webdatabase/#sqlerror 127 // http://www.w3.org/TR/webdatabase/#sqlerror
127 @Experimental() // deprecated 128 @Experimental() // deprecated
128 class SqlError extends Interceptor native "SQLError" { 129 @Native("SQLError")
130 class SqlError extends Interceptor {
129 // To suppress missing implicit constructor warnings. 131 // To suppress missing implicit constructor warnings.
130 factory SqlError._() { throw new UnsupportedError("Not supported"); } 132 factory SqlError._() { throw new UnsupportedError("Not supported"); }
131 133
132 @DomName('SQLError.CONSTRAINT_ERR') 134 @DomName('SQLError.CONSTRAINT_ERR')
133 @DocsEditable() 135 @DocsEditable()
134 static const int CONSTRAINT_ERR = 6; 136 static const int CONSTRAINT_ERR = 6;
135 137
136 @DomName('SQLError.DATABASE_ERR') 138 @DomName('SQLError.DATABASE_ERR')
137 @DocsEditable() 139 @DocsEditable()
138 static const int DATABASE_ERR = 1; 140 static const int DATABASE_ERR = 1;
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 } 173 }
172 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 174 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
173 // for details. All rights reserved. Use of this source code is governed by a 175 // for details. All rights reserved. Use of this source code is governed by a
174 // BSD-style license that can be found in the LICENSE file. 176 // BSD-style license that can be found in the LICENSE file.
175 177
176 178
177 @DocsEditable() 179 @DocsEditable()
178 @DomName('SQLResultSet') 180 @DomName('SQLResultSet')
179 // http://www.w3.org/TR/webdatabase/#sqlresultset 181 // http://www.w3.org/TR/webdatabase/#sqlresultset
180 @Experimental() // deprecated 182 @Experimental() // deprecated
181 class SqlResultSet extends Interceptor native "SQLResultSet" { 183 @Native("SQLResultSet")
184 class SqlResultSet extends Interceptor {
182 // To suppress missing implicit constructor warnings. 185 // To suppress missing implicit constructor warnings.
183 factory SqlResultSet._() { throw new UnsupportedError("Not supported"); } 186 factory SqlResultSet._() { throw new UnsupportedError("Not supported"); }
184 187
185 @DomName('SQLResultSet.insertId') 188 @DomName('SQLResultSet.insertId')
186 @DocsEditable() 189 @DocsEditable()
187 final int insertId; 190 final int insertId;
188 191
189 @DomName('SQLResultSet.rows') 192 @DomName('SQLResultSet.rows')
190 @DocsEditable() 193 @DocsEditable()
191 final SqlResultSetRowList rows; 194 final SqlResultSetRowList rows;
192 195
193 @DomName('SQLResultSet.rowsAffected') 196 @DomName('SQLResultSet.rowsAffected')
194 @DocsEditable() 197 @DocsEditable()
195 final int rowsAffected; 198 final int rowsAffected;
196 } 199 }
197 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 200 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
198 // for details. All rights reserved. Use of this source code is governed by a 201 // for details. All rights reserved. Use of this source code is governed by a
199 // BSD-style license that can be found in the LICENSE file. 202 // BSD-style license that can be found in the LICENSE file.
200 203
201 204
202 @DocsEditable() 205 @DocsEditable()
203 @DomName('SQLResultSetRowList') 206 @DomName('SQLResultSetRowList')
204 // http://www.w3.org/TR/webdatabase/#sqlresultsetrowlist 207 // http://www.w3.org/TR/webdatabase/#sqlresultsetrowlist
205 @Experimental() // deprecated 208 @Experimental() // deprecated
206 class SqlResultSetRowList extends Interceptor with ListMixin<Map>, ImmutableList Mixin<Map> implements List<Map> native "SQLResultSetRowList" { 209 @Native("SQLResultSetRowList")
210 class SqlResultSetRowList extends Interceptor with ListMixin<Map>, ImmutableList Mixin<Map> implements List<Map> {
207 // To suppress missing implicit constructor warnings. 211 // To suppress missing implicit constructor warnings.
208 factory SqlResultSetRowList._() { throw new UnsupportedError("Not supported"); } 212 factory SqlResultSetRowList._() { throw new UnsupportedError("Not supported"); }
209 213
210 @DomName('SQLResultSetRowList.length') 214 @DomName('SQLResultSetRowList.length')
211 @DocsEditable() 215 @DocsEditable()
212 int get length => JS("int", "#.length", this); 216 int get length => JS("int", "#.length", this);
213 217
214 Map operator[](int index) { 218 Map operator[](int index) {
215 if (JS("bool", "# >>> 0 !== # || # >= #", index, 219 if (JS("bool", "# >>> 0 !== # || # >= #", index,
216 index, index, length)) 220 index, index, length))
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 // BSD-style license that can be found in the LICENSE file. 276 // BSD-style license that can be found in the LICENSE file.
273 277
274 278
275 @DocsEditable() 279 @DocsEditable()
276 @DomName('SQLTransaction') 280 @DomName('SQLTransaction')
277 @SupportedBrowser(SupportedBrowser.CHROME) 281 @SupportedBrowser(SupportedBrowser.CHROME)
278 @SupportedBrowser(SupportedBrowser.SAFARI) 282 @SupportedBrowser(SupportedBrowser.SAFARI)
279 @Experimental() 283 @Experimental()
280 // http://www.w3.org/TR/webdatabase/#sqltransaction 284 // http://www.w3.org/TR/webdatabase/#sqltransaction
281 @deprecated // deprecated 285 @deprecated // deprecated
282 class SqlTransaction extends Interceptor native "SQLTransaction" { 286 @Native("SQLTransaction")
287 class SqlTransaction extends Interceptor {
283 // To suppress missing implicit constructor warnings. 288 // To suppress missing implicit constructor warnings.
284 factory SqlTransaction._() { throw new UnsupportedError("Not supported"); } 289 factory SqlTransaction._() { throw new UnsupportedError("Not supported"); }
285 290
286 @DomName('SQLTransaction.executeSql') 291 @DomName('SQLTransaction.executeSql')
287 @DocsEditable() 292 @DocsEditable()
288 void executeSql(String sqlStatement, List<Object> arguments, [SqlStatementCall back callback, SqlStatementErrorCallback errorCallback]) native; 293 void executeSql(String sqlStatement, List<Object> arguments, [SqlStatementCall back callback, SqlStatementErrorCallback errorCallback]) native;
289 } 294 }
290 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 295 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
291 // for details. All rights reserved. Use of this source code is governed by a 296 // for details. All rights reserved. Use of this source code is governed by a
292 // BSD-style license that can be found in the LICENSE file. 297 // BSD-style license that can be found in the LICENSE file.
293 298
294 299
295 @DocsEditable() 300 @DocsEditable()
296 @DomName('SQLTransactionSync') 301 @DomName('SQLTransactionSync')
297 @SupportedBrowser(SupportedBrowser.CHROME) 302 @SupportedBrowser(SupportedBrowser.CHROME)
298 @SupportedBrowser(SupportedBrowser.SAFARI) 303 @SupportedBrowser(SupportedBrowser.SAFARI)
299 @Experimental() 304 @Experimental()
300 // http://www.w3.org/TR/webdatabase/#sqltransactionsync 305 // http://www.w3.org/TR/webdatabase/#sqltransactionsync
301 @Experimental() // deprecated 306 @Experimental() // deprecated
302 abstract class _SQLTransactionSync extends Interceptor native "SQLTransactionSyn c" { 307 @Native("SQLTransactionSync")
308 abstract class _SQLTransactionSync extends Interceptor {
303 // To suppress missing implicit constructor warnings. 309 // To suppress missing implicit constructor warnings.
304 factory _SQLTransactionSync._() { throw new UnsupportedError("Not supported"); } 310 factory _SQLTransactionSync._() { throw new UnsupportedError("Not supported"); }
305 } 311 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698