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

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

Issue 27036002: Update dom streams with new signatures. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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 | « tools/dom/templates/html/impl/impl_IDBObjectStore.darttemplate ('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 /** 7 /**
8 * A utility for retrieving data from a URL. 8 * A utility for retrieving data from a URL.
9 * 9 *
10 * HttpRequest can be used to obtain data from http, ftp, and file 10 * HttpRequest can be used to obtain data from http, ftp, and file
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 xhr.onLoad.listen((e) { 153 xhr.onLoad.listen((e) {
154 // Note: file:// URIs have status of 0. 154 // Note: file:// URIs have status of 0.
155 if ((xhr.status >= 200 && xhr.status < 300) || 155 if ((xhr.status >= 200 && xhr.status < 300) ||
156 xhr.status == 0 || xhr.status == 304) { 156 xhr.status == 0 || xhr.status == 304) {
157 completer.complete(xhr); 157 completer.complete(xhr);
158 } else { 158 } else {
159 completer.completeError(e); 159 completer.completeError(e);
160 } 160 }
161 }); 161 });
162 162
163 xhr.onError.listen((e) { 163 xhr.onError.listen(completer.completeError);
164 completer.completeError(e);
165 });
166 164
167 if (sendData != null) { 165 if (sendData != null) {
168 xhr.send(sendData); 166 xhr.send(sendData);
169 } else { 167 } else {
170 xhr.send(); 168 xhr.send();
171 } 169 }
172 170
173 return completer.future; 171 return completer.future;
174 } 172 }
175 173
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 } else { 265 } else {
268 JS('', '#.send()', xhr); 266 JS('', '#.send()', xhr);
269 } 267 }
270 268
271 return completer.future; 269 return completer.future;
272 $endif 270 $endif
273 } 271 }
274 272
275 $!MEMBERS 273 $!MEMBERS
276 } 274 }
OLDNEW
« no previous file with comments | « tools/dom/templates/html/impl/impl_IDBObjectStore.darttemplate ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698