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

Unified Diff: third_party/WebKit/Source/core/loader/FrameFetchContext.cpp

Issue 2519893002: Stop dispatching encoded-data-length on each data chunk arrival (Closed)
Patch Set: PS5 again 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/loader/FrameFetchContext.cpp
diff --git a/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp b/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
index 049c2e27133a05c7fed4fc1962116c16e9474ea6..e27948e4ddbe6f6c9e47be5055103059ee4dfd66 100644
--- a/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
+++ b/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
@@ -413,14 +413,21 @@ void FrameFetchContext::dispatchDidReceiveResponse(
void FrameFetchContext::dispatchDidReceiveData(unsigned long identifier,
const char* data,
- int dataLength,
- int encodedDataLength) {
+ int dataLength) {
+ TRACE_EVENT1("devtools.timeline", "ResourceReceivedData", "data",
+ InspectorReceiveDataEvent::data(identifier, frame(), 0));
+ frame()->loader().progress().incrementProgress(identifier, dataLength);
+ InspectorInstrumentation::didReceiveData(frame(), identifier, data,
+ dataLength);
+}
+
+void FrameFetchContext::dispatchDidReceiveEncodedData(unsigned long identifier,
+ int encodedDataLength) {
TRACE_EVENT1(
"devtools.timeline", "ResourceReceivedData", "data",
InspectorReceiveDataEvent::data(identifier, frame(), encodedDataLength));
- frame()->loader().progress().incrementProgress(identifier, dataLength);
- InspectorInstrumentation::didReceiveData(frame(), identifier, data,
- dataLength, encodedDataLength);
+ InspectorInstrumentation::didReceiveEncodedData(frame(), identifier,
+ encodedDataLength);
}
void FrameFetchContext::dispatchDidDownloadData(unsigned long identifier,
@@ -430,8 +437,9 @@ void FrameFetchContext::dispatchDidDownloadData(unsigned long identifier,
"devtools.timeline", "ResourceReceivedData", "data",
InspectorReceiveDataEvent::data(identifier, frame(), encodedDataLength));
frame()->loader().progress().incrementProgress(identifier, dataLength);
- InspectorInstrumentation::didReceiveData(frame(), identifier, 0, dataLength,
- encodedDataLength);
+ InspectorInstrumentation::didReceiveData(frame(), identifier, 0, dataLength);
+ InspectorInstrumentation::didReceiveEncodedData(frame(), identifier,
+ encodedDataLength);
}
void FrameFetchContext::dispatchDidFinishLoading(unsigned long identifier,
@@ -449,6 +457,7 @@ void FrameFetchContext::dispatchDidFinishLoading(unsigned long identifier,
void FrameFetchContext::dispatchDidFail(unsigned long identifier,
const ResourceError& error,
+ int64_t encodedDataLength,
dgozman 2016/11/30 18:02:17 Why pass this if it's unused?
yhirano 2016/12/01 10:33:10 For consistency.
bool isInternalRequest) {
TRACE_EVENT1("devtools.timeline", "ResourceFinish", "data",
InspectorResourceFinishEvent::data(identifier, 0, true));
@@ -483,7 +492,7 @@ void FrameFetchContext::dispatchDidLoadResourceFromMemoryCache(
}
if (resource->encodedSize() > 0)
- dispatchDidReceiveData(identifier, 0, resource->encodedSize(), 0);
+ dispatchDidReceiveData(identifier, 0, resource->encodedSize());
dispatchDidFinishLoading(identifier, 0, 0);
}

Powered by Google App Engine
This is Rietveld 408576698