Commit 47803c76 authored by Yutaka Hirano's avatar Yutaka Hirano Committed by Commit Bot

Remove ResourceError::is_null_

It should consult |domain_| to check nullity.

Bug: 748491
Change-Id: I99a37ecc145c873c0ab191d005a1f15b47aeed7a
Reviewed-on: https://chromium-review.googlesource.com/576015Reviewed-by: default avatarKinuko Yasuda <kinuko@chromium.org>
Reviewed-by: default avatarTakashi Toyoshima <toyoshim@chromium.org>
Commit-Queue: Yutaka Hirano <yhirano@chromium.org>
Cr-Commit-Position: refs/heads/master@{#490712}
parent e1bebd38
......@@ -78,7 +78,6 @@ ResourceError ResourceError::Copy() const {
error_copy.error_code_ = error_code_;
error_copy.failing_url_ = failing_url_.Copy();
error_copy.localized_description_ = localized_description_.IsolatedCopy();
error_copy.is_null_ = is_null_;
error_copy.is_access_check_ = is_access_check_;
error_copy.was_ignored_by_handler_ = was_ignored_by_handler_;
return error_copy;
......@@ -88,9 +87,6 @@ bool ResourceError::Compare(const ResourceError& a, const ResourceError& b) {
if (a.IsNull() && b.IsNull())
return true;
if (a.IsNull() || b.IsNull())
return false;
if (a.GetDomain() != b.GetDomain())
return false;
......
......@@ -72,14 +72,15 @@ class PLATFORM_EXPORT ResourceError final {
: domain_(domain),
error_code_(error_code),
failing_url_(failing_url),
localized_description_(localized_description),
is_null_(false) {}
localized_description_(localized_description) {
DCHECK_NE(domain, Domain::kEmpty);
}
// Makes a deep copy. Useful for when you need to use a ResourceError on
// another thread.
ResourceError Copy() const;
bool IsNull() const { return is_null_; }
bool IsNull() const { return domain_ == Domain::kEmpty; }
Domain GetDomain() const { return domain_; }
int ErrorCode() const { return error_code_; }
......@@ -126,7 +127,6 @@ class PLATFORM_EXPORT ResourceError final {
int error_code_ = 0;
KURL failing_url_;
String localized_description_;
bool is_null_ = true;
bool is_access_check_ = false;
bool stale_copy_in_cache_ = false;
bool was_ignored_by_handler_ = false;
......
......@@ -84,6 +84,7 @@ void RegisterMockedErrorURLLoad(const WebURL& full_url) {
response.SetLoadTiming(timing);
WebURLError error;
error.domain = WebURLError::Domain::kTest;
error.reason = 404;
Platform::Current()->GetURLLoaderMockFactory()->RegisterErrorURL(
full_url, response, error);
......
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