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

Unified Diff: tools/dom/templates/html/impl/impl_XMLHttpRequest.darttemplate

Issue 12224055: Converting XHR from onLoad to onReadyStateChange (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/dom/templates/html/impl/impl_XMLHttpRequest.darttemplate
diff --git a/tools/dom/templates/html/impl/impl_XMLHttpRequest.darttemplate b/tools/dom/templates/html/impl/impl_XMLHttpRequest.darttemplate
index 078d873b230c53637867d92323a520d0ae3bedda..8034447dfd326b13c440a38ea958042607c85a6e 100644
--- a/tools/dom/templates/html/impl/impl_XMLHttpRequest.darttemplate
+++ b/tools/dom/templates/html/impl/impl_XMLHttpRequest.darttemplate
@@ -94,12 +94,14 @@ $(ANNOTATIONS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
xhr.onProgress.listen(onProgress);
}
- xhr.onLoad.listen((e) {
- if (xhr.status >= 200 && xhr.status < 300 ||
- xhr.status == 304 ) {
- completer.complete(xhr);
- } else {
- completer.completeError(e);
+ xhr.onReadyStateChange.listen((e) {
+ if (xhr.readyState == HttpRequest.DONE) {
+ if (xhr.status >= 200 && xhr.status < 300 ||
+ xhr.status == 304 ) {
Emily Fortuna 2013/02/07 20:53:44 This doesn't fix the problem described in dartbug.
+ completer.complete(xhr);
+ } else {
+ completer.completeError(e);
+ }
}
});
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698