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 1454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1465 m_parsedResponse = true; | 1465 m_parsedResponse = true; |
1466 | 1466 |
1467 endLoading(); | 1467 endLoading(); |
1468 } | 1468 } |
1469 | 1469 |
1470 void XMLHttpRequest::endLoading() | 1470 void XMLHttpRequest::endLoading() |
1471 { | 1471 { |
1472 InspectorInstrumentation::didFinishXHRLoading(getExecutionContext(), this, t
his, m_method, m_url); | 1472 InspectorInstrumentation::didFinishXHRLoading(getExecutionContext(), this, t
his, m_method, m_url); |
1473 | 1473 |
1474 if (m_loader) { | 1474 if (m_loader) { |
| 1475 const bool hasError = m_error; |
| 1476 // Set |m_error| in order to suppress the cancel notification (see |
| 1477 // XMLHttpRequest::didFail). |
| 1478 m_error = true; |
1475 m_loader->cancel(); | 1479 m_loader->cancel(); |
| 1480 m_error = hasError; |
1476 m_loader = nullptr; | 1481 m_loader = nullptr; |
1477 } | 1482 } |
1478 | 1483 |
1479 changeState(kDone); | 1484 changeState(kDone); |
1480 | 1485 |
1481 if (!getExecutionContext()->isDocument() || !document() || !document()->fram
e() || !document()->frame()->page()) | 1486 if (!getExecutionContext()->isDocument() || !document() || !document()->fram
e() || !document()->frame()->page()) |
1482 return; | 1487 return; |
1483 | 1488 |
1484 if (status() >= 200 && status() < 300) { | 1489 if (status() >= 200 && status() < 300) { |
1485 document()->frame()->page()->chromeClient().ajaxSucceeded(document()->fr
ame()); | 1490 document()->frame()->page()->chromeClient().ajaxSucceeded(document()->fr
ame()); |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1718 visitor->traceWrappers(m_responseDocument); | 1723 visitor->traceWrappers(m_responseDocument); |
1719 visitor->traceWrappers(m_responseArrayBuffer); | 1724 visitor->traceWrappers(m_responseArrayBuffer); |
1720 } | 1725 } |
1721 | 1726 |
1722 std::ostream& operator<<(std::ostream& ostream, const XMLHttpRequest* xhr) | 1727 std::ostream& operator<<(std::ostream& ostream, const XMLHttpRequest* xhr) |
1723 { | 1728 { |
1724 return ostream << "XMLHttpRequest " << static_cast<const void*>(xhr); | 1729 return ostream << "XMLHttpRequest " << static_cast<const void*>(xhr); |
1725 } | 1730 } |
1726 | 1731 |
1727 } // namespace blink | 1732 } // namespace blink |
OLD | NEW |