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

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

Issue 679863002: Revert "Prepare blink to unify definitions of load completion" (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 2 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
« no previous file with comments | « Source/core/fetch/ResourceLoader.h ('k') | Source/core/fetch/ResourceLoaderHost.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/fetch/ResourceLoader.cpp
diff --git a/Source/core/fetch/ResourceLoader.cpp b/Source/core/fetch/ResourceLoader.cpp
index d64de812f60e2ca3499d8cfcf70eb5575671bbac..a7a670ae80ffee079aaf9cca98e2d8d56c49f0e6 100644
--- a/Source/core/fetch/ResourceLoader.cpp
+++ b/Source/core/fetch/ResourceLoader.cpp
@@ -102,8 +102,8 @@ void ResourceLoader::releaseResources()
{
ASSERT(m_state != Terminated);
ASSERT(m_notifiedLoadComplete);
- ASSERT(!m_requestCountTracker);
- m_host->didLoadResource();
+ m_requestCountTracker.clear();
+ m_host->didLoadResource(m_resource);
if (m_state == Terminated)
return;
m_resource->clearLoader();
@@ -233,7 +233,7 @@ void ResourceLoader::didFinishLoadingOnePart(double finishTime, int64 encodedDat
if (m_notifiedLoadComplete)
return;
- didComplete();
+ m_notifiedLoadComplete = true;
m_host->didFinishLoading(m_resource, finishTime, encodedDataLength);
}
@@ -286,7 +286,7 @@ void ResourceLoader::cancel(const ResourceError& error)
}
if (!m_notifiedLoadComplete) {
- didComplete();
+ m_notifiedLoadComplete = true;
m_host->didFailLoading(m_resource, nonNullError);
}
@@ -422,7 +422,7 @@ void ResourceLoader::didReceiveResponse(blink::WebURLLoader*, const blink::WebUR
m_state = Finishing;
if (!m_notifiedLoadComplete) {
- didComplete();
+ m_notifiedLoadComplete = true;
m_host->didFailLoading(m_resource, ResourceError::cancelledError(m_request.url()));
}
@@ -469,11 +469,10 @@ 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();
+ m_resource->finish(finishTime);
// 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.
@@ -495,7 +494,7 @@ void ResourceLoader::didFail(blink::WebURLLoader*, const blink::WebURLError& err
m_resource->setResourceError(error);
if (!m_notifiedLoadComplete) {
- didComplete();
+ m_notifiedLoadComplete = true;
m_host->didFailLoading(m_resource, error);
}
if (m_state == Terminated)
@@ -549,12 +548,6 @@ void ResourceLoader::requestSynchronously()
didFinishLoading(0, monotonicallyIncreasingTime(), encodedDataLength);
}
-void ResourceLoader::didComplete()
-{
- m_notifiedLoadComplete = true;
- m_requestCountTracker.clear();
-}
-
ResourceRequest& ResourceLoader::applyOptions(ResourceRequest& request) const
{
request.setAllowStoredCredentials(m_options.allowCredentials == AllowStoredCredentials);
« no previous file with comments | « Source/core/fetch/ResourceLoader.h ('k') | Source/core/fetch/ResourceLoaderHost.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698