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

Unified Diff: sdk/lib/html/dart2js/html_dart2js.dart

Issue 11800002: "Reverting 16675-16676, 71-73" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 12 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 | « samples/tests/samples/samples.status ('k') | sdk/lib/html/dartium/html_dartium.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/html/dart2js/html_dart2js.dart
diff --git a/sdk/lib/html/dart2js/html_dart2js.dart b/sdk/lib/html/dart2js/html_dart2js.dart
index 7bbd8de8d2117191854f41132ef2ad6e302c198d..5e169881d3a5889652485ba975ca5a6e0c53be93 100644
--- a/sdk/lib/html/dart2js/html_dart2js.dart
+++ b/sdk/lib/html/dart2js/html_dart2js.dart
@@ -24024,25 +24024,18 @@ class _HttpRequestUtils {
// Helper for factory HttpRequest.get
static HttpRequest get(String url,
- onComplete(HttpRequest request),
+ onSuccess(HttpRequest request),
bool withCredentials) {
final request = new HttpRequest();
request.open('GET', url, true);
request.withCredentials = withCredentials;
+ // Status 0 is for local XHR request.
request.on.readyStateChange.add((e) {
- if (request.readyState == HttpRequest.DONE) {
- // TODO(efortuna): Previously HttpRequest.get only invoked the callback
- // when request.status was 0 or 200. This
- // causes two problems 1) request.status = 0 for ANY local XHR request
- // (file found or not found) 2) the user facing function claims that the
- // callback is called on completion of the request, regardless of
- // status. Because the new event model is coming in soon, rather than
- // fixing the callbacks version, we just need to revisit the desired
- // behavior when we're using streams/futures.
- // Status 0 is for local XHR request.
- onComplete(request);
+ if (request.readyState == HttpRequest.DONE &&
+ (request.status == 200 || request.status == 0)) {
+ onSuccess(request);
}
});
« no previous file with comments | « samples/tests/samples/samples.status ('k') | sdk/lib/html/dartium/html_dartium.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698