Skip to content

Commit

Permalink
more
Browse files Browse the repository at this point in the history
  • Loading branch information
connorjclark committed Jun 4, 2024
1 parent 508b46a commit aa54aa2
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion core/audits/byte-efficiency/offscreen-images.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ class OffscreenImages extends ByteEfficiencyAudit {
if (node.type === 'cpu' && timing.duration >= 50) {
lastLongTaskStartTime = Math.max(lastLongTaskStartTime, timing.startTime);
} else if (node.type === 'network') {
startTimesByURL.set(node.record.url, timing.startTime);
startTimesByURL.set(node.request.url, timing.startTime);
}
}

Expand Down
2 changes: 1 addition & 1 deletion core/audits/byte-efficiency/render-blocking-resources.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ class RenderBlockingResources extends Audit {
));

// Add the inlined bytes to the HTML response
const originalTransferSize = minimalFCPGraph.record.transferSize;
const originalTransferSize = minimalFCPGraph.request.transferSize;
const safeTransferSize = originalTransferSize || 0;
minimalFCPGraph.request.transferSize = safeTransferSize + totalChildNetworkBytes;
const estimateAfterInline = simulator.simulate(minimalFCPGraph).timeInMs;
Expand Down
4 changes: 2 additions & 2 deletions core/audits/dobetterweb/uses-http2.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ class UsesHTTP2Audit extends Audit {
const originalProtocols = new Map();
graph.traverse(node => {
if (node.type !== 'network') return;
if (!urlsToChange.has(node.record.url)) return;
if (!urlsToChange.has(node.request.url)) return;

originalProtocols.set(node.request.requestId, node.record.protocol);
originalProtocols.set(node.request.requestId, node.request.protocol);
node.request.protocol = 'h2';
});

Expand Down
2 changes: 1 addition & 1 deletion core/audits/prioritize-lcp-image.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ class PrioritizeLcpImage extends Audit {
wastedMs,
results: [{
node: Audit.makeNodeItem(lcpElement.node),
url: lcpNode.record.url,
url: lcpNode.request.url,
wastedMs,
}],
};
Expand Down
1 change: 0 additions & 1 deletion core/lib/lantern/network-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ const NON_NETWORK_SCHEMES = [
];

/**
* Use `NetworkRequest.isNonNetworkRequest(req)` if working with a request.
* Note: the `protocol` field from CDP can be 'h2', 'http', (not 'https'!) or it'll be url's scheme.
* https://source.chromium.org/chromium/chromium/src/+/main:content/browser/devtools/protocol/network_handler.cc;l=598-611;drc=56d4a9a9deb30be73adcee8737c73bcb2a5ab64f
* However, a `new URL(href).protocol` has a colon suffix.
Expand Down
2 changes: 1 addition & 1 deletion core/lib/lantern/simulator/simulator.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const NodeState = {
Complete: 3,
};

/** @type {Record<NetworkNode['record']['priority'], number>} */
/** @type {Record<NetworkNode['request']['priority'], number>} */
const PriorityStartTimePenalty = {
VeryHigh: 0,
High: 0.25,
Expand Down

0 comments on commit aa54aa2

Please sign in to comment.