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

Side by Side Diff: sdk/lib/indexed_db/dart2js/indexed_db_dart2js.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
« no previous file with comments | « no previous file | sdk/lib/indexed_db/dartium/indexed_db_dartium.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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:typed_data'; 6 import 'dart:typed_data';
7 import 'dart:_js_helper' show Creates, Returns, JSName, Null; 7 import 'dart:_js_helper' show Creates, Returns, JSName, Null;
8 import 'dart:_foreign_helper' show JS; 8 import 'dart:_foreign_helper' show JS;
9 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 9 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
10 // for details. All rights reserved. Use of this source code is governed by a 10 // for details. All rights reserved. Use of this source code is governed by a
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 397
398 @DomName('IDBFactory.deleteDatabase') 398 @DomName('IDBFactory.deleteDatabase')
399 Future<IdbFactory> deleteDatabase(String name, 399 Future<IdbFactory> deleteDatabase(String name,
400 {void onBlocked(Event)}) { 400 {void onBlocked(Event)}) {
401 try { 401 try {
402 var request = $dom_deleteDatabase(name); 402 var request = $dom_deleteDatabase(name);
403 403
404 if (onBlocked != null) { 404 if (onBlocked != null) {
405 request.onBlocked.listen(onBlocked); 405 request.onBlocked.listen(onBlocked);
406 } 406 }
407 return _completeRequest(request); 407 var completer = new Completer.sync();
408 request.onSuccess.listen((e) {
409 completer.complete(this);
410 });
411 request.onError.listen((e) {
412 completer.completeError(e);
413 });
414 return completer.future;
408 } catch (e, stacktrace) { 415 } catch (e, stacktrace) {
409 return new Future.error(e, stacktrace); 416 return new Future.error(e, stacktrace);
410 } 417 }
411 } 418 }
412 419
413 @DomName('IDBFactory.getDatabaseNames') 420 @DomName('IDBFactory.getDatabaseNames')
414 @SupportedBrowser(SupportedBrowser.CHROME) 421 @SupportedBrowser(SupportedBrowser.CHROME)
415 @Experimental 422 @Experimental
416 Future<List<String>> getDatabaseNames() { 423 Future<List<String>> getDatabaseNames() {
417 try { 424 try {
(...skipping 833 matching lines...) Expand 10 before | Expand all | Expand 10 after
1251 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1258 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
1252 // for details. All rights reserved. Use of this source code is governed by a 1259 // for details. All rights reserved. Use of this source code is governed by a
1253 // BSD-style license that can be found in the LICENSE file. 1260 // BSD-style license that can be found in the LICENSE file.
1254 1261
1255 1262
1256 @DocsEditable 1263 @DocsEditable
1257 @DomName('IDBAny') 1264 @DomName('IDBAny')
1258 @deprecated // nonstandard 1265 @deprecated // nonstandard
1259 abstract class _IDBAny native "IDBAny" { 1266 abstract class _IDBAny native "IDBAny" {
1260 } 1267 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/indexed_db/dartium/indexed_db_dartium.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698