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

Unified Diff: Source/core/inspector/InspectorResourceAgent.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/inspector/InspectorResourceAgent.h ('k') | Source/core/inspector/InspectorTimelineAgent.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/inspector/InspectorResourceAgent.cpp
diff --git a/Source/core/inspector/InspectorResourceAgent.cpp b/Source/core/inspector/InspectorResourceAgent.cpp
index 9fe423a96d6db65075b089e489ce60cfcd73be33..01493490c9825b553e56a4a9a87bb3f56937f41c 100644
--- a/Source/core/inspector/InspectorResourceAgent.cpp
+++ b/Source/core/inspector/InspectorResourceAgent.cpp
@@ -249,6 +249,8 @@ static PassRefPtr<TypeBuilder::Network::Response> buildObjectForResourceResponse
else
headers = buildObjectForHeaders(response.httpHeaderFields());
+ int64_t encodedDataLength = response.resourceLoadInfo() ? response.resourceLoadInfo()->encodedDataLength : -1;
+
RefPtr<TypeBuilder::Network::Response> responseObject = TypeBuilder::Network::Response::create()
.setUrl(urlWithoutFragment(response.url()).string())
.setStatus(status)
@@ -256,7 +258,8 @@ static PassRefPtr<TypeBuilder::Network::Response> buildObjectForResourceResponse
.setHeaders(headers)
.setMimeType(response.mimeType())
.setConnectionReused(response.connectionReused())
- .setConnectionId(response.connectionID());
+ .setConnectionId(response.connectionID())
+ .setEncodedDataLength(encodedDataLength);
responseObject->setFromDiskCache(response.wasCached());
if (response.resourceLoadTiming())
@@ -392,7 +395,7 @@ void InspectorResourceAgent::didReceiveData(unsigned long identifier, const char
m_frontend->dataReceived(requestId, currentTime(), dataLength, encodedDataLength);
}
-void InspectorResourceAgent::didFinishLoading(unsigned long identifier, DocumentLoader* loader, double monotonicFinishTime)
+void InspectorResourceAgent::didFinishLoading(unsigned long identifier, DocumentLoader* loader, double monotonicFinishTime, int64_t encodedDataLength)
{
double finishTime = 0.0;
// FIXME: Expose all of the timing details to inspector and have it calculate finishTime.
@@ -403,14 +406,14 @@ void InspectorResourceAgent::didFinishLoading(unsigned long identifier, Document
m_resourcesData->maybeDecodeDataToContent(requestId);
if (!finishTime)
finishTime = currentTime();
- m_frontend->loadingFinished(requestId, finishTime);
+ m_frontend->loadingFinished(requestId, finishTime, encodedDataLength);
}
void InspectorResourceAgent::didReceiveCORSRedirectResponse(Frame* frame, unsigned long identifier, DocumentLoader* loader, const ResourceResponse& response, ResourceLoader* resourceLoader)
{
// Update the response and finish loading
didReceiveResourceResponse(frame, identifier, loader, response, resourceLoader);
- didFinishLoading(identifier, loader, 0);
+ didFinishLoading(identifier, loader, 0, blink::WebURLLoaderClient::kUnknownEncodedDataLength);
}
void InspectorResourceAgent::didFailLoading(unsigned long identifier, DocumentLoader* loader, const ResourceError& error)
« no previous file with comments | « Source/core/inspector/InspectorResourceAgent.h ('k') | Source/core/inspector/InspectorTimelineAgent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698