Skip to content

Commit d018a6a

Browse files
authored
Merge branch 'ChromeDevTools:main' into main
2 parents 0a1d33f + 79db863 commit d018a6a

File tree

325 files changed

+1912
-1734
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

325 files changed

+1912
-1734
lines changed

.vscode/devtools-workspace-tasks.json

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,43 @@
2424
}
2525
}
2626
]
27+
},
28+
{
29+
"label": "Create Widget",
30+
"type": "shell",
31+
"command": "node",
32+
"args": [
33+
"${workspaceFolder}/scripts/scaffold/scaffold-widget.js",
34+
"${input:widgetPath}",
35+
"${input:widgetName}"
36+
],
37+
"options": {
38+
"cwd": "${workspaceFolder}"
39+
},
40+
"problemMatcher": [],
41+
"presentation": {
42+
"echo": true,
43+
"reveal": "always",
44+
"focus": false,
45+
"panel": "shared",
46+
"showReuseMessage": false,
47+
"clear": false
48+
},
49+
"group": {
50+
"kind": "build",
51+
"isDefault": false
52+
}
53+
}],
54+
"inputs": [
55+
{
56+
"id": "widgetPath",
57+
"type": "promptString",
58+
"description": "Enter the path to create the widget (e.g., front_end/panels/ai_assistance)"
59+
},
60+
{
61+
"id": "widgetName",
62+
"type": "promptString",
63+
"description": "Enter the WidgetName (PascalCase, e.g., MyWidget)"
2764
}
2865
]
2966
}

