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 1770 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1781 } | 1781 } |
1782 | 1782 |
1783 void XMLHttpRequest::suspend() { | 1783 void XMLHttpRequest::suspend() { |
1784 m_progressEventThrottle->suspend(); | 1784 m_progressEventThrottle->suspend(); |
1785 } | 1785 } |
1786 | 1786 |
1787 void XMLHttpRequest::resume() { | 1787 void XMLHttpRequest::resume() { |
1788 m_progressEventThrottle->resume(); | 1788 m_progressEventThrottle->resume(); |
1789 } | 1789 } |
1790 | 1790 |
1791 void XMLHttpRequest::stop() { | 1791 void XMLHttpRequest::contextDestroyed() { |
1792 InspectorInstrumentation::didFailXHRLoading(getExecutionContext(), this, this, | 1792 InspectorInstrumentation::didFailXHRLoading(getExecutionContext(), this, this, |
1793 m_method, m_url); | 1793 m_method, m_url); |
1794 m_progressEventThrottle->stop(); | 1794 m_progressEventThrottle->stop(); |
1795 internalAbort(); | 1795 internalAbort(); |
1796 } | 1796 } |
1797 | 1797 |
1798 bool XMLHttpRequest::hasPendingActivity() const { | 1798 bool XMLHttpRequest::hasPendingActivity() const { |
1799 // Neither this object nor the JavaScript wrapper should be deleted while | 1799 // Neither this object nor the JavaScript wrapper should be deleted while |
1800 // a request is in progress because we need to keep the listeners alive, | 1800 // a request is in progress because we need to keep the listeners alive, |
1801 // and they are referenced by the JavaScript wrapper. | 1801 // and they are referenced by the JavaScript wrapper. |
1802 // |m_loader| is non-null while request is active and ThreadableLoaderClient | 1802 // |m_loader| is non-null while request is active and ThreadableLoaderClient |
1803 // callbacks may be called, and |m_responseDocumentParser| is non-null while | 1803 // callbacks may be called, and |m_responseDocumentParser| is non-null while |
1804 // DocumentParserClient callbacks may be called. | 1804 // DocumentParserClient callbacks may be called. |
1805 if (m_loader || m_responseDocumentParser) | 1805 if (m_loader || m_responseDocumentParser) |
1806 return true; | 1806 return true; |
1807 return m_eventDispatchRecursionLevel > 0; | 1807 return m_eventDispatchRecursionLevel > 0; |
1808 } | 1808 } |
1809 | 1809 |
1810 void XMLHttpRequest::contextDestroyed() { | |
1811 DCHECK(!m_loader); | |
1812 ActiveDOMObject::contextDestroyed(); | |
1813 } | |
1814 | |
1815 const AtomicString& XMLHttpRequest::interfaceName() const { | 1810 const AtomicString& XMLHttpRequest::interfaceName() const { |
1816 return EventTargetNames::XMLHttpRequest; | 1811 return EventTargetNames::XMLHttpRequest; |
1817 } | 1812 } |
1818 | 1813 |
1819 ExecutionContext* XMLHttpRequest::getExecutionContext() const { | 1814 ExecutionContext* XMLHttpRequest::getExecutionContext() const { |
1820 return ActiveDOMObject::getExecutionContext(); | 1815 return ActiveDOMObject::getExecutionContext(); |
1821 } | 1816 } |
1822 | 1817 |
1823 DEFINE_TRACE(XMLHttpRequest) { | 1818 DEFINE_TRACE(XMLHttpRequest) { |
1824 visitor->trace(m_responseBlob); | 1819 visitor->trace(m_responseBlob); |
(...skipping 15 matching lines...) Expand all Loading... |
1840 visitor->traceWrappers(m_responseLegacyStream); | 1835 visitor->traceWrappers(m_responseLegacyStream); |
1841 visitor->traceWrappers(m_responseDocument); | 1836 visitor->traceWrappers(m_responseDocument); |
1842 visitor->traceWrappers(m_responseArrayBuffer); | 1837 visitor->traceWrappers(m_responseArrayBuffer); |
1843 } | 1838 } |
1844 | 1839 |
1845 std::ostream& operator<<(std::ostream& ostream, const XMLHttpRequest* xhr) { | 1840 std::ostream& operator<<(std::ostream& ostream, const XMLHttpRequest* xhr) { |
1846 return ostream << "XMLHttpRequest " << static_cast<const void*>(xhr); | 1841 return ostream << "XMLHttpRequest " << static_cast<const void*>(xhr); |
1847 } | 1842 } |
1848 | 1843 |
1849 } // namespace blink | 1844 } // namespace blink |
OLD | NEW |