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

Unified Diff: third_party/WebKit/Source/core/loader/FrameFetchContext.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
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 dc641a6aded042f8c6ee8d9a1520c12dbaad2d49..3ac619e8d1f71a7b3a8008d3ea1f66dd82759481 100644
--- a/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
+++ b/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
@@ -32,6 +32,7 @@
#include <algorithm>
#include <memory>
+
#include "bindings/core/v8/ScriptController.h"
#include "bindings/core/v8/V8DOMActivityLogger.h"
#include "core/dom/Document.h"
@@ -66,6 +67,7 @@
#include "core/timing/DOMWindowPerformance.h"
#include "core/timing/Performance.h"
#include "platform/WebFrameScheduler.h"
+#include "platform/instrumentation/inspector/PlatformInspectorTraceEvents.h"
#include "platform/instrumentation/tracing/TracedValue.h"
#include "platform/loader/fetch/ClientHintsPreferences.h"
#include "platform/loader/fetch/FetchInitiatorTypeNames.h"
@@ -470,9 +472,8 @@ void FrameFetchContext::dispatchDidReceiveData(unsigned long identifier,
void FrameFetchContext::dispatchDidReceiveEncodedData(unsigned long identifier,
int encodedDataLength) {
- TRACE_EVENT1(
- "devtools.timeline", "ResourceReceivedData", "data",
- InspectorReceiveDataEvent::data(identifier, frame(), encodedDataLength));
+ TRACE_EVENT1("devtools.timeline", "ResourceReceivedData", "data",
+ InspectorReceiveDataEvent::data(identifier, encodedDataLength));
InspectorInstrumentation::didReceiveEncodedDataLength(frame(), identifier,
encodedDataLength);
}
@@ -480,9 +481,8 @@ void FrameFetchContext::dispatchDidReceiveEncodedData(unsigned long identifier,
void FrameFetchContext::dispatchDidDownloadData(unsigned long identifier,
int dataLength,
int encodedDataLength) {
- TRACE_EVENT1(
- "devtools.timeline", "ResourceReceivedData", "data",
- InspectorReceiveDataEvent::data(identifier, frame(), encodedDataLength));
+ TRACE_EVENT1("devtools.timeline", "ResourceReceivedData", "data",
+ InspectorReceiveDataEvent::data(identifier, encodedDataLength));
frame()->loader().progress().incrementProgress(identifier, dataLength);
InspectorInstrumentation::didReceiveData(frame(), identifier, 0, dataLength);
InspectorInstrumentation::didReceiveEncodedDataLength(frame(), identifier,
@@ -492,9 +492,6 @@ void FrameFetchContext::dispatchDidDownloadData(unsigned long identifier,
void FrameFetchContext::dispatchDidFinishLoading(unsigned long identifier,
double finishTime,
int64_t encodedDataLength) {
- TRACE_EVENT1("devtools.timeline", "ResourceFinish", "data",
- InspectorResourceFinishEvent::data(identifier, finishTime, false,
- encodedDataLength));
frame()->loader().progress().completeProgress(identifier);
InspectorInstrumentation::didFinishLoading(frame(), identifier, finishTime,
encodedDataLength);
@@ -506,9 +503,6 @@ void FrameFetchContext::dispatchDidFail(unsigned long identifier,
const ResourceError& error,
int64_t encodedDataLength,
bool isInternalRequest) {
- TRACE_EVENT1("devtools.timeline", "ResourceFinish", "data",
- InspectorResourceFinishEvent::data(identifier, 0, true,
- encodedDataLength));
frame()->loader().progress().completeProgress(identifier);
InspectorInstrumentation::didFailLoading(frame(), identifier, error);
// Notification to FrameConsole should come AFTER InspectorInstrumentation
@@ -534,6 +528,9 @@ void FrameFetchContext::dispatchDidLoadResourceFromMemoryCache(
InspectorInstrumentation::markResourceAsCached(frame(), identifier);
if (!resource->response().isNull()) {
+ TRACE_EVENT1(
+ "devtools.timeline", "ResourceReceiveResponse", "data",
+ InspectorReceiveResponseEvent::data(identifier, resource->response()));
dispatchDidReceiveResponseInternal(identifier, resource->response(),
frameType, requestContext, resource,
LinkLoader::DoNotLoadResources);
@@ -542,6 +539,8 @@ void FrameFetchContext::dispatchDidLoadResourceFromMemoryCache(
if (resource->encodedSize() > 0)
dispatchDidReceiveData(identifier, 0, resource->encodedSize());
+ TRACE_EVENT1("devtools.timeline", "ResourceFinish", "data",
+ InspectorResourceFinishEvent::data(identifier, 0, false, 0));
dispatchDidFinishLoading(identifier, 0, 0);
}
@@ -1074,9 +1073,6 @@ void FrameFetchContext::dispatchDidReceiveResponseInternal(
WebURLRequest::RequestContext requestContext,
Resource* resource,
LinkLoader::CanLoadResources resourceLoadingPolicy) {
- TRACE_EVENT1(
- "devtools.timeline", "ResourceReceiveResponse", "data",
- InspectorReceiveResponseEvent::data(identifier, frame(), response));
MixedContentChecker::checkMixedPrivatePublic(frame(),
response.remoteIPAddress());
if (m_documentLoader &&

Powered by Google App Engine
This is Rietveld 408576698