ResourceErrorBase needs to identify timeouts

https://bugs.webkit.org/show_bug.cgi?id=95755

Reviewed by Alexey Proskuryakov.

Adding a property to check whether this ResourceError was raised due to a timeout.
This is preparatory work for bug 74802. In order to implement XHR2 timeout functionality,
I need to identify some layers up whether the original network problem has been a timeout.

No new tests, no change in behavior yet.

* platform/network/ResourceErrorBase.cpp:
(WebCore::ResourceErrorBase::copy): Copying new member.
(WebCore::ResourceErrorBase::compare): Comparing new member.
* platform/network/ResourceErrorBase.h:
(WebCore::ResourceErrorBase::setIsTimeout): New setter.
(WebCore::ResourceErrorBase::isTimeout): New getter.
(ResourceErrorBase),
(WebCore::ResourceErrorBase::ResourceErrorBase): Adding m_isTimeout member.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@127495 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent dd3ef38c
2012-09-04 Dominik Röttsches <dominik.rottsches@intel.com>
ResourceErrorBase needs to identify timeouts
https://bugs.webkit.org/show_bug.cgi?id=95755
Reviewed by Alexey Proskuryakov.
Adding a property to check whether this ResourceError was raised due to a timeout.
This is preparatory work for bug 74802. In order to implement XHR2 timeout functionality,
I need to identify some layers up whether the original network problem has been a timeout.
No new tests, no change in behavior yet.
* platform/network/ResourceErrorBase.cpp:
(WebCore::ResourceErrorBase::copy): Copying new member.
(WebCore::ResourceErrorBase::compare): Comparing new member.
* platform/network/ResourceErrorBase.h:
(WebCore::ResourceErrorBase::setIsTimeout): New setter.
(WebCore::ResourceErrorBase::isTimeout): New getter.
(ResourceErrorBase),
(WebCore::ResourceErrorBase::ResourceErrorBase): Adding m_isTimeout member.
2012-09-04 Tommy Widenflycht <tommyw@google.com>
MediaStream API: Change the MediaStreamTrackList track added/removed signaling
......@@ -42,6 +42,7 @@ ResourceError ResourceErrorBase::copy() const
errorCopy.m_localizedDescription = m_localizedDescription.isolatedCopy();
errorCopy.m_isNull = m_isNull;
errorCopy.m_isCancellation = m_isCancellation;
errorCopy.m_isTimeout = m_isTimeout;
platformCopy(errorCopy);
return errorCopy;
}
......@@ -74,6 +75,9 @@ bool ResourceErrorBase::compare(const ResourceError& a, const ResourceError& b)
if (a.isCancellation() != b.isCancellation())
return false;
if (a.isTimeout() != b.isTimeout())
return false;
return platformCompare(a, b);
}
......
......@@ -49,6 +49,9 @@ public:
void setIsCancellation(bool isCancellation) { m_isCancellation = isCancellation; }
bool isCancellation() const { return m_isCancellation; }
void setIsTimeout(bool isTimeout) { m_isTimeout = isTimeout; }
bool isTimeout() const { return m_isTimeout; }
static bool compare(const ResourceError&, const ResourceError&);
protected:
......@@ -56,6 +59,7 @@ protected:
: m_errorCode(0)
, m_isNull(true)
, m_isCancellation(false)
, m_isTimeout(false)
{
}
......@@ -66,6 +70,7 @@ protected:
, m_localizedDescription(localizedDescription)
, m_isNull(false)
, m_isCancellation(false)
, m_isTimeout(false)
{
}
......@@ -86,6 +91,7 @@ protected:
String m_localizedDescription;
bool m_isNull;
bool m_isCancellation;
bool m_isTimeout;
};
inline bool operator==(const ResourceError& a, const ResourceError& b) { return ResourceErrorBase::compare(a, b); }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment