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

Side by Side Diff: sdk/lib/indexed_db/dartium/indexed_db_dartium.dart

Issue 16022012: Fixing IndexedDB's deleteDatabase to have the correct future result. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 7 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 library dart.dom.indexed_db; 1 library dart.dom.indexed_db;
2 2
3 import 'dart:async'; 3 import 'dart:async';
4 import 'dart:html'; 4 import 'dart:html';
5 import 'dart:html_common'; 5 import 'dart:html_common';
6 import 'dart:nativewrappers'; 6 import 'dart:nativewrappers';
7 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 7 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
8 // for details. All rights reserved. Use of this source code is governed by a 8 // for details. All rights reserved. Use of this source code is governed by a
9 // BSD-style license that can be found in the LICENSE file. 9 // BSD-style license that can be found in the LICENSE file.
10 10
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 272
273 @DomName('IDBFactory.deleteDatabase') 273 @DomName('IDBFactory.deleteDatabase')
274 Future<IdbFactory> deleteDatabase(String name, 274 Future<IdbFactory> deleteDatabase(String name,
275 {void onBlocked(Event)}) { 275 {void onBlocked(Event)}) {
276 try { 276 try {
277 var request = $dom_deleteDatabase(name); 277 var request = $dom_deleteDatabase(name);
278 278
279 if (onBlocked != null) { 279 if (onBlocked != null) {
280 request.onBlocked.listen(onBlocked); 280 request.onBlocked.listen(onBlocked);
281 } 281 }
282 return _completeRequest(request); 282 var completer = new Completer.sync();
283 request.onSuccess.listen((e) {
284 completer.complete(this);
285 });
286 request.onError.listen((e) {
287 completer.completeError(e);
288 });
289 return completer.future;
283 } catch (e, stacktrace) { 290 } catch (e, stacktrace) {
284 return new Future.error(e, stacktrace); 291 return new Future.error(e, stacktrace);
285 } 292 }
286 } 293 }
287 294
288 @DomName('IDBFactory.getDatabaseNames') 295 @DomName('IDBFactory.getDatabaseNames')
289 @SupportedBrowser(SupportedBrowser.CHROME) 296 @SupportedBrowser(SupportedBrowser.CHROME)
290 @Experimental 297 @Experimental
291 Future<List<String>> getDatabaseNames() { 298 Future<List<String>> getDatabaseNames() {
292 try { 299 try {
(...skipping 826 matching lines...) Expand 10 before | Expand all | Expand 10 after
1119 // WARNING: Do not edit - generated code. 1126 // WARNING: Do not edit - generated code.
1120 1127
1121 1128
1122 @DocsEditable 1129 @DocsEditable
1123 @DomName('IDBAny') 1130 @DomName('IDBAny')
1124 @deprecated // nonstandard 1131 @deprecated // nonstandard
1125 abstract class _IDBAny extends NativeFieldWrapperClass1 { 1132 abstract class _IDBAny extends NativeFieldWrapperClass1 {
1126 _IDBAny.internal(); 1133 _IDBAny.internal();
1127 1134
1128 } 1135 }
OLDNEW
« no previous file with comments | « sdk/lib/indexed_db/dart2js/indexed_db_dart2js.dart ('k') | tools/dom/templates/html/impl/impl_IDBFactory.darttemplate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698