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

Unified Diff: third_party/WebKit/Source/platform/loader/fetch/ResourceLoader.cpp

Issue 2706643002: DevTools: Move network request instrumentation points for timeline down the stack. (Closed)
Patch Set: . Created 3 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 | « third_party/WebKit/Source/platform/instrumentation/inspector/PlatformInspectorTraceEvents.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/loader/fetch/ResourceLoader.cpp
diff --git a/third_party/WebKit/Source/platform/loader/fetch/ResourceLoader.cpp b/third_party/WebKit/Source/platform/loader/fetch/ResourceLoader.cpp
index 488ee424fd9a77e93b1c0cb835535e6a79240be4..ccced5d9ad235180405b77ea63d89947ddc2845f 100644
--- a/third_party/WebKit/Source/platform/loader/fetch/ResourceLoader.cpp
+++ b/third_party/WebKit/Source/platform/loader/fetch/ResourceLoader.cpp
@@ -29,9 +29,11 @@
#include "platform/loader/fetch/ResourceLoader.h"
+#include <memory>
#include "platform/SharedBuffer.h"
#include "platform/exported/WrappedResourceRequest.h"
#include "platform/exported/WrappedResourceResponse.h"
+#include "platform/instrumentation/inspector/PlatformInspectorTraceEvents.h"
#include "platform/loader/fetch/CrossOriginAccessControl.h"
#include "platform/loader/fetch/FetchContext.h"
#include "platform/loader/fetch/Resource.h"
@@ -48,7 +50,6 @@
#include "wtf/CurrentTime.h"
#include "wtf/PtrUtil.h"
#include "wtf/text/StringBuilder.h"
-#include <memory>
namespace blink {
@@ -371,6 +372,10 @@ void ResourceLoader::didReceiveResponse(
}
}
+ TRACE_EVENT1(
+ "devtools.timeline", "ResourceReceiveResponse", "data",
+ InspectorReceiveResponseEvent::data(m_resource->identifier(), response));
+
context().dispatchDidReceiveResponse(
m_resource->identifier(), response,
m_resource->resourceRequest().frameType(),
@@ -390,6 +395,9 @@ void ResourceLoader::didReceiveResponse(const WebURLResponse& response) {
}
void ResourceLoader::didDownloadData(int length, int encodedDataLength) {
+ TRACE_EVENT1("devtools.timeline", "ResourceReceivedData", "data",
+ InspectorReceiveDataEvent::data(m_resource->identifier(),
+ encodedDataLength));
context().dispatchDidDownloadData(m_resource->identifier(), length,
encodedDataLength);
m_resource->didDownloadData(length);
@@ -398,6 +406,9 @@ void ResourceLoader::didDownloadData(int length, int encodedDataLength) {
void ResourceLoader::didReceiveData(const char* data, int length) {
CHECK_GE(length, 0);
+ TRACE_EVENT1(
+ "devtools.timeline", "ResourceReceivedData", "data",
+ InspectorReceiveDataEvent::data(m_resource->identifier(), length));
context().dispatchDidReceiveData(m_resource->identifier(), data, length);
m_resource->addToDecodedBodyLength(length);
m_resource->appendData(data, length);
@@ -410,6 +421,10 @@ void ResourceLoader::didReceiveTransferSizeUpdate(int transferSizeDiff) {
}
void ResourceLoader::didFinishLoadingFirstPartInMultipart() {
+ TRACE_EVENT1("devtools.timeline", "ResourceFinish", "data",
+ InspectorResourceFinishEvent::data(
+ m_resource->identifier(), 0, false,
+ m_resource->response().encodedDataLength()));
network_instrumentation::endResourceLoad(
m_resource->identifier(),
network_instrumentation::RequestOutcome::Success);
@@ -421,9 +436,12 @@ void ResourceLoader::didFinishLoadingFirstPartInMultipart() {
void ResourceLoader::didFinishLoading(double finishTime,
int64_t encodedDataLength,
int64_t encodedBodyLength) {
+ TRACE_EVENT1(
+ "devtools.timeline", "ResourceFinish", "data",
+ InspectorResourceFinishEvent::data(m_resource->identifier(), finishTime,
+ false, encodedDataLength));
m_resource->setEncodedDataLength(encodedDataLength);
m_resource->addToEncodedBodyLength(encodedBodyLength);
-
m_loader.reset();
network_instrumentation::endResourceLoad(
@@ -451,6 +469,10 @@ void ResourceLoader::handleError(const ResourceError& error) {
return;
}
+ TRACE_EVENT1("devtools.timeline", "ResourceFinish", "data",
+ InspectorResourceFinishEvent::data(
+ m_resource->identifier(), 0, true,
+ m_resource->response().encodedDataLength()));
m_loader.reset();
network_instrumentation::endResourceLoad(
« no previous file with comments | « third_party/WebKit/Source/platform/instrumentation/inspector/PlatformInspectorTraceEvents.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698