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