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 std::unique_ptr<ThreadableLoader> loader = std::move(m_loader); | 1027 ThreadableLoader* loader = m_loader; |
haraken
2016/07/29 14:52:51
loader = m_loader.release()
yhirano
2016/08/01 06:20:06
Done.
| |
1028 m_loader = nullptr; | |
1028 loader->cancel(); | 1029 loader->cancel(); |
1029 | 1030 |
1030 // If abort() called internalAbort() and a nested open() ended up | 1031 // If abort() called internalAbort() and a nested open() ended up |
1031 // clearing the error flag, but didn't send(), make sure the error | 1032 // clearing the error flag, but didn't send(), make sure the error |
1032 // flag is still set. | 1033 // flag is still set. |
1033 bool newLoadStarted = m_loader.get(); | 1034 bool newLoadStarted = m_loader.get(); |
1034 if (!newLoadStarted) | 1035 if (!newLoadStarted) |
1035 m_error = true; | 1036 m_error = true; |
1036 | 1037 |
1037 return !newLoadStarted; | 1038 return !newLoadStarted; |
(...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1698 | 1699 |
1699 ExecutionContext* XMLHttpRequest::getExecutionContext() const | 1700 ExecutionContext* XMLHttpRequest::getExecutionContext() const |
1700 { | 1701 { |
1701 return ActiveDOMObject::getExecutionContext(); | 1702 return ActiveDOMObject::getExecutionContext(); |
1702 } | 1703 } |
1703 | 1704 |
1704 DEFINE_TRACE(XMLHttpRequest) | 1705 DEFINE_TRACE(XMLHttpRequest) |
1705 { | 1706 { |
1706 visitor->trace(m_responseBlob); | 1707 visitor->trace(m_responseBlob); |
1707 visitor->trace(m_responseLegacyStream); | 1708 visitor->trace(m_responseLegacyStream); |
1709 visitor->trace(m_loader); | |
1708 visitor->trace(m_responseDocument); | 1710 visitor->trace(m_responseDocument); |
1709 visitor->trace(m_responseDocumentParser); | 1711 visitor->trace(m_responseDocumentParser); |
1710 visitor->trace(m_responseArrayBuffer); | 1712 visitor->trace(m_responseArrayBuffer); |
1711 visitor->trace(m_progressEventThrottle); | 1713 visitor->trace(m_progressEventThrottle); |
1712 visitor->trace(m_upload); | 1714 visitor->trace(m_upload); |
1713 visitor->trace(m_blobLoader); | 1715 visitor->trace(m_blobLoader); |
1714 XMLHttpRequestEventTarget::trace(visitor); | 1716 XMLHttpRequestEventTarget::trace(visitor); |
1715 DocumentParserClient::trace(visitor); | 1717 DocumentParserClient::trace(visitor); |
1716 ActiveDOMObject::trace(visitor); | 1718 ActiveDOMObject::trace(visitor); |
1717 } | 1719 } |
1718 | 1720 |
1719 DEFINE_TRACE_WRAPPERS(XMLHttpRequest) | 1721 DEFINE_TRACE_WRAPPERS(XMLHttpRequest) |
1720 { | 1722 { |
1721 visitor->traceWrappers(m_responseBlob); | 1723 visitor->traceWrappers(m_responseBlob); |
1722 visitor->traceWrappers(m_responseLegacyStream); | 1724 visitor->traceWrappers(m_responseLegacyStream); |
1723 visitor->traceWrappers(m_responseDocument); | 1725 visitor->traceWrappers(m_responseDocument); |
1724 visitor->traceWrappers(m_responseArrayBuffer); | 1726 visitor->traceWrappers(m_responseArrayBuffer); |
1725 } | 1727 } |
1726 | 1728 |
1727 } // namespace blink | 1729 } // namespace blink |
OLD | NEW |