OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2006, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2006, 2008 Apple Inc. All rights reserved. |
3 * Copyright (C) 2005-2007 Alexey Proskuryakov <ap@webkit.org> | 3 * Copyright (C) 2005-2007 Alexey Proskuryakov <ap@webkit.org> |
4 * Copyright (C) 2007, 2008 Julien Chaffraix <jchaffraix@webkit.org> | 4 * Copyright (C) 2007, 2008 Julien Chaffraix <jchaffraix@webkit.org> |
5 * Copyright (C) 2008, 2011 Google Inc. All rights reserved. | 5 * Copyright (C) 2008, 2011 Google Inc. All rights reserved. |
6 * Copyright (C) 2012 Intel Corporation | 6 * Copyright (C) 2012 Intel Corporation |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Lesser General Public | 9 * modify it under the terms of the GNU Lesser General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 } | 339 } |
340 | 340 |
341 void XMLHttpRequest::setTimeout(unsigned long timeout, ExceptionState& exception
State) | 341 void XMLHttpRequest::setTimeout(unsigned long timeout, ExceptionState& exception
State) |
342 { | 342 { |
343 // FIXME: Need to trigger or update the timeout Timer here, if needed. http:
//webkit.org/b/98156 | 343 // FIXME: Need to trigger or update the timeout Timer here, if needed. http:
//webkit.org/b/98156 |
344 // XHR2 spec, 4.7.3. "This implies that the timeout attribute can be set whi
le fetching is in progress. If that occurs it will still be measured relative to
the start of fetching." | 344 // XHR2 spec, 4.7.3. "This implies that the timeout attribute can be set whi
le fetching is in progress. If that occurs it will still be measured relative to
the start of fetching." |
345 if (executionContext()->isDocument() && !m_async) { | 345 if (executionContext()->isDocument() && !m_async) { |
346 exceptionState.throwDOMException(InvalidAccessError, "Timeouts cannot be
set for synchronous requests made from a document."); | 346 exceptionState.throwDOMException(InvalidAccessError, "Timeouts cannot be
set for synchronous requests made from a document."); |
347 return; | 347 return; |
348 } | 348 } |
349 | |
350 m_timeoutMilliseconds = timeout; | 349 m_timeoutMilliseconds = timeout; |
351 | |
352 // From http://www.w3.org/TR/XMLHttpRequest/#the-timeout-attribute: | |
353 // Note: This implies that the timeout attribute can be set while fetching i
s in progress. If | |
354 // that occurs it will still be measured relative to the start of fetching. | |
355 // | |
356 // The timeout may be overridden after send. | |
357 if (m_loader) | |
358 m_loader->overrideTimeout(timeout); | |
359 } | 350 } |
360 | 351 |
361 void XMLHttpRequest::setResponseType(const String& responseType, ExceptionState&
exceptionState) | 352 void XMLHttpRequest::setResponseType(const String& responseType, ExceptionState&
exceptionState) |
362 { | 353 { |
363 if (m_state >= LOADING) { | 354 if (m_state >= LOADING) { |
364 exceptionState.throwDOMException(InvalidStateError, "The response type c
annot be set if the object's state is LOADING or DONE."); | 355 exceptionState.throwDOMException(InvalidStateError, "The response type c
annot be set if the object's state is LOADING or DONE."); |
365 return; | 356 return; |
366 } | 357 } |
367 | 358 |
368 // Newer functionality is not available to synchronous requests in window co
ntexts, as a spec-mandated | 359 // Newer functionality is not available to synchronous requests in window co
ntexts, as a spec-mandated |
(...skipping 1103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1472 { | 1463 { |
1473 visitor->trace(m_responseBlob); | 1464 visitor->trace(m_responseBlob); |
1474 visitor->trace(m_responseStream); | 1465 visitor->trace(m_responseStream); |
1475 visitor->trace(m_responseDocument); | 1466 visitor->trace(m_responseDocument); |
1476 visitor->trace(m_progressEventThrottle); | 1467 visitor->trace(m_progressEventThrottle); |
1477 visitor->trace(m_upload); | 1468 visitor->trace(m_upload); |
1478 XMLHttpRequestEventTarget::trace(visitor); | 1469 XMLHttpRequestEventTarget::trace(visitor); |
1479 } | 1470 } |
1480 | 1471 |
1481 } // namespace WebCore | 1472 } // namespace WebCore |
OLD | NEW |