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

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..fdaa13b9329669a0b7446969a39ab8227bbde206 100644
--- a/sdk/lib/html/dartium/html_dartium.dart
+++ b/sdk/lib/html/dartium/html_dartium.dart
@@ -13711,6 +13711,11 @@ class HttpRequest extends EventTarget {
* * The `Access-Control-Allow-Credentials` header of `url` must be set to true.
* * If `Access-Control-Expose-Headers` has not been set to true, only a subset of all the response headers will be returned when calling [getAllRequestHeaders].
*
+ * Note that requests for file:// URIs are only supported by Chrome extensions
+ * with appropriate permissions in their manifest. Requests to file:// URIs
+ * will also never fail- the Future will always complete successfully, even
+ * when the file cannot be found.
+ *
* See also: [authorization headers](http://en.wikipedia.org/wiki/Basic_access_authentication).
*/
static Future<HttpRequest> request(String url,
@@ -13737,8 +13742,9 @@ class HttpRequest extends EventTarget {
}
xhr.onLoad.listen((e) {
- if (xhr.status >= 200 && xhr.status < 300 ||
- xhr.status == 304 ) {
+ // Note: file:// URIs have status of 0.
+ if ((xhr.status >= 200 && xhr.status < 300) ||
+ xhr.status == 0 || xhr.status == 304) {
completer.complete(xhr);
} else {
completer.completeError(e);
« no previous file with comments | « sdk/lib/html/dart2js/html_dart2js.dart ('k') | tools/dom/templates/html/impl/impl_XMLHttpRequest.darttemplate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698