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

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

Issue 156623005: Add transfer size paramater to didFinishLoading [3/3] (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Addressed comments Created 6 years, 10 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 2096e9044a06e99b20687e914c4522c138f36c69..f371aba8b00fd32aaee3571f4a821e3316104e1c 100644
--- a/Source/core/fetch/ResourceLoader.cpp
+++ b/Source/core/fetch/ResourceLoader.cpp
@@ -188,7 +188,7 @@ void ResourceLoader::didDownloadData(blink::WebURLLoader*, int length, int encod
m_resource->didDownloadData(length);
}
-void ResourceLoader::didFinishLoadingOnePart(double finishTime)
+void ResourceLoader::didFinishLoadingOnePart(double finishTime, int64 encodedDataLength)
{
// If load has been cancelled after finishing (which could happen with a
// JavaScript that changes the window location), do nothing.
@@ -198,7 +198,7 @@ void ResourceLoader::didFinishLoadingOnePart(double finishTime)
if (m_notifiedLoadComplete)
return;
m_notifiedLoadComplete = true;
- m_host->didFinishLoading(m_resource, finishTime);
+ m_host->didFinishLoading(m_resource, finishTime, encodedDataLength);
}
void ResourceLoader::didChangePriority(ResourceLoadPriority loadPriority)
@@ -352,7 +352,7 @@ void ResourceLoader::didReceiveResponse(blink::WebURLLoader*, const blink::WebUR
// Since a subresource loader does not load multipart sections progressively, data was delivered to the loader all at once.
// After the first multipart section is complete, signal to delegates that this load is "finished"
m_host->subresourceLoaderFinishedLoadingOnePart(this);
- didFinishLoadingOnePart(0);
+ didFinishLoadingOnePart(0, blink::WebURLLoaderClient::kUnknownEncodedDataLength);
}
if (m_resource->response().httpStatusCode() < 400 || m_resource->shouldIgnoreHTTPStatusCodeErrors())
@@ -390,7 +390,7 @@ void ResourceLoader::didReceiveData(blink::WebURLLoader*, const char* data, int
m_resource->appendData(data, length);
}
-void ResourceLoader::didFinishLoading(blink::WebURLLoader*, double finishTime)
+void ResourceLoader::didFinishLoading(blink::WebURLLoader*, double finishTime, int64 encodedDataLength)
{
RELEASE_ASSERT(m_connectionState == ConnectionStateReceivedResponse || m_connectionState == ConnectionStateReceivingData);
m_connectionState = ConnectionStateFinishedLoading;
@@ -402,7 +402,7 @@ void ResourceLoader::didFinishLoading(blink::WebURLLoader*, double finishTime)
RefPtr<ResourceLoader> protect(this);
ResourcePtr<Resource> protectResource(m_resource);
m_state = Finishing;
- didFinishLoadingOnePart(finishTime);
+ didFinishLoadingOnePart(finishTime, encodedDataLength);
m_resource->finish(finishTime);
// If the load has been cancelled by a delegate in response to didFinishLoad(), do not release
@@ -469,9 +469,10 @@ void ResourceLoader::requestSynchronously()
if (m_state == Terminated)
return;
RefPtr<ResourceLoadInfo> resourceLoadInfo = responseOut.toResourceResponse().resourceLoadInfo();
- m_host->didReceiveData(m_resource, dataOut.data(), dataOut.size(), resourceLoadInfo ? resourceLoadInfo->encodedDataLength : -1);
+ int64 encodedDataLength = resourceLoadInfo ? resourceLoadInfo->encodedDataLength : blink::WebURLLoaderClient::kUnknownEncodedDataLength;
+ m_host->didReceiveData(m_resource, dataOut.data(), dataOut.size(), encodedDataLength);
m_resource->setResourceBuffer(dataOut);
- didFinishLoading(0, monotonicallyIncreasingTime());
+ didFinishLoading(0, monotonicallyIncreasingTime(), encodedDataLength);
}
}
« 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