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

Side by Side Diff: tools/dom/templates/html/impl/impl_XMLHttpRequest.darttemplate

Issue 12114042: Fixing dartium xhr issue (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:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 * * Using credentials is only useful for cross-origin requests. 67 * * Using credentials is only useful for cross-origin requests.
68 * * The `Access-Control-Allow-Origin` header of `url` cannot contain a wildca rd (*). 68 * * The `Access-Control-Allow-Origin` header of `url` cannot contain a wildca rd (*).
69 * * The `Access-Control-Allow-Credentials` header of `url` must be set to tru e. 69 * * The `Access-Control-Allow-Credentials` header of `url` must be set to tru e.
70 * * If `Access-Control-Expose-Headers` has not been set to true, only a subse t of all the response headers will be returned when calling [getAllRequestHeader s]. 70 * * If `Access-Control-Expose-Headers` has not been set to true, only a subse t of all the response headers will be returned when calling [getAllRequestHeader s].
71 * 71 *
72 * See also: [authorization headers](http://en.wikipedia.org/wiki/Basic_access _authentication). 72 * See also: [authorization headers](http://en.wikipedia.org/wiki/Basic_access _authentication).
73 */ 73 */
74 static Future<HttpRequest> request(String url, 74 static Future<HttpRequest> request(String url,
75 {String method, bool withCredentials, String responseType, sendData, 75 {String method, bool withCredentials, String responseType, sendData,
76 void onProgress(ProgressEvent e)}) { 76 void onProgress(ProgressEvent e)}) {
77 var completer = new Completer<String>(); 77 var completer = new Completer<HttpRequest>();
78 78
79 var xhr = new HttpRequest(); 79 var xhr = new HttpRequest();
80 if (method == null) { 80 if (method == null) {
81 method = 'GET'; 81 method = 'GET';
82 } 82 }
83 xhr.open(method, url, true); 83 xhr.open(method, url, true);
84 84
85 if (withCredentials != null) { 85 if (withCredentials != null) {
86 xhr.withCredentials = withCredentials; 86 xhr.withCredentials = withCredentials;
87 } 87 }
(...skipping 23 matching lines...) Expand all
111 xhr.send(sendData); 111 xhr.send(sendData);
112 } else { 112 } else {
113 xhr.send(); 113 xhr.send();
114 } 114 }
115 115
116 return completer.future; 116 return completer.future;
117 } 117 }
118 118
119 $!MEMBERS 119 $!MEMBERS
120 } 120 }
OLDNEW
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698