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

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

Issue 23441013: Attempting to fix IE9 XHR cross domain flakiness. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 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 | « tests/html/html.status ('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 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 var xhr = JS('var', 'new XDomainRequest()'); 243 var xhr = JS('var', 'new XDomainRequest()');
244 JS('', '#.open(#, #)', xhr, method, url); 244 JS('', '#.open(#, #)', xhr, method, url);
245 JS('', '#.onload = #', xhr, convertDartClosureToJS((e) { 245 JS('', '#.onload = #', xhr, convertDartClosureToJS((e) {
246 var response = JS('String', '#.responseText', xhr); 246 var response = JS('String', '#.responseText', xhr);
247 completer.complete(response); 247 completer.complete(response);
248 }, 1)); 248 }, 1));
249 JS('', '#.onerror = #', xhr, convertDartClosureToJS((e) { 249 JS('', '#.onerror = #', xhr, convertDartClosureToJS((e) {
250 completer.completeError(e); 250 completer.completeError(e);
251 }, 1)); 251 }, 1));
252 252
253 // IE9 RTM - XDomainRequest issued requests may abort if all event handlers
254 // not specified
255 // http://social.msdn.microsoft.com/Forums/ie/en-US/30ef3add-767c-4436-b8a9- f1ca19b4812e/ie9-rtm-xdomainrequest-issued-requests-may-abort-if-all-event-handl ers-not-specified
256 JS('', '#.onprogress = {}', xhr);
257 JS('', '#.ontimeout = {}', xhr);
258 JS('', '#.timeout = Number.MAX_VALUE', xhr);
259
253 if (sendData != null) { 260 if (sendData != null) {
254 JS('', '#.send(#)', xhr, sendData); 261 JS('', '#.send(#)', xhr, sendData);
255 } else { 262 } else {
256 JS('', '#.send()', xhr); 263 JS('', '#.send()', xhr);
257 } 264 }
258 265
259 return completer.future; 266 return completer.future;
260 $endif 267 $endif
261 } 268 }
262 269
263 $!MEMBERS 270 $!MEMBERS
264 } 271 }
OLDNEW
« no previous file with comments | « tests/html/html.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698