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

Unified Diff: third_party/WebKit/Source/core/inspector/NetworkResourcesData.cpp

Issue 2519893002: Stop dispatching encoded-data-length on each data chunk arrival (Closed)
Patch Set: fix Created 4 years 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/inspector/NetworkResourcesData.cpp
diff --git a/third_party/WebKit/Source/core/inspector/NetworkResourcesData.cpp b/third_party/WebKit/Source/core/inspector/NetworkResourcesData.cpp
index 4288635aa35e16b8f23ce739e37509192d3f353f..2b2f604688a379b3383c11af4db2465a05e373bb 100644
--- a/third_party/WebKit/Source/core/inspector/NetworkResourcesData.cpp
+++ b/third_party/WebKit/Source/core/inspector/NetworkResourcesData.cpp
@@ -87,6 +87,7 @@ NetworkResourcesData::ResourceData::ResourceData(
m_type(InspectorPageAgent::OtherResource),
m_httpStatusCode(0),
m_rawHeaderSize(0),
+ m_pendingEncodedDataLength(0),
m_cachedResource(nullptr) {}
DEFINE_TRACE(NetworkResourcesData::ResourceData) {
@@ -354,6 +355,26 @@ NetworkResourcesData::resources() {
return result;
}
+int NetworkResourcesData::getAndClearPendingEncodedDataLength(
+ const String& requestId) {
+ ResourceData* resourceData = resourceDataForRequestId(requestId);
+ if (!resourceData)
+ return 0;
+
+ int pendingEncodedDataLength = resourceData->pendingEncodedDataLength();
+ resourceData->clearPendingEncodedDataLength();
+ return pendingEncodedDataLength;
+}
+
+void NetworkResourcesData::addPendingEncodedDataLength(const String& requestId,
+ int encodedDataLength) {
+ ResourceData* resourceData = resourceDataForRequestId(requestId);
+ if (!resourceData)
+ return;
+
+ resourceData->addPendingEncodedDataLength(encodedDataLength);
+}
+
void NetworkResourcesData::clear(const String& preservedLoaderId) {
if (!m_requestIdToResourceDataMap.size())
return;

Powered by Google App Engine
This is Rietveld 408576698