OLD | NEW |
1 library html; | 1 library html; |
2 | 2 |
3 import 'dart:async'; | 3 import 'dart:async'; |
4 import 'dart:collection'; | 4 import 'dart:collection'; |
5 import 'dart:html_common'; | 5 import 'dart:html_common'; |
6 import 'dart:indexed_db'; | 6 import 'dart:indexed_db'; |
7 import 'dart:isolate'; | 7 import 'dart:isolate'; |
8 import 'dart:json' as json; | 8 import 'dart:json' as json; |
9 import 'dart:math'; | 9 import 'dart:math'; |
10 import 'dart:svg' as svg; | 10 import 'dart:svg' as svg; |
(...skipping 25661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
25672 }; | 25672 }; |
25673 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 25673 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
25674 // for details. All rights reserved. Use of this source code is governed by a | 25674 // for details. All rights reserved. Use of this source code is governed by a |
25675 // BSD-style license that can be found in the LICENSE file. | 25675 // BSD-style license that can be found in the LICENSE file. |
25676 | 25676 |
25677 | 25677 |
25678 class _HttpRequestUtils { | 25678 class _HttpRequestUtils { |
25679 | 25679 |
25680 // Helper for factory HttpRequest.get | 25680 // Helper for factory HttpRequest.get |
25681 static HttpRequest get(String url, | 25681 static HttpRequest get(String url, |
25682 onSuccess(HttpRequest request), | 25682 onComplete(HttpRequest request), |
25683 bool withCredentials) { | 25683 bool withCredentials) { |
25684 final request = new HttpRequest(); | 25684 final request = new HttpRequest(); |
25685 request.open('GET', url, true); | 25685 request.open('GET', url, true); |
25686 | 25686 |
25687 request.withCredentials = withCredentials; | 25687 request.withCredentials = withCredentials; |
25688 | 25688 |
25689 // Status 0 is for local XHR request. | |
25690 request.on.readyStateChange.add((e) { | 25689 request.on.readyStateChange.add((e) { |
25691 if (request.readyState == HttpRequest.DONE && | 25690 if (request.readyState == HttpRequest.DONE) { |
25692 (request.status == 200 || request.status == 0)) { | 25691 onComplete(request); |
25693 onSuccess(request); | |
25694 } | 25692 } |
25695 }); | 25693 }); |
25696 | 25694 |
25697 request.send(); | 25695 request.send(); |
25698 | 25696 |
25699 return request; | 25697 return request; |
25700 } | 25698 } |
25701 } | 25699 } |
25702 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 25700 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
25703 // for details. All rights reserved. Use of this source code is governed by a | 25701 // for details. All rights reserved. Use of this source code is governed by a |
(...skipping 1287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
26991 _position = nextPosition; | 26989 _position = nextPosition; |
26992 return true; | 26990 return true; |
26993 } | 26991 } |
26994 _current = null; | 26992 _current = null; |
26995 _position = _array.length; | 26993 _position = _array.length; |
26996 return false; | 26994 return false; |
26997 } | 26995 } |
26998 | 26996 |
26999 T get current => _current; | 26997 T get current => _current; |
27000 } | 26998 } |
OLD | NEW |