Chromium Code Reviews| 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 25626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 25637 }; | 25637 }; |
| 25638 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 25638 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 25639 // for details. All rights reserved. Use of this source code is governed by a | 25639 // for details. All rights reserved. Use of this source code is governed by a |
| 25640 // BSD-style license that can be found in the LICENSE file. | 25640 // BSD-style license that can be found in the LICENSE file. |
| 25641 | 25641 |
| 25642 | 25642 |
| 25643 class _HttpRequestUtils { | 25643 class _HttpRequestUtils { |
| 25644 | 25644 |
| 25645 // Helper for factory HttpRequest.get | 25645 // Helper for factory HttpRequest.get |
| 25646 static HttpRequest get(String url, | 25646 static HttpRequest get(String url, |
| 25647 onSuccess(HttpRequest request), | 25647 onComplete(HttpRequest request), |
|
ricow1
2013/01/10 20:03:41
indentation
| |
| 25648 bool withCredentials) { | 25648 bool withCredentials) { |
| 25649 final request = new HttpRequest(); | 25649 final request = new HttpRequest(); |
| 25650 request.open('GET', url, true); | 25650 request.open('GET', url, true); |
| 25651 | 25651 |
| 25652 request.withCredentials = withCredentials; | 25652 request.withCredentials = withCredentials; |
| 25653 | 25653 |
| 25654 // Status 0 is for local XHR request. | |
| 25655 request.on.readyStateChange.add((e) { | 25654 request.on.readyStateChange.add((e) { |
| 25656 if (request.readyState == HttpRequest.DONE && | 25655 if (request.readyState == HttpRequest.DONE) { |
| 25657 (request.status == 200 || request.status == 0)) { | 25656 onComplete(request); |
| 25658 onSuccess(request); | |
| 25659 } | 25657 } |
| 25660 }); | 25658 }); |
| 25661 | 25659 |
| 25662 request.send(); | 25660 request.send(); |
| 25663 | 25661 |
| 25664 return request; | 25662 return request; |
| 25665 } | 25663 } |
| 25666 } | 25664 } |
| 25667 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 25665 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 25668 // for details. All rights reserved. Use of this source code is governed by a | 25666 // for details. All rights reserved. Use of this source code is governed by a |
| (...skipping 1268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 26937 _position = nextPosition; | 26935 _position = nextPosition; |
| 26938 return true; | 26936 return true; |
| 26939 } | 26937 } |
| 26940 _current = null; | 26938 _current = null; |
| 26941 _position = _array.length; | 26939 _position = _array.length; |
| 26942 return false; | 26940 return false; |
| 26943 } | 26941 } |
| 26944 | 26942 |
| 26945 T get current => _current; | 26943 T get current => _current; |
| 26946 } | 26944 } |
| OLD | NEW |