| 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 1006 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1017 if (!m_loader) | 1017 if (!m_loader) |
| 1018 return true; | 1018 return true; |
| 1019 | 1019 |
| 1020 // Cancelling the ThreadableLoader m_loader may result in calling | 1020 // Cancelling the ThreadableLoader m_loader may result in calling |
| 1021 // window.onload synchronously. If such an onload handler contains open() | 1021 // window.onload synchronously. If such an onload handler contains open() |
| 1022 // call on the same XMLHttpRequest object, reentry happens. | 1022 // call on the same XMLHttpRequest object, reentry happens. |
| 1023 // | 1023 // |
| 1024 // If, window.onload contains open() and send(), m_loader will be set to | 1024 // If, window.onload contains open() and send(), m_loader will be set to |
| 1025 // non 0 value. So, we cannot continue the outer open(). In such case, | 1025 // non 0 value. So, we cannot continue the outer open(). In such case, |
| 1026 // just abort the outer open() by returning false. | 1026 // just abort the outer open() by returning false. |
| 1027 ThreadableLoader* loader = m_loader.release(); | 1027 std::unique_ptr<ThreadableLoader> loader = std::move(m_loader); |
| 1028 loader->cancel(); | 1028 loader->cancel(); |
| 1029 | 1029 |
| 1030 // If abort() called internalAbort() and a nested open() ended up | 1030 // If abort() called internalAbort() and a nested open() ended up |
| 1031 // clearing the error flag, but didn't send(), make sure the error | 1031 // clearing the error flag, but didn't send(), make sure the error |
| 1032 // flag is still set. | 1032 // flag is still set. |
| 1033 bool newLoadStarted = m_loader.get(); | 1033 bool newLoadStarted = m_loader.get(); |
| 1034 if (!newLoadStarted) | 1034 if (!newLoadStarted) |
| 1035 m_error = true; | 1035 m_error = true; |
| 1036 | 1036 |
| 1037 return !newLoadStarted; | 1037 return !newLoadStarted; |
| (...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1698 | 1698 |
| 1699 ExecutionContext* XMLHttpRequest::getExecutionContext() const | 1699 ExecutionContext* XMLHttpRequest::getExecutionContext() const |
| 1700 { | 1700 { |
| 1701 return ActiveDOMObject::getExecutionContext(); | 1701 return ActiveDOMObject::getExecutionContext(); |
| 1702 } | 1702 } |
| 1703 | 1703 |
| 1704 DEFINE_TRACE(XMLHttpRequest) | 1704 DEFINE_TRACE(XMLHttpRequest) |
| 1705 { | 1705 { |
| 1706 visitor->trace(m_responseBlob); | 1706 visitor->trace(m_responseBlob); |
| 1707 visitor->trace(m_responseLegacyStream); | 1707 visitor->trace(m_responseLegacyStream); |
| 1708 visitor->trace(m_loader); | |
| 1709 visitor->trace(m_responseDocument); | 1708 visitor->trace(m_responseDocument); |
| 1710 visitor->trace(m_responseDocumentParser); | 1709 visitor->trace(m_responseDocumentParser); |
| 1711 visitor->trace(m_responseArrayBuffer); | 1710 visitor->trace(m_responseArrayBuffer); |
| 1712 visitor->trace(m_progressEventThrottle); | 1711 visitor->trace(m_progressEventThrottle); |
| 1713 visitor->trace(m_upload); | 1712 visitor->trace(m_upload); |
| 1714 visitor->trace(m_blobLoader); | 1713 visitor->trace(m_blobLoader); |
| 1715 XMLHttpRequestEventTarget::trace(visitor); | 1714 XMLHttpRequestEventTarget::trace(visitor); |
| 1716 DocumentParserClient::trace(visitor); | 1715 DocumentParserClient::trace(visitor); |
| 1717 ActiveDOMObject::trace(visitor); | 1716 ActiveDOMObject::trace(visitor); |
| 1718 } | 1717 } |
| 1719 | 1718 |
| 1720 DEFINE_TRACE_WRAPPERS(XMLHttpRequest) | 1719 DEFINE_TRACE_WRAPPERS(XMLHttpRequest) |
| 1721 { | 1720 { |
| 1722 visitor->traceWrappers(m_responseBlob); | 1721 visitor->traceWrappers(m_responseBlob); |
| 1723 visitor->traceWrappers(m_responseLegacyStream); | 1722 visitor->traceWrappers(m_responseLegacyStream); |
| 1724 visitor->traceWrappers(m_responseDocument); | 1723 visitor->traceWrappers(m_responseDocument); |
| 1725 visitor->traceWrappers(m_responseArrayBuffer); | 1724 visitor->traceWrappers(m_responseArrayBuffer); |
| 1726 } | 1725 } |
| 1727 | 1726 |
| 1728 } // namespace blink | 1727 } // namespace blink |
| OLD | NEW |