Skip to content

Commit 420b33e

Browse files
Connor ClarkDevtools-frontend LUCI CQ
authored andcommitted
[RPP] In trace_app, ignore frames not in the primary main frame
Sometimes, these irrelevant frames are listed first in the frame tree, resulting in them being the primary frame (the first `Target.attachedToTarget` event emitted by RehydratingConnection). That broke source map resolution in the Performance panel. Instead, ignore such frames in EnhancedTraceParser. Fixed: 455887912 Change-Id: I4812ed8061fe3c4e2c44a957958560d7f9ffba27 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/7091024 Reviewed-by: Paul Irish <[email protected]> Commit-Queue: Connor Clark <[email protected]> Auto-Submit: Connor Clark <[email protected]>
1 parent 02e4714 commit 420b33e

File tree

8 files changed

+676
-5
lines changed

8 files changed

+676
-5
lines changed

front_end/core/sdk/EnhancedTracesParser.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ describe('EnhancedTracesParser', () => {
225225
};
226226

227227
beforeEach(async function() {
228-
const events = await TraceLoader.rawEvents(this, 'enhanced-traces.json.gz');
228+
const events = await TraceLoader.rawEvents(this, 'enhanced-traces.json');
229229
enhancedTracesParser =
230230
new SDK.EnhancedTracesParser.EnhancedTracesParser({traceEvents: events as object[], metadata: {}});
231231
});

front_end/core/sdk/EnhancedTracesParser.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,10 @@ export class EnhancedTracesParser {
164164
if (frame.url === 'about:blank') {
165165
continue;
166166
}
167+
if (!frame.isInPrimaryMainFrame) {
168+
continue;
169+
}
170+
167171
const frameId = frame.frame as string as Protocol.Target.TargetID;
168172
if (!this.#targets.find(target => target.targetId === frameId)) {
169173
const frameType = frame.isOutermostMainFrame ? 'page' : 'iframe';

front_end/models/trace/handlers/ScriptsHandler.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ describe('ScriptsHandler', () => {
1111
Trace.Handlers.ModelHandlers.Meta.reset();
1212
Trace.Handlers.ModelHandlers.NetworkRequests.reset();
1313
Trace.Handlers.ModelHandlers.Scripts.reset();
14-
const events = await TraceLoader.rawEvents(this, 'enhanced-traces.json.gz');
14+
const events = await TraceLoader.rawEvents(this, 'enhanced-traces.json');
1515
for (const event of events) {
1616
Trace.Handlers.ModelHandlers.Meta.handleEvent(event);
1717
Trace.Handlers.ModelHandlers.NetworkRequests.handleEvent(event);

front_end/panels/timeline/TimelinePanel.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ describeWithEnvironment('TimelinePanel', function() {
360360
});
361361

362362
it('saves an enhanced trace file without sourcemaps', async function() {
363-
const {traceEvents, metadata} = await TraceLoader.traceFile(this, 'enhanced-traces.json.gz');
363+
const {traceEvents, metadata} = await TraceLoader.traceFile(this, 'enhanced-traces.json');
364364
await timeline.innerSaveToFile(traceEvents, metadata, {
365365
includeScriptContent: true,
366366
includeSourceMaps: false,

front_end/panels/timeline/fixtures/traces/BUILD.gn

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ copy_to_gen("traces") {
3333
"dupe-js-inline-maps.json.gz",
3434
"dupe-js.json.gz",
3535
"enhanced-paul.json.gz",
36-
"enhanced-traces.json.gz",
36+
"enhanced-traces.json",
3737
"example-dot-com.json.gz",
3838
"extension-tracks-and-marks.json.gz",
3939
"fenced-frame-fledge.json.gz",

front_end/panels/timeline/fixtures/traces/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,13 @@ A bunch of bundles with the exact same content: https://dupe-modules-lh-2.surge.
9191

9292
Like above, but the source maps are inline data urls. https://dupe-modules-lh-inline-data.surge.sh/smaller.html
9393

94-
### enhanced-traces.json.gz
94+
### enhanced-traces.json
9595

9696
a) Contains traces with metadata needed to power a rehydrated session for enhanced tracing.
9797
b) (faked) script contents and source map urls, from the new "enhanced traces" feature. See http://crbug.com/337909145
9898

99+
Not compressed because this is small and often modified.
100+
99101
### forced-layouts-and-no-gpu.json.gz
100102

101103
A trace that contains a button that, when clicked, will iterate over 30 paragraphs and increment their width to the width of a div. This causes a forced layout event for each one. Additionally this trace contains no GPU thread.

0 commit comments

Comments
 (0)