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

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

Issue 12845008: Adding CORS support to HttpRequest (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 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
« no previous file with comments | « no previous file | 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 0f07ca96b9208a8af3a36809553888bb23cf3d9d..3307880ea481c3faa44d529021bc9f7b4d8709af 100644
--- a/sdk/lib/html/dart2js/html_dart2js.dart
+++ b/sdk/lib/html/dart2js/html_dart2js.dart
@@ -13230,7 +13230,19 @@ class HttpRequest extends EventTarget native "*XMLHttpRequest" {
*/
static bool get supportsProgressEvent {
var xhr = new HttpRequest();
- return JS('bool', '"onprogress" in #', xhr);
+ return JS('bool', '("onprogress" in #)', xhr);
+ }
+
+ /**
+ * Checks to see if the current platform supports making cross origin
+ * requests.
+ *
+ * Note that even if cross origin requests are supported, they still may fail
+ * if the destination server does not support CORS requests.
+ */
+ static bool get supportsCrossOrigin {
+ var xhr = new HttpRequest();
+ return JS('bool', '("withCredentials" in #)', xhr);
}
/**
@@ -13238,7 +13250,7 @@ class HttpRequest extends EventTarget native "*XMLHttpRequest" {
*/
static bool get supportsLoadEndEvent {
var xhr = new HttpRequest();
- return JS('bool', '"onloadend" in #', xhr);
+ return JS('bool', '("onloadend" in #)', xhr);
}
« no previous file with comments | « no previous file | sdk/lib/html/dartium/html_dartium.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698