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

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

Issue 2105713002: Render process changes for ResourceTiming sizes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@resource_timing_sizes_browser_process
Patch Set: Fix lint error: ASSERT -> DCHECK Created 4 years, 6 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/ResourceLoader.cpp
diff --git a/third_party/WebKit/Source/core/fetch/ResourceLoader.cpp b/third_party/WebKit/Source/core/fetch/ResourceLoader.cpp
index 2be163c8007ac3cbd6c698124b132e8482bdc250..96c7a776b4fd5791380268393952386a040e5b5f 100644
--- a/third_party/WebKit/Source/core/fetch/ResourceLoader.cpp
+++ b/third_party/WebKit/Source/core/fetch/ResourceLoader.cpp
@@ -116,7 +116,7 @@ void ResourceLoader::cancel()
didFail(nullptr, ResourceError::cancelledError(m_resource->lastResourceRequest().url()));
}
-void ResourceLoader::willFollowRedirect(WebURLLoader*, WebURLRequest& passedNewRequest, const WebURLResponse& passedRedirectResponse)
+void ResourceLoader::willFollowRedirect(WebURLLoader*, WebURLRequest& passedNewRequest, const WebURLResponse& passedRedirectResponse, int64_t encodedDataLength)
{
ASSERT(!passedNewRequest.isNull());
ASSERT(!passedRedirectResponse.isNull());
@@ -125,7 +125,7 @@ void ResourceLoader::willFollowRedirect(WebURLLoader*, WebURLRequest& passedNewR
const ResourceResponse& redirectResponse(passedRedirectResponse.toResourceResponse());
newRequest.setRedirectStatus(ResourceRequest::RedirectStatus::FollowedRedirect);
- if (m_fetcher->willFollowRedirect(m_resource.get(), newRequest, redirectResponse)) {
+ if (m_fetcher->willFollowRedirect(m_resource.get(), newRequest, redirectResponse, encodedDataLength)) {
m_resource->willFollowRedirect(newRequest, redirectResponse);
} else {
m_resource->willNotFollowRedirect();
@@ -198,10 +198,12 @@ void ResourceLoader::didReceiveResponse(WebURLLoader* loader, const WebURLRespon
didReceiveResponse(loader, response, nullptr);
}
-void ResourceLoader::didReceiveData(WebURLLoader*, const char* data, int length, int encodedDataLength)
+void ResourceLoader::didReceiveData(WebURLLoader*, const char* data, int length, int encodedDataLength, int encodedBodyLength)
{
RELEASE_ASSERT(length >= 0);
m_fetcher->didReceiveData(m_resource.get(), data, length, encodedDataLength);
+ m_resource->addToEncodedBodyLength(encodedBodyLength);
+ m_resource->addToDecodedBodyLength(length);
m_resource->appendData(data, length);
}
@@ -249,6 +251,7 @@ void ResourceLoader::requestSynchronously(const ResourceRequest& request)
return;
RefPtr<ResourceLoadInfo> resourceLoadInfo = responseOut.toResourceResponse().resourceLoadInfo();
int64_t encodedDataLength = resourceLoadInfo ? resourceLoadInfo->encodedDataLength : WebURLLoaderClient::kUnknownEncodedDataLength;
+ DCHECK_GE(responseOut.toResourceResponse().encodedBodyLength(), 0);
// Follow the async case convention of not calling didReceiveData or
// appending data to m_resource if the response body is empty. Copying the

Powered by Google App Engine
This is Rietveld 408576698