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

Unified Diff: Source/core/fetch/ResourceLoader.cpp

Issue 561813003: Prepare blink to unify definitions of load completion (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 3 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: Source/core/fetch/ResourceLoader.cpp
diff --git a/Source/core/fetch/ResourceLoader.cpp b/Source/core/fetch/ResourceLoader.cpp
index 512b3b94d3abde41fda463484c88f3cc989e9958..42c3a9a14a2e9528e0b2b0d266cf53c8ee0de1d7 100644
--- a/Source/core/fetch/ResourceLoader.cpp
+++ b/Source/core/fetch/ResourceLoader.cpp
@@ -229,6 +229,7 @@ void ResourceLoader::didFinishLoadingOnePart(double finishTime, int64 encodedDat
if (m_notifiedLoadComplete)
return;
m_notifiedLoadComplete = true;
+ m_requestCountTracker.clear();
m_host->didFinishLoading(m_resource, finishTime, encodedDataLength);
}
@@ -282,6 +283,7 @@ void ResourceLoader::cancel(const ResourceError& error)
if (!m_notifiedLoadComplete) {
m_notifiedLoadComplete = true;
+ m_requestCountTracker.clear();
m_host->didFailLoading(m_resource, nonNullError);
}
@@ -407,6 +409,7 @@ void ResourceLoader::didReceiveResponse(blink::WebURLLoader*, const blink::WebUR
if (!m_notifiedLoadComplete) {
m_notifiedLoadComplete = true;
+ m_requestCountTracker.clear();
m_host->didFailLoading(m_resource, ResourceError::cancelledError(m_request.url()));
}
@@ -452,10 +455,11 @@ void ResourceLoader::didFinishLoading(blink::WebURLLoader*, double finishTime, i
RefPtrWillBeRawPtr<ResourceLoader> protect(this);
ResourcePtr<Resource> protectResource(m_resource);
m_state = Finishing;
+ m_resource->setLoadFinishTime(finishTime);
didFinishLoadingOnePart(finishTime, encodedDataLength);
if (m_state == Terminated)
return;
- m_resource->finish(finishTime);
+ m_resource->finish();
// If the load has been cancelled by a delegate in response to didFinishLoad(), do not release
// the resources a second time, they have been released by cancel.
@@ -478,6 +482,7 @@ void ResourceLoader::didFail(blink::WebURLLoader*, const blink::WebURLError& err
if (!m_notifiedLoadComplete) {
m_notifiedLoadComplete = true;
+ m_requestCountTracker.clear();
m_host->didFailLoading(m_resource, error);
}
if (m_state == Terminated)

Powered by Google App Engine
This is Rietveld 408576698