Commit 0646d7fc authored by Yutaka Hirano's avatar Yutaka Hirano Committed by Commit Bot

Remove ResourceErrors::is_timeout_

Bug: None
Change-Id: I4c566a86a9fdbe9f580fe3cf41879707969d5553
Reviewed-on: https://chromium-review.googlesource.com/575611
Commit-Queue: Yutaka Hirano <yhirano@chromium.org>
Reviewed-by: default avatarTakeshi Yoshino <tyoshino@chromium.org>
Reviewed-by: default avatarTakashi Toyoshima <toyoshim@chromium.org>
Reviewed-by: default avatarKinuko Yasuda <kinuko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#488592}
parent 14d17b46
...@@ -1014,14 +1014,7 @@ void DocumentThreadableLoader::DidTimeout(TimerBase* timer) { ...@@ -1014,14 +1014,7 @@ void DocumentThreadableLoader::DidTimeout(TimerBase* timer) {
// is stopped. So, |m_client| is always non-nullptr here. // is stopped. So, |m_client| is always non-nullptr here.
DCHECK(client_); DCHECK(client_);
// Using values from net/base/net_error_list.h ERR_TIMED_OUT, Same as existing DispatchDidFail(ResourceError::TimeoutError(GetResource()->Url()));
// FIXME above - this error should be coming from LocalFrameClient to be
// identifiable.
static const int kTimeoutError = -7;
ResourceError error("net", kTimeoutError, GetResource()->Url(), String());
error.SetIsTimeout(true);
DispatchDidFail(error);
} }
void DocumentThreadableLoader::LoadFallbackRequestForServiceWorker() { void DocumentThreadableLoader::LoadFallbackRequestForServiceWorker() {
......
...@@ -70,6 +70,10 @@ ResourceError ResourceError::CacheMissError(const KURL& url) { ...@@ -70,6 +70,10 @@ ResourceError ResourceError::CacheMissError(const KURL& url) {
return WebURLError(url, false, net::ERR_CACHE_MISS); return WebURLError(url, false, net::ERR_CACHE_MISS);
} }
ResourceError ResourceError::TimeoutError(const KURL& url) {
return WebURLError(url, false, net::ERR_TIMED_OUT);
}
ResourceError ResourceError::Copy() const { ResourceError ResourceError::Copy() const {
ResourceError error_copy; ResourceError error_copy;
error_copy.domain_ = domain_.IsolatedCopy(); error_copy.domain_ = domain_.IsolatedCopy();
...@@ -78,7 +82,6 @@ ResourceError ResourceError::Copy() const { ...@@ -78,7 +82,6 @@ ResourceError ResourceError::Copy() const {
error_copy.localized_description_ = localized_description_.IsolatedCopy(); error_copy.localized_description_ = localized_description_.IsolatedCopy();
error_copy.is_null_ = is_null_; error_copy.is_null_ = is_null_;
error_copy.is_access_check_ = is_access_check_; error_copy.is_access_check_ = is_access_check_;
error_copy.is_timeout_ = is_timeout_;
error_copy.was_ignored_by_handler_ = was_ignored_by_handler_; error_copy.was_ignored_by_handler_ = was_ignored_by_handler_;
return error_copy; return error_copy;
} }
...@@ -105,9 +108,6 @@ bool ResourceError::Compare(const ResourceError& a, const ResourceError& b) { ...@@ -105,9 +108,6 @@ bool ResourceError::Compare(const ResourceError& a, const ResourceError& b) {
if (a.IsAccessCheck() != b.IsAccessCheck()) if (a.IsAccessCheck() != b.IsAccessCheck())
return false; return false;
if (a.IsTimeout() != b.IsTimeout())
return false;
if (a.StaleCopyInCache() != b.StaleCopyInCache()) if (a.StaleCopyInCache() != b.StaleCopyInCache())
return false; return false;
...@@ -134,6 +134,11 @@ void ResourceError::InitializeWebURLError(WebURLError* error, ...@@ -134,6 +134,11 @@ void ResourceError::InitializeWebURLError(WebURLError* error,
} }
} }
bool ResourceError::IsTimeout() const {
return domain_ == String(net::kErrorDomain) &&
error_code_ == net::ERR_TIMED_OUT;
}
bool ResourceError::IsCancellation() const { bool ResourceError::IsCancellation() const {
return domain_ == String(net::kErrorDomain) && return domain_ == String(net::kErrorDomain) &&
error_code_ == net::ERR_ABORTED; error_code_ == net::ERR_ABORTED;
......
...@@ -63,6 +63,7 @@ class PLATFORM_EXPORT ResourceError final { ...@@ -63,6 +63,7 @@ class PLATFORM_EXPORT ResourceError final {
const String& localized_description); const String& localized_description);
static ResourceError CacheMissError(const KURL&); static ResourceError CacheMissError(const KURL&);
static ResourceError TimeoutError(const KURL&);
ResourceError() = default; ResourceError() = default;
...@@ -94,8 +95,7 @@ class PLATFORM_EXPORT ResourceError final { ...@@ -94,8 +95,7 @@ class PLATFORM_EXPORT ResourceError final {
} }
bool IsAccessCheck() const { return is_access_check_; } bool IsAccessCheck() const { return is_access_check_; }
void SetIsTimeout(bool is_timeout) { is_timeout_ = is_timeout; } bool IsTimeout() const;
bool IsTimeout() const { return is_timeout_; }
void SetStaleCopyInCache(bool stale_copy_in_cache) { void SetStaleCopyInCache(bool stale_copy_in_cache) {
stale_copy_in_cache_ = stale_copy_in_cache; stale_copy_in_cache_ = stale_copy_in_cache;
} }
...@@ -130,7 +130,6 @@ class PLATFORM_EXPORT ResourceError final { ...@@ -130,7 +130,6 @@ class PLATFORM_EXPORT ResourceError final {
String localized_description_; String localized_description_;
bool is_null_ = true; bool is_null_ = true;
bool is_access_check_ = false; bool is_access_check_ = false;
bool is_timeout_ = false;
bool stale_copy_in_cache_ = false; bool stale_copy_in_cache_ = false;
bool was_ignored_by_handler_ = false; bool was_ignored_by_handler_ = false;
bool should_collapse_initiator_ = false; bool should_collapse_initiator_ = false;
......
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