Commit 270315a2 authored by hiroshige's avatar hiroshige Committed by Commit bot

Rename Resource::GetError() to FinishAsError()

In Blink Renaming, Resource::error() was incorrectly renamed to GetError().
This CL re-renames it to FinishAsError().

This CL doesn't rename it to Error() because Error() looks like the getter of
|Resource::error_|.

BUG=675877

Review-Url: https://codereview.chromium.org/2855883004
Cr-Commit-Position: refs/heads/master@{#469487}
parent ac81f803
......@@ -143,7 +143,7 @@ TEST_F(CSSPreloadScannerTest, DontReadFromClearedData) {
const char* data = "@import url('http://127.0.0.1/preload.css');";
resource->AppendData(data, strlen(data));
ResourceError error(kErrorDomainBlinkInternal, 0, url.GetString(), "");
resource->GetError(error);
resource->FinishAsError(error);
// Should not crash.
PreloadRecordingCSSPreloaderResourceClient* resource_client =
......
......@@ -366,13 +366,13 @@ void ImageResource::Finish(double load_finish_time) {
Resource::Finish(load_finish_time);
}
void ImageResource::GetError(const ResourceError& error) {
void ImageResource::FinishAsError(const ResourceError& error) {
if (multipart_parser_)
multipart_parser_->Cancel();
// TODO(hiroshige): Move setEncodedSize() call to Resource::error() if it
// is really needed, or remove it otherwise.
SetEncodedSize(0);
Resource::GetError(error);
Resource::FinishAsError(error);
UpdateImage(nullptr, ImageResourceContent::kClearImageAndNotifyObservers,
true);
}
......
......@@ -82,11 +82,11 @@ class CORE_EXPORT ImageResource final
bool CanReuse(const FetchParameters&) const override;
PassRefPtr<const SharedBuffer> ResourceBuffer() const override;
void AppendData(const char*, size_t) override;
void GetError(const ResourceError&) override;
void ResponseReceived(const ResourceResponse&,
std::unique_ptr<WebDataConsumerHandle>) override;
void AppendData(const char*, size_t) override;
void Finish(double finish_time = 0.0) override;
void FinishAsError(const ResourceError&) override;
// For compatibility, images keep loading even if there are HTTP errors.
bool ShouldIgnoreHTTPStatusCodeErrors() const override { return true; }
......
......@@ -413,7 +413,7 @@ void Resource::SetDataBufferingPolicy(
SetEncodedSize(0);
}
void Resource::GetError(const ResourceError& error) {
void Resource::FinishAsError(const ResourceError& error) {
DCHECK(!error.IsNull());
error_ = error;
is_revalidating_ = false;
......
......@@ -106,7 +106,7 @@ class PLATFORM_EXPORT Resource : public GarbageCollectedFinalized<Resource>,
virtual void SetEncoding(const String&) {}
virtual String Encoding() const { return String(); }
virtual void AppendData(const char*, size_t);
virtual void GetError(const ResourceError&);
virtual void FinishAsError(const ResourceError&);
virtual void SetCORSFailed() {}
void SetNeedsSynchronousCacheHit(bool needs_synchronous_cache_hit) {
......
......@@ -451,7 +451,7 @@ Resource* ResourceFetcher::ResourceForBlockedRequest(
ResourceRequestBlockedReason blocked_reason) {
Resource* resource = factory.Create(params.GetResourceRequest(),
params.Options(), params.Charset());
resource->GetError(ResourceError::CancelledDueToAccessCheckError(
resource->FinishAsError(ResourceError::CancelledDueToAccessCheckError(
params.Url(), blocked_reason));
return resource;
}
......@@ -1317,7 +1317,7 @@ void ResourceFetcher::HandleLoaderError(Resource* resource,
if (error.IsCancellation())
RemovePreload(resource);
resource->GetError(error);
resource->FinishAsError(error);
HandleLoadCompletion(resource);
}
......
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