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

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

Issue 2473283003: DevTools: add per-frame grouping into aggregated timeline details (Closed)
Patch Set: rebased Created 4 years, 1 month 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/InspectorTraceEvents.cpp
diff --git a/third_party/WebKit/Source/core/inspector/InspectorTraceEvents.cpp b/third_party/WebKit/Source/core/inspector/InspectorTraceEvents.cpp
index 6662f6fa036448a928224b207fab6261eac7fcd9..8372a49337d481db434ade3776be96a53be342bb 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorTraceEvents.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorTraceEvents.cpp
@@ -168,6 +168,12 @@ const char* pseudoTypeToString(CSSSelector::PseudoType pseudoType) {
return "";
}
+String urlForFrame(LocalFrame* frame) {
+ KURL url = frame->document()->url();
+ url.removeFragmentIdentifier();
+ return url.getString();
+}
+
} // namespace
namespace InspectorScheduleStyleInvalidationTrackingEvent {
@@ -744,12 +750,15 @@ std::unique_ptr<TracedValue> frameEventData(LocalFrame* frame) {
value->setString("frame", toHexString(frame));
bool isMainFrame = frame && frame->isMainFrame();
value->setBoolean("isMainFrame", isMainFrame);
- value->setString("page", toHexString(frame));
+ value->setString("page", toHexString(frame->localFrameRoot()));
return value;
}
std::unique_ptr<TracedValue> InspectorCommitLoadEvent::data(LocalFrame* frame) {
- return frameEventData(frame);
+ std::unique_ptr<TracedValue> frameData = frameEventData(frame);
+ frameData->setString("url", urlForFrame(frame));
+ frameData->setString("name", frame->tree().name());
+ return frameData;
}
std::unique_ptr<TracedValue> InspectorMarkLoadEvent::data(LocalFrame* frame) {
@@ -930,7 +939,18 @@ std::unique_ptr<TracedValue> InspectorTracingStartedInFrame::data(
LocalFrame* frame) {
std::unique_ptr<TracedValue> value = TracedValue::create();
value->setString("sessionId", sessionId);
- value->setString("page", toHexString(frame));
+ value->setString("page", toHexString(frame->localFrameRoot()));
+ value->beginArray("frames");
+ for (Frame* f = frame; f; f = f->tree().traverseNext(frame)) {
+ if (!f->isLocalFrame())
+ continue;
+ value->beginDictionary();
+ value->setString("frame", toHexString(f));
+ value->setString("url", urlForFrame(toLocalFrame(f)));
+ value->setString("name", f->tree().name());
+ value->endDictionary();
+ }
+ value->endArray();
return value;
}

Powered by Google App Engine
This is Rietveld 408576698