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

Unified Diff: sdk/lib/html/dartium/html_dartium.dart

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:
Download patch
Index: sdk/lib/html/dartium/html_dartium.dart
diff --git a/sdk/lib/html/dartium/html_dartium.dart b/sdk/lib/html/dartium/html_dartium.dart
index b5e82af86a71bcc2b997884742fd66c6ae5d288c..50f679db9b38f03090c607a8279afa3d9126afbb 100644
--- a/sdk/lib/html/dartium/html_dartium.dart
+++ b/sdk/lib/html/dartium/html_dartium.dart
@@ -13736,12 +13736,14 @@ class HttpRequest extends EventTarget {
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 ) {
+ completer.complete(xhr);
+ } else {
+ completer.completeError(e);
+ }
}
});

Powered by Google App Engine
This is Rietveld 408576698