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

Unified Diff: third_party/WebKit/Source/platform/network/ResourceResponse.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: Initialise encoded_body_length for sync XHR to data: URLs Created 4 years, 5 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/platform/network/ResourceResponse.cpp
diff --git a/third_party/WebKit/Source/platform/network/ResourceResponse.cpp b/third_party/WebKit/Source/platform/network/ResourceResponse.cpp
index f29d13eac2e1517805a8d9c295adf071a5acdc64..412deaed3a064b2ae14d80c9904707e6c088a9e9 100644
--- a/third_party/WebKit/Source/platform/network/ResourceResponse.cpp
+++ b/third_party/WebKit/Source/platform/network/ResourceResponse.cpp
@@ -102,6 +102,8 @@ ResourceResponse::ResourceResponse()
, m_serviceWorkerResponseType(WebServiceWorkerResponseTypeDefault)
, m_responseTime(0)
, m_remotePort(0)
+ , m_encodedBodyLength(0)
+ , m_decodedBodyLength(0)
{
}
@@ -138,6 +140,8 @@ ResourceResponse::ResourceResponse(const KURL& url, const AtomicString& mimeType
, m_serviceWorkerResponseType(WebServiceWorkerResponseTypeDefault)
, m_responseTime(0)
, m_remotePort(0)
+ , m_encodedBodyLength(0)
+ , m_decodedBodyLength(0)
{
}
@@ -184,6 +188,8 @@ ResourceResponse::ResourceResponse(CrossThreadResourceResponseData* data)
m_responseTime = data->m_responseTime;
m_remoteIPAddress = AtomicString(data->m_remoteIPAddress);
m_remotePort = data->m_remotePort;
+ m_encodedBodyLength = data->m_encodedBodyLength;
+ m_decodedBodyLength = data->m_decodedBodyLength;
m_downloadedFilePath = data->m_downloadedFilePath;
m_downloadedFileHandle = data->m_downloadedFileHandle;
@@ -236,6 +242,8 @@ std::unique_ptr<CrossThreadResourceResponseData> ResourceResponse::copyData() co
data->m_responseTime = m_responseTime;
data->m_remoteIPAddress = m_remoteIPAddress.getString().isolatedCopy();
data->m_remotePort = m_remotePort;
+ data->m_encodedBodyLength = m_encodedBodyLength;
+ data->m_decodedBodyLength = m_decodedBodyLength;
data->m_downloadedFilePath = m_downloadedFilePath.isolatedCopy();
data->m_downloadedFileHandle = m_downloadedFileHandle;
@@ -583,6 +591,16 @@ void ResourceResponse::setResourceLoadInfo(PassRefPtr<ResourceLoadInfo> loadInfo
m_resourceLoadInfo = loadInfo;
}
+void ResourceResponse::addToEncodedBodyLength(int value)
+{
+ m_encodedBodyLength += value;
+}
+
+void ResourceResponse::addToDecodedBodyLength(int value)
+{
+ m_decodedBodyLength += value;
+}
+
void ResourceResponse::setDownloadedFilePath(const String& downloadedFilePath)
{
m_downloadedFilePath = downloadedFilePath;
@@ -620,6 +638,10 @@ bool ResourceResponse::compare(const ResourceResponse& a, const ResourceResponse
return true;
if (a.resourceLoadTiming() != b.resourceLoadTiming())
return false;
+ if (a.encodedBodyLength() != b.encodedBodyLength())
+ return false;
+ if (a.decodedBodyLength() != b.decodedBodyLength())
+ return false;
return true;
}

Powered by Google App Engine
This is Rietveld 408576698