Skip to content

Commit 3b94868

Browse files
committed
Roll browser-protocol
This roll requires a manual review. See http://go/reviewed-rolls for guidance. In case of failures or errors, reach out to someone from config/owner/COMMON_OWNERS. Roll created at https://cr-buildbucket.appspot.com/build/8727432914367464769 [email protected] Fixed: 385693302 Change-Id: I6e7fa2f1414a2a5b92774b5c7c5e953ada6e3288 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6123626 Reviewed-by: Samiya Caur <[email protected]> Commit-Queue: Benedikt Meurer <[email protected]> Owners-Override: Benedikt Meurer <[email protected]>
1 parent 6b00bc4 commit 3b94868

File tree

9 files changed

+36
-29
lines changed

9 files changed

+36
-29
lines changed

DEPS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ vars = {
2424
'inspector_protocol_revision': '69d69ddf3aa698b171886551a4a672c5af1ad902',
2525

2626
# Keeping track of the last time we rollerd the browser protocol files.
27-
'chromium_browser_protocol_revision' : '2b758d7f6b384321fbd622b9d5e4a4fe3859f7b4',
27+
'chromium_browser_protocol_revision' : 'b53d566f0eff2aa1de7f7c33e3aa2deaa7774c37',
2828

2929
'clang_format_url': 'https://chromium.googlesource.com/external/github.com/llvm/llvm-project/clang/tools/clang-format.git',
3030
'clang_format_revision': '37f6e68a107df43b7d7e044fd36a13cbae3413f2',

front_end/generated/InspectorBackendCommands.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

front_end/generated/protocol.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -737,8 +737,8 @@ export namespace Audits {
737737
/**
738738
* The unique request id.
739739
*/
740-
requestId: Network.RequestId;
741-
url?: string;
740+
requestId?: Network.RequestId;
741+
url: string;
742742
}
743743

744744
/**

front_end/panels/application/preloading/components/PreloadingDetailsReportView.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -201,17 +201,16 @@ export class PreloadingDetailsReportView extends LegacyWrapper.LegacyWrapper.Wra
201201
if (attempt.action === Protocol.Preload.SpeculationAction.Prefetch && attempt.requestId !== undefined) {
202202
// Disabled until https://crbug.com/1079231 is fixed.
203203
// clang-format off
204+
const {requestId, key: {url}} = attempt;
205+
const affectedRequest: {requestId?: Protocol.Network.RequestId, url?: string} = {requestId, url};
204206
value = html`
205207
<devtools-request-link-icon
206208
.data=${
207209
{
208-
affectedRequest: {
209-
requestId: attempt.requestId,
210-
url: attempt.key.url,
211-
},
210+
affectedRequest,
212211
requestResolver: this.#data.requestResolver || new Logs.RequestResolver.RequestResolver(),
213212
displayURL: true,
214-
urlToDisplay: attempt.key.url,
213+
urlToDisplay: url,
215214
}
216215
}
217216
>

front_end/panels/issues/IssueAggregator.test.ts

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,16 @@ import {StubIssue} from '../../testing/StubIssue.js';
1717

1818
import * as Issues from './issues.js';
1919

20+
function requestIds(...issues: Issues.IssueAggregator.AggregatedIssue[]): Set<string|undefined> {
21+
const requestIds = new Set<string|undefined>();
22+
for (const issue of issues) {
23+
for (const {requestId} of issue.requests()) {
24+
requestIds.add(requestId);
25+
}
26+
}
27+
return requestIds;
28+
}
29+
2030
describeWithEnvironment('AggregatedIssue', () => {
2131
const aggregationKey = 'key' as unknown as Issues.IssueAggregator.AggregationKey;
2232
it('deduplicates network requests across issues', () => {
@@ -27,8 +37,7 @@ describeWithEnvironment('AggregatedIssue', () => {
2737
aggregatedIssue.addInstance(issue1);
2838
aggregatedIssue.addInstance(issue2);
2939

30-
const actualRequestIds = [...aggregatedIssue.requests()].map(r => r.requestId).sort();
31-
assert.deepStrictEqual(actualRequestIds, ['id1', 'id2']);
40+
assert.deepEqual(requestIds(aggregatedIssue), new Set(['id1', 'id2']));
3241
});
3342

3443
it('deduplicates affected cookies across issues', () => {
@@ -66,10 +75,7 @@ describeWithMockConnection('IssueAggregator', () => {
6675
mockManager.dispatchEventToListeners(
6776
IssuesManager.IssuesManager.Events.ISSUE_ADDED, {issuesModel: model, issue: issue2});
6877

69-
const issues = Array.from(aggregator.aggregatedIssues());
70-
assert.strictEqual(issues.length, 1);
71-
const requestIds = [...issues[0].requests()].map(r => r.requestId).sort();
72-
assert.deepStrictEqual(requestIds, ['id1', 'id2']);
78+
assert.deepEqual(requestIds(...aggregator.aggregatedIssues()), new Set(['id1', 'id2']));
7379
});
7480

7581
it('deduplicates issues with the same code added before its creation', () => {
@@ -87,10 +93,7 @@ describeWithMockConnection('IssueAggregator', () => {
8793
mockManager.dispatchEventToListeners(
8894
IssuesManager.IssuesManager.Events.ISSUE_ADDED, {issuesModel: model, issue: issue2});
8995

90-
const issues = Array.from(aggregator.aggregatedIssues());
91-
assert.strictEqual(issues.length, 1);
92-
const requestIds = [...issues[0].requests()].map(r => r.requestId).sort();
93-
assert.deepStrictEqual(requestIds, ['id1', 'id2', 'id3']);
96+
assert.deepEqual(requestIds(...aggregator.aggregatedIssues()), new Set(['id1', 'id2', 'id3']));
9497
});
9598

9699
it('keeps issues with different codes separate', () => {

front_end/panels/issues/IssueAggregator.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ export class AggregatedIssue extends IssuesManager.Issue.Issue {
3030
hasRequest: boolean,
3131
}>();
3232
#affectedRawCookieLines = new Map<string, {rawCookieLine: string, hasRequest: boolean}>();
33-
#affectedRequests = new Map<string, Protocol.Audits.AffectedRequest>();
33+
#affectedRequests = new Array<Protocol.Audits.AffectedRequest>();
34+
#affectedRequestIds = new Set<Protocol.Network.RequestId>();
3435
#affectedLocations = new Map<string, Protocol.Audits.SourceCodeLocation>();
3536
#heavyAdIssues = new Set<IssuesManager.HeavyAdIssue.HeavyAdIssue>();
3637
#blockedByResponseDetails = new Map<string, Protocol.Audits.BlockedByResponseIssueDetails>();
@@ -175,9 +176,13 @@ export class AggregatedIssue extends IssuesManager.Issue.Issue {
175176
this.#issueKind = IssuesManager.Issue.unionIssueKind(this.#issueKind, issue.getKind());
176177
let hasRequest = false;
177178
for (const request of issue.requests()) {
179+
const {requestId} = request;
178180
hasRequest = true;
179-
if (!this.#affectedRequests.has(request.requestId)) {
180-
this.#affectedRequests.set(request.requestId, request);
181+
if (requestId === undefined) {
182+
this.#affectedRequests.push(request);
183+
} else if (!this.#affectedRequestIds.has(requestId)) {
184+
this.#affectedRequests.push(request);
185+
this.#affectedRequestIds.add(requestId);
181186
}
182187
}
183188
for (const cookie of issue.cookies()) {

front_end/ui/components/request_link_icon/RequestLinkIcon.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const coordinator = Coordinator.RenderCoordinator.RenderCoordinator.instance();
4242
export interface RequestLinkIconData {
4343
linkToPreflight?: boolean;
4444
request?: SDK.NetworkRequest.NetworkRequest|null;
45-
affectedRequest?: {requestId: Protocol.Network.RequestId, url?: string};
45+
affectedRequest?: {requestId?: Protocol.Network.RequestId, url?: string};
4646
highlightHeader?: {section: NetworkForward.UIRequestLocation.UIHeaderSection, name: string};
4747
networkTab?: NetworkForward.UIRequestLocation.UIRequestTabs;
4848
requestResolver?: Logs.RequestResolver.RequestResolver;
@@ -71,7 +71,7 @@ export class RequestLinkIcon extends HTMLElement {
7171
#displayURL: boolean = false;
7272
#urlToDisplay?: string;
7373
#networkTab?: NetworkForward.UIRequestLocation.UIRequestTabs;
74-
#affectedRequest?: {requestId: Protocol.Network.RequestId, url?: string};
74+
#affectedRequest?: {requestId?: Protocol.Network.RequestId, url?: string};
7575
#additionalOnClickAction?: () => void;
7676
#reveal = Common.Revealer.reveal;
7777

@@ -90,7 +90,7 @@ export class RequestLinkIcon extends HTMLElement {
9090
if (data.revealOverride) {
9191
this.#reveal = data.revealOverride;
9292
}
93-
if (!this.#request && data.affectedRequest) {
93+
if (!this.#request && data.affectedRequest && typeof data.affectedRequest.requestId !== 'undefined') {
9494
if (!this.#requestResolver) {
9595
throw new Error('A `RequestResolver` must be provided if an `affectedRequest` is provided.');
9696
}
@@ -183,7 +183,7 @@ export class RequestLinkIcon extends HTMLElement {
183183
// the concrete network request, or at least its request ID, we surround
184184
// the URL with a button, that opens the request in the Network panel.
185185
let template = this.#maybeRenderURL();
186-
if (this.#request || this.#affectedRequest?.requestId) {
186+
if (this.#request || this.#affectedRequest?.requestId !== undefined) {
187187
// clang-format off
188188
template = html`
189189
<button class=${LitHtml.Directives.classMap({link: Boolean(this.#request)})}

third_party/blink/public/devtools_protocol/browser_protocol.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1017,11 +1017,11 @@
10171017
{
10181018
"name": "requestId",
10191019
"description": "The unique request id.",
1020+
"optional": true,
10201021
"$ref": "Network.RequestId"
10211022
},
10221023
{
10231024
"name": "url",
1024-
"optional": true,
10251025
"type": "string"
10261026
}
10271027
]

third_party/blink/public/devtools_protocol/browser_protocol.pdl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -499,8 +499,8 @@ experimental domain Audits
499499
type AffectedRequest extends object
500500
properties
501501
# The unique request id.
502-
Network.RequestId requestId
503-
optional string url
502+
optional Network.RequestId requestId
503+
string url
504504

505505
# Information about the frame affected by an inspector issue.
506506
type AffectedFrame extends object

0 commit comments

Comments
 (0)