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 1450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1461 | 1461 |
1462 void XMLHttpRequest::didFail(const ResourceError& error) { | 1462 void XMLHttpRequest::didFail(const ResourceError& error) { |
1463 NETWORK_DVLOG(1) << this << " didFail()"; | 1463 NETWORK_DVLOG(1) << this << " didFail()"; |
1464 ScopedEventDispatchProtect protect(&m_eventDispatchRecursionLevel); | 1464 ScopedEventDispatchProtect protect(&m_eventDispatchRecursionLevel); |
1465 | 1465 |
1466 // If we are already in an error state, for instance we called abort(), bail | 1466 // If we are already in an error state, for instance we called abort(), bail |
1467 // out early. | 1467 // out early. |
1468 if (m_error) | 1468 if (m_error) |
1469 return; | 1469 return; |
1470 | 1470 |
1471 // Internally, access check violations are considered `cancellations`, but | 1471 if (error.isCancellation()) { |
1472 // at least the mixed-content and CSP specs require them to be surfaced as | |
1473 // network errors to the page. See: | |
1474 // [1] https://www.w3.org/TR/mixed-content/#algorithms, | |
1475 // [2] https://www.w3.org/TR/CSP3/#fetch-integration. | |
1476 if (error.isCancellation() && !error.isAccessCheck()) { | |
1477 handleDidCancel(); | 1472 handleDidCancel(); |
1478 return; | 1473 return; |
1479 } | 1474 } |
1480 | 1475 |
1481 if (error.isTimeout()) { | 1476 if (error.isTimeout()) { |
1482 handleDidTimeout(); | 1477 handleDidTimeout(); |
1483 return; | 1478 return; |
1484 } | 1479 } |
1485 | 1480 |
1486 // Network failures are already reported to Web Inspector by ResourceLoader. | 1481 // Network failures are already reported to Web Inspector by ResourceLoader. |
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1856 visitor->traceWrappers(m_responseLegacyStream); | 1851 visitor->traceWrappers(m_responseLegacyStream); |
1857 visitor->traceWrappers(m_responseDocument); | 1852 visitor->traceWrappers(m_responseDocument); |
1858 visitor->traceWrappers(m_responseArrayBuffer); | 1853 visitor->traceWrappers(m_responseArrayBuffer); |
1859 } | 1854 } |
1860 | 1855 |
1861 std::ostream& operator<<(std::ostream& ostream, const XMLHttpRequest* xhr) { | 1856 std::ostream& operator<<(std::ostream& ostream, const XMLHttpRequest* xhr) { |
1862 return ostream << "XMLHttpRequest " << static_cast<const void*>(xhr); | 1857 return ostream << "XMLHttpRequest " << static_cast<const void*>(xhr); |
1863 } | 1858 } |
1864 | 1859 |
1865 } // namespace blink | 1860 } // namespace blink |
OLD | NEW |