OLD | NEW |
---|---|
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 part of $LIBRARYNAME; | 5 part of $LIBRARYNAME; |
6 | 6 |
7 /** | 7 /** |
8 * A utility for retrieving data from a URL. | 8 * A utility for retrieving data from a URL. |
9 * | 9 * |
10 * HttpRequest can be used to obtain data from http, ftp, and file | 10 * HttpRequest can be used to obtain data from http, ftp, and file |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
115 | 115 |
116 if (sendData != null) { | 116 if (sendData != null) { |
117 xhr.send(sendData); | 117 xhr.send(sendData); |
118 } else { | 118 } else { |
119 xhr.send(); | 119 xhr.send(); |
120 } | 120 } |
121 | 121 |
122 return completer.future; | 122 return completer.future; |
123 } | 123 } |
124 | 124 |
125 /** | |
126 * Checks to see if the Progress event is supported on the current platform. | |
127 */ | |
128 static bool get supportsProgressEvent { | |
129 $if DART2JS | |
130 var xhr = new HttpRequest(); | |
131 return JS('bool', '"onprogress" in #', xhr); | |
132 $else | |
133 return true; | |
134 $endif | |
135 } | |
136 | |
137 /** | |
138 * Checks to see if the LoadEnd event is supported on the current platform. | |
139 */ | |
140 static bool get supportsLoadEndEvent { | |
Emily Fortuna
2013/02/14 23:51:41
can these be added to the table of js_support_chec
| |
141 $if DART2JS | |
142 var xhr = new HttpRequest(); | |
143 return JS('bool', '"onloadend" in #', xhr); | |
144 $else | |
145 return true; | |
146 $endif | |
147 } | |
148 | |
125 $!MEMBERS | 149 $!MEMBERS |
126 } | 150 } |
OLD | NEW |