| 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 587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 598 if (m_responseTypeCode != ResponseTypeDefault) { | 598 if (m_responseTypeCode != ResponseTypeDefault) { |
| 599 exceptionState.throwDOMException(InvalidAccessError, "Synchronous re
quests from a document must not set a response type."); | 599 exceptionState.throwDOMException(InvalidAccessError, "Synchronous re
quests from a document must not set a response type."); |
| 600 return; | 600 return; |
| 601 } | 601 } |
| 602 | 602 |
| 603 // Similarly, timeouts are disabled for synchronous requests as well. | 603 // Similarly, timeouts are disabled for synchronous requests as well. |
| 604 if (m_timeoutMilliseconds > 0) { | 604 if (m_timeoutMilliseconds > 0) { |
| 605 exceptionState.throwDOMException(InvalidAccessError, "Synchronous re
quests must not set a timeout."); | 605 exceptionState.throwDOMException(InvalidAccessError, "Synchronous re
quests must not set a timeout."); |
| 606 return; | 606 return; |
| 607 } | 607 } |
| 608 |
| 609 // Here we just warn that firing sync XHR's may affect responsiveness. |
| 610 // Eventually sync xhr will be deprecated and an "InvalidAccessError" ex
ception thrown. |
| 611 // Refer : https://xhr.spec.whatwg.org/#sync-warning |
| 612 // Use count for XHR synchronous requests on main thread only. |
| 613 if (!document()->processingBeforeUnload()) |
| 614 UseCounter::countDeprecation(executionContext(), UseCounter::XMLHttp
RequestSynchronousInNonWorkerOutsideBeforeUnload); |
| 608 } | 615 } |
| 609 | 616 |
| 610 m_method = FetchUtils::normalizeMethod(method); | 617 m_method = FetchUtils::normalizeMethod(method); |
| 611 | 618 |
| 612 m_url = url; | 619 m_url = url; |
| 613 | 620 |
| 614 m_async = async; | 621 m_async = async; |
| 615 | 622 |
| 616 ASSERT(!m_loader); | 623 ASSERT(!m_loader); |
| 617 | 624 |
| (...skipping 1034 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1652 visitor->trace(m_responseDocument); | 1659 visitor->trace(m_responseDocument); |
| 1653 visitor->trace(m_responseDocumentParser); | 1660 visitor->trace(m_responseDocumentParser); |
| 1654 visitor->trace(m_progressEventThrottle); | 1661 visitor->trace(m_progressEventThrottle); |
| 1655 visitor->trace(m_upload); | 1662 visitor->trace(m_upload); |
| 1656 visitor->trace(m_blobLoader); | 1663 visitor->trace(m_blobLoader); |
| 1657 XMLHttpRequestEventTarget::trace(visitor); | 1664 XMLHttpRequestEventTarget::trace(visitor); |
| 1658 DocumentParserClient::trace(visitor); | 1665 DocumentParserClient::trace(visitor); |
| 1659 } | 1666 } |
| 1660 | 1667 |
| 1661 } // namespace blink | 1668 } // namespace blink |
| OLD | NEW |