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

Side by Side Diff: tools/dom/templates/html/impl/impl_IDBObjectStore.darttemplate

Issue 12258022: Fixing IndexedDB Dartium Checked Mode tests (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 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 | « sdk/lib/indexed_db/dartium/indexed_db_dartium.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of $LIBRARYNAME; 5 part of $LIBRARYNAME;
6 6
7 $(ANNOTATIONS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC { 7 $(ANNOTATIONS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
8 8
9 @DomName('IDBObjectStore.put') 9 @DomName('IDBObjectStore.put')
10 Future put(value, [key]) { 10 Future put(value, [key]) {
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 $!MEMBERS 79 $!MEMBERS
80 80
81 /** 81 /**
82 * Helper for iterating over cursors in a request. 82 * Helper for iterating over cursors in a request.
83 */ 83 */
84 static Stream<Cursor> _cursorStreamFromResult(Request request, 84 static Stream<Cursor> _cursorStreamFromResult(Request request,
85 bool autoAdvance) { 85 bool autoAdvance) {
86 // TODO: need to guarantee that the controller provides the values 86 // TODO: need to guarantee that the controller provides the values
87 // immediately as waiting until the next tick will cause the transaction to 87 // immediately as waiting until the next tick will cause the transaction to
88 // close. 88 // close.
89 var controller = new StreamController<Cursor>(); 89 var controller = new StreamController();
90 90
91 request.onError.listen((e) { 91 request.onError.listen((e) {
92 //TODO: Report stacktrace once issue 4061 is resolved. 92 //TODO: Report stacktrace once issue 4061 is resolved.
93 controller.signalError(e); 93 controller.signalError(e);
94 }); 94 });
95 95
96 request.onSuccess.listen((e) { 96 request.onSuccess.listen((e) {
97 Cursor cursor = request.result; 97 Cursor cursor = request.result;
98 if (cursor == null) { 98 if (cursor == null) {
99 controller.close(); 99 controller.close();
100 } else { 100 } else {
101 controller.add(cursor); 101 controller.add(cursor);
102 if (autoAdvance == true) { 102 if (autoAdvance == true) {
103 cursor.next(); 103 cursor.next();
104 } 104 }
105 } 105 }
106 }); 106 });
107 return controller.stream; 107 return controller.stream;
108 } 108 }
109 } 109 }
OLDNEW
« no previous file with comments | « sdk/lib/indexed_db/dartium/indexed_db_dartium.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698