DEPS

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,24 @@ vars = {
1515
'build_revision': 'e13953ced04ed05f45aa3c961bd6d802aced74ec',
1616

1717
'buildtools_url': 'https://chromium.googlesource.com/chromium/src/buildtools.git',
18-
'buildtools_revision': 'e9b36e9ffb02b268d194c3f82f89952d09d0c714',
18+
'buildtools_revision': 'cd169314af80e77a75eb25e2c0df8798f35bc04a',
1919

2020
'depot_tools_url': 'https://chromium.googlesource.com/chromium/tools/depot_tools.git',
21-
'depot_tools_revision': 'f810dae27200e4209bd0cba85bd2266ec0d55312',
21+
'depot_tools_revision': '0888983e473613d853c419245b97294e46497798',
2222

2323
'inspector_protocol_url': 'https://chromium.googlesource.com/deps/inspector_protocol',
2424
'inspector_protocol_revision': '6d1ae0f13aae6ad381ca31b17b88a0f5af29ca94',
2525

2626
# Keeping track of the last time we rollerd the browser protocol files.
27-
'chromium_browser_protocol_revision' : 'f351d8b201937d9402701c01bb3ba07eb2001ae0',
27+
'chromium_browser_protocol_revision' : '3313d9b6b84ff455dbf0edfee0bb15bbc23b30ba',
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',
3131

3232
'emscripten_tag': 'ade9d780ff17c88d81aa13860361743e3c1e1396',
3333

3434
# GN CIPD package version.
35-
'gn_version': 'git_revision:0c25d1bbde6ef17e1e6d3938011f56a00c02e457',
35+
'gn_version': 'git_revision:cad8f67e2dd0cea00bbe4566efe2fdf4c1821563',
3636

3737
'cmake_version': 'version:2@3.21.3',
3838

@@ -49,7 +49,7 @@ vars = {
4949
# Chrome version used for tests. It should be regularly updated to
5050
# match the Canary version listed here:
5151
# https://googlechromelabs.github.io/chrome-for-testing/last-known-good-versions.json
52-
'chrome': '138.0.7182.0',
52+
'chrome': '138.0.7190.0',
5353

5454
# 'magic' text to tell depot_tools that git submodules should be accepted but
5555
# but parity with DEPS file is expected.
@@ -59,7 +59,7 @@ vars = {
5959
'non_git_source': 'True',
6060

6161
# siso CIPD package version
62-
'siso_version': 'git_revision:30ea210712239b874febcadf661f118fc2c0f6d7',
62+
'siso_version': 'git_revision:d9393c2115244b6e4a797189055e4a2b6769a64d',
6363
}
6464

6565
# Only these hosts are allowed for dependencies in this DEPS file.

buildtools

Submodule buildtools updated from e9b36e9 to cd16931

eslint.config.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,8 @@ export default defineConfig([
540540
'no-array-constructor': 'off',
541541
'@typescript-eslint/no-array-constructor': 'error',
542542

543+
'@typescript-eslint/consistent-indexed-object-style': 'error',
544+
543545
'rulesdir/no-underscored-properties': 'error',
544546
'rulesdir/inline-type-imports': 'error',
545547

extensions/cxx_debugging/src/DevToolsPluginHost.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export class WorkerPlugin implements Chrome.DevTools.LanguageExtensionPlugin, As
9898

9999
export interface Storage {
100100
onChanged: Chrome.DevTools
101-
.EventSink<(changes: {[key: string]: {oldValue: unknown, newValue: unknown}}, namespace: string) => unknown>;
101+
.EventSink<(changes: Record<string, {oldValue: unknown, newValue: unknown}>, namespace: string) => unknown>;
102102
local:
103103
{set<ResultT>(value: ResultT): void, get<ResultT>(keys: ResultT, callback: (result: ResultT) => unknown): void};
104104
}

extensions/cxx_debugging/src/ExtensionOptions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -651,7 +651,7 @@ export class ExtensionOptions extends HTMLElement {
651651
this.render();
652652
}
653653

654-
private updateConfigurations(data: {[key: string]: unknown}): void {
654+
private updateConfigurations(data: Record<string, unknown>): void {
655655
if (this.timeoutId !== undefined) {
656656
window.clearTimeout(this.timeoutId);
657657
}
@@ -661,7 +661,7 @@ export class ExtensionOptions extends HTMLElement {
661661
}
662662

663663
private render(): void {
664-
const configurations = new Promise<{[key: string]: unknown}>(
664+
const configurations = new Promise<Record<string, unknown>>(
665665
resolve => chrome.storage.local.get(
666666
{moduleConfigurations: DEFAULT_MODULE_CONFIGURATIONS, logPluginApiCalls: false}, resolve));
667667
const moduleConfigurationListPromise = configurations.then(

extensions/cxx_debugging/src/Formatters.ts

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,11 @@ CustomFormatters.addFormatter({
150150
type CharArrayConstructor = Uint8ArrayConstructor|Uint16ArrayConstructor|Uint32ArrayConstructor;
151151

152152
function formatRawString<T extends CharArrayConstructor>(
153-
wasm: WasmInterface, value: Value, charType: T, decode: (chars: InstanceType<T>) => string): string|{
154-
[key: string]: Value|null,
155-
}
156-
{
153+
wasm: WasmInterface,
154+
value: Value,
155+
charType: T,
156+
decode: (chars: InstanceType<T>) => string,
157+
): string|Record<string, Value|null> {
157158
const address = value.asUint32();
158159
if (address < Constants.SAFE_HEAP_START) {
159160
return formatPointerOrReference(wasm, value);
@@ -184,24 +185,15 @@ function formatRawString<T extends CharArrayConstructor>(
184185
return formatPointerOrReference(wasm, value);
185186
}
186187

187-
export function formatCString(wasm: WasmInterface, value: Value): string|{
188-
[key: string]: Value|null,
189-
}
190-
{
188+
export function formatCString(wasm: WasmInterface, value: Value): string|Record<string, Value|null> {
191189
return formatRawString(wasm, value, Uint8Array, str => new TextDecoder().decode(str));
192190
}
193191

194-
export function formatU16CString(wasm: WasmInterface, value: Value): string|{
195-
[key: string]: Value|null,
196-
}
197-
{
192+
export function formatU16CString(wasm: WasmInterface, value: Value): string|Record<string, Value|null> {
198193
return formatRawString(wasm, value, Uint16Array, str => new TextDecoder('utf-16le').decode(str));
199194
}
200195

201-
export function formatCWString(wasm: WasmInterface, value: Value): string|{
202-
[key: string]: Value|null,
203-
}
204-
{
196+
export function formatCWString(wasm: WasmInterface, value: Value): string|Record<string, Value|null> {
205197
// emscripten's wchar is 4 byte
206198
return formatRawString(wasm, value, Uint32Array, str => Array.from(str).map(v => String.fromCodePoint(v)).join(''));
207199
}
@@ -247,7 +239,7 @@ function reMatch(...exprs: RegExp[]): (type: TypeInfo) => boolean {
247239

248240
CustomFormatters.addFormatter({types: reMatch(/^std::vector<.+>$/), format: formatVector});
249241

250-
export function formatPointerOrReference(wasm: WasmInterface, value: Value): {[key: string]: Value|null} {
242+
export function formatPointerOrReference(wasm: WasmInterface, value: Value): Record<string, Value|null> {
251243
const address = value.asUint32();
252244
if (address === 0) {
253245
return {'0x0': null};
@@ -256,7 +248,7 @@ export function formatPointerOrReference(wasm: WasmInterface, value: Value): {[k
256248
}
257249
CustomFormatters.addFormatter({types: type => type.isPointer, format: formatPointerOrReference});
258250

259-
export function formatDynamicArray(wasm: WasmInterface, value: Value): {[key: string]: Value|null} {
251+
export function formatDynamicArray(wasm: WasmInterface, value: Value): Record<string, Value|null> {
260252
return {[`0x${value.location.toString(16)}`]: value.$(0)};
261253
}
262254
CustomFormatters.addFormatter({types: reMatch(/^.+\[\]$/), format: formatDynamicArray});

extensions/cxx_debugging/tests/TestUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ export class TestValue implements Value {
172172
address = address ?? elements[0].location;
173173
content.setUint32(0, address, true);
174174
const space = elements[0].typeNames[0].endsWith('*') ? '' : ' ';
175-
const members: {[key: string|number]: TestValue} = {'*': elements[0]};
175+
const members: Record<string|number, TestValue> = {'*': elements[0]};
176176
for (let i = 0; i < elements.length; ++i) {
177177
members[i] = elements[i];
178178
}

front_end/core/common/Color.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,7 @@ describe('Color', () => {
587587
});
588588

589589
it('retains and returns the authored text', () => {
590-
const lime: {[key in Common.Color.Format]: string} = {
590+
const lime: Record<Common.Color.Format, string> = {
591591
[Common.Color.Format.HEX]: '#00ff00',
592592
[Common.Color.Format.HEXA]: '#00ff00ff',
593593
[Common.Color.Format.RGB]: 'rgb(0 255 0)',

front_end/core/common/EventTarget.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,8 @@ export function removeEventListeners(eventList: EventDescriptor[]): void {
2222

2323
// This type can be used as the type parameter for `EventTarget`/`ObjectWrapper`
2424
// when the set of events is not known at compile time.
25-
export interface GenericEvents {
26-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
27-
[eventName: string]: any;
28-
}
25+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
26+
export type GenericEvents = Record<string, any>;
2927

3028
export type EventPayloadToRestParameters<Events, T extends keyof Events> = Events[T] extends void ? [] : [Events[T]];
3129
export type EventListener<Events, T extends keyof Events> = (arg0: EventTargetEvent<Events[T], Events>) => void;

front_end/core/common/JavaScriptMetaData.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@ export interface DOMPinnedWebIDLProp {
1111
export interface DOMPinnedWebIDLType {
1212
inheritance?: string;
1313
includes?: string[];
14-
props?: {
15-
[PropName: string]: DOMPinnedWebIDLProp,
16-
};
14+
props?: Record<string, DOMPinnedWebIDLProp>;
1715
rules?: DOMPinnedWebIDLRule[];
1816
}
1917

front_end/core/common/MapWithDefault.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import * as Common from './common.js';
77
const MapWithDefault = Common.MapWithDefault.MapWithDefault;
88

99
function convertToObject(map: Common.MapWithDefault.MapWithDefault<string, Map<string, string>>): Object {
10-
const ret: {[key: string]: {[key: string]: string}} = {};
10+
const ret: Record<string, Record<string, string>> = {};
1111
for (const [key1, map1] of map.entries()) {
12-
const ret1: {[key: string]: string} = {};
12+
const ret1: Record<string, string> = {};
1313
for (const [key2, value] of map1.entries()) {
1414
ret1[key2] = value;
1515
}

front_end/core/common/ResourceType.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,10 @@ const UIStrings = {
149149
*@description Name of a network initiator type
150150
*/
151151
webbundle: 'WebBundle',
152+
/**
153+
*@description Name of a network initiator type for FedCM requests
154+
*/
155+
fedcm: 'FedCM',
152156
} as const;
153157

154158
const str_ = i18n.i18n.registerUIStrings('core/common/ResourceType.ts', UIStrings);
@@ -424,6 +428,7 @@ export const resourceTypes = {
424428
SourceMapStyleSheet:
425429
new ResourceType('sm-stylesheet', i18nLazyString(UIStrings.stylesheet), resourceCategories.Stylesheet, true),
426430
WebBundle: new ResourceType('webbundle', i18nLazyString(UIStrings.webbundle), resourceCategories.Other, false),
431+
FedCM: new ResourceType('fedcm', i18nLazyString(UIStrings.fedcm), resourceCategories.Other, false),
427432
} as const;
428433

429434
const mimeTypeByName = new Map([

front_end/core/common/Settings.ts

Lines changed: 12 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -306,11 +306,8 @@ export class SettingsStorage {
306306

307307
dumpSizes(): void {
308308
Console.instance().log('Ten largest settings: ');
309-
310-
const sizes: {
311-
[x: string]: number,
312-
// @ts-expect-error __proto__ optimization
313-
} = {__proto__: null};
309+
// @ts-expect-error __proto__ optimization
310+
const sizes: Record<string, number> = {__proto__: null};
314311
for (const key in this.object) {
315312
sizes[key] = this.object[key].length;
316313
}
@@ -751,9 +748,7 @@ export class VersionController {
751748
}
752749

753750
updateVersionFrom4To5(): void {
754-
const settingNames: {
755-
[x: string]: string,
756-
} = {
751+
const settingNames: Record<string, string> = {
757752
FileSystemViewSidebarWidth: 'fileSystemViewSplitViewState',
758753
elementsSidebarWidth: 'elementsPanelSplitViewState',
759754
StylesPaneSplitRatio: 'stylesPaneSplitViewState',
@@ -805,9 +800,7 @@ export class VersionController {
805800
}
806801

807802
updateVersionFrom5To6(): void {
808-
const settingNames: {
809-
[x: string]: string,
810-
} = {
803+
const settingNames: Record<string, string> = {
811804
debuggerSidebarHidden: 'sourcesPanelSplitViewState',
812805
navigatorHidden: 'sourcesPanelNavigatorSplitViewState',
813806
'WebInspector.Drawer.showOnLoad': 'Inspector.drawerSplitViewState',
@@ -918,11 +911,8 @@ export class VersionController {
918911
const newList = [];
919912
for (let i = 0; i < list.length; ++i) {
920913
const value = list[i];
921-
const device: {
922-
// TODO(crbug.com/1172300) Ignored during the jsdoc to ts migration
923-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
924-
[x: string]: any,
925-
} = {};
914+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
915+
const device: Record<string, any> = {};
926916
device['title'] = value['title'];
927917
device['type'] = 'unknown';
928918
device['user-agent'] = value['userAgent'];
@@ -967,9 +957,7 @@ export class VersionController {
967957
// eslint-disable-next-line @typescript-eslint/no-explicit-any
968958
const setting = Settings.instance().createLocalSetting<any>('workspaceExcludedFolders', {});
969959
const oldValue = setting.get();
970-
const newValue: {
971-
[x: string]: string[],
972-
} = {};
960+
const newValue: Record<string, string[]> = {};
973961
for (const fileSystemPath in oldValue) {
974962
newValue[fileSystemPath] = [];
975963
for (const entry of oldValue[fileSystemPath]) {
@@ -1015,9 +1003,7 @@ export class VersionController {
10151003
// eslint-disable-next-line @typescript-eslint/no-explicit-any
10161004
const setting = Settings.instance().createLocalSetting<any>('workspaceExcludedFolders', {});
10171005
const oldValue = setting.get();
1018-
const newValue: {
1019-
[x: string]: string,
1020-
} = {};
1006+
const newValue: Record<string, string> = {};
10211007
for (const oldKey in oldValue) {
10221008
let newKey = oldKey.replace(/\\/g, '/');
10231009
if (!newKey.startsWith('file://')) {
@@ -1041,11 +1027,9 @@ export class VersionController {
10411027
visibleColumns.name = true;
10421028
visibleColumns.timeline = true;
10431029

1044-
const configs: {
1045-
[x: string]: {
1046-
visible: number,
1047-
},
1048-
} = {};
1030+
const configs: Record<string, {
1031+
visible: number,
1032+
}> = {};
10491033
for (const columnId in visibleColumns) {
10501034
if (!visibleColumns.hasOwnProperty(columnId)) {
10511035
continue;
@@ -1066,9 +1050,7 @@ export class VersionController {
10661050

10671051
updateVersionFrom20To21(): void {
10681052
const networkColumns = Settings.instance().createSetting('networkLogColumns', {});
1069-
const columns = (networkColumns.get() as {
1070-
[x: string]: string,
1071-
});
1053+
const columns = (networkColumns.get() as Record<string, string>);
10721054
delete columns['timeline'];
10731055
delete columns['waterfall'];
10741056
networkColumns.set(columns);

front_end/core/host/InspectorFrontendHost.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -379,12 +379,8 @@ export class InspectorFrontendHostStub implements InspectorFrontendHostAPI {
379379
registerPreference(_name: string, _options: {synced?: boolean}): void {
380380
}
381381

382-
getPreferences(callback: (arg0: {
383-
[x: string]: string,
384-
}) => void): void {
385-
const prefs: {
386-
[x: string]: string,
387-
} = {};
382+
getPreferences(callback: (arg0: Record<string, string>) => void): void {
383+
const prefs: Record<string, string> = {};
388384
for (const name in window.localStorage) {
389385
prefs[name] = window.localStorage[name];
390386
}
@@ -633,9 +629,7 @@ initializeInspectorFrontendHost();
633629
globalThis.InspectorFrontendAPI = new InspectorFrontendAPIImpl();
634630
})();
635631

636-
export function isUnderTest(prefs?: {
637-
[x: string]: string,
638-
}): boolean {
632+
export function isUnderTest(prefs?: Record<string, string>): boolean {
639633
// Integration tests rely on test queryParam.
640634
if (Root.Runtime.Runtime.queryParam('test')) {
641635
return true;

0 commit comments

Comments
 (0)