Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(244)

Unified Diff: third_party/WebKit/Source/core/fetch/Resource.cpp

Issue 1928823002: Simplifying finishing a load on Resource (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/fetch/Resource.cpp
diff --git a/third_party/WebKit/Source/core/fetch/Resource.cpp b/third_party/WebKit/Source/core/fetch/Resource.cpp
index cf9ef1e62c497b4ebc069d841b93025ee0e89b3c..22ce5c5ab7d60305fa1af48fd78a26cdd808f542 100644
--- a/third_party/WebKit/Source/core/fetch/Resource.cpp
+++ b/third_party/WebKit/Source/core/fetch/Resource.cpp
@@ -324,24 +324,27 @@ void Resource::markClientsAndObserversFinished()
}
}
-void Resource::error(Resource::Status status)
+void Resource::error(const ResourceError& error)
{
+ ASSERT(!error.isNull());
+ m_error = error;
if (!m_revalidatingRequest.isNull())
m_revalidatingRequest = ResourceRequest();
- if (!m_error.isNull() && (m_error.isCancellation() || !isPreloaded()))
+ if (m_error.isCancellation() || !isPreloaded())
memoryCache()->remove(this);
- setStatus(status);
+ setStatus(LoadError);
ASSERT(errorOccurred());
m_data.clear();
checkNotify();
markClientsAndObserversFinished();
}
-void Resource::finish()
+void Resource::finish(double loadFinishTime)
{
ASSERT(m_revalidatingRequest.isNull());
+ m_loadFinishTime = loadFinishTime;
if (!errorOccurred())
yhirano 2016/05/02 09:31:34 The CL description suggests we can make this branc
Nate Chapin 2016/05/02 19:32:24 I don't think it's guaranteed, because a DecodeErr
m_status = Cached;
checkNotify();

Powered by Google App Engine
This is Rietveld 408576698