chrome-devtools-frontend 1.0.1548980 → 1.0.1549484
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/contributing/settings-experiments-features.md +35 -0
- package/docs/styleguide/ux/patterns.md +27 -0
- package/eslint.config.mjs +1 -0
- package/front_end/Tests.js +2 -0
- package/front_end/core/host/InspectorFrontendHost.ts +26 -558
- package/front_end/core/host/InspectorFrontendHostAPI.ts +6 -3
- package/front_end/core/host/InspectorFrontendHostStub.ts +558 -0
- package/front_end/core/host/ResourceLoader.ts +9 -23
- package/front_end/core/host/UserMetrics.ts +4 -4
- package/front_end/core/root/DevToolsContext.ts +4 -0
- package/front_end/core/root/Runtime.ts +10 -0
- package/front_end/core/sdk/CSSMatchedStyles.ts +2 -2
- package/front_end/core/sdk/CSSModel.ts +24 -24
- package/front_end/core/sdk/CSSPropertyParserMatchers.ts +11 -11
- package/front_end/core/sdk/CSSQuery.ts +1 -1
- package/front_end/core/sdk/CSSRule.ts +2 -2
- package/front_end/core/sdk/CSSStyleDeclaration.ts +1 -1
- package/front_end/core/sdk/CSSStyleSheetHeader.ts +1 -1
- package/front_end/core/sdk/DOMModel.ts +3 -0
- package/front_end/core/sdk/NetworkManager.ts +29 -31
- package/front_end/core/sdk/NetworkRequest.ts +4 -0
- package/front_end/core/sdk/OverlayModel.ts +2 -2
- package/front_end/core/sdk/PageResourceLoader.ts +63 -37
- package/front_end/core/sdk/SourceMap.ts +6 -0
- package/front_end/core/sdk/SourceMapCache.ts +21 -0
- package/front_end/core/sdk/SourceMapManager.ts +7 -6
- package/front_end/core/sdk/SourceMapScopesInfo.ts +6 -2
- package/front_end/core/sdk/TargetManager.ts +14 -2
- package/front_end/core/sdk/sdk-meta.ts +13 -0
- package/front_end/entrypoints/formatter_worker/FormatterActions.ts +1 -0
- package/front_end/entrypoints/formatter_worker/ScopeParser.ts +1 -1
- package/front_end/entrypoints/main/MainImpl.ts +13 -3
- package/front_end/foundation/Universe.ts +1 -1
- package/front_end/generated/Deprecation.ts +18 -4
- package/front_end/generated/InspectorBackendCommands.ts +33 -31
- package/front_end/generated/SupportedCSSProperties.js +41 -41
- package/front_end/generated/protocol-mapping.d.ts +12 -0
- package/front_end/generated/protocol-proxy-api.d.ts +11 -0
- package/front_end/generated/protocol.ts +70 -35
- package/front_end/models/ai_assistance/AiConversation.ts +5 -4
- package/front_end/models/ai_assistance/ChangeManager.ts +4 -4
- package/front_end/models/ai_assistance/ConversationHandler.ts +0 -15
- package/front_end/models/ai_assistance/agents/AiAgent.ts +9 -6
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +135 -3
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +24 -0
- package/front_end/models/bindings/CompilerScriptMapping.ts +43 -0
- package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +19 -0
- package/front_end/models/bindings/ResourceMapping.ts +73 -0
- package/front_end/models/bindings/ResourceScriptMapping.ts +50 -0
- package/front_end/models/issues_manager/GenericIssue.ts +17 -0
- package/front_end/models/issues_manager/descriptions/genericNavigationEntryMarkedSkippable.md +7 -0
- package/front_end/models/javascript_metadata/NativeFunctions.js +7 -3
- package/front_end/models/source_map_scopes/FunctionCodeResolver.snapshot.txt +98 -0
- package/front_end/models/source_map_scopes/FunctionCodeResolver.ts +270 -0
- package/front_end/models/source_map_scopes/source_map_scopes.ts +2 -0
- package/front_end/models/workspace/UISourceCode.ts +51 -44
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +76 -34
- package/front_end/panels/ai_assistance/aiAssistancePanel.css +1 -0
- package/front_end/panels/ai_assistance/components/ChatView.ts +23 -11
- package/front_end/panels/application/AppManifestView.ts +3 -2
- package/front_end/panels/application/FrameDetailsView.ts +5 -6
- package/front_end/panels/application/ServiceWorkersView.ts +2 -2
- package/front_end/panels/application/TrustTokensTreeElement.ts +2 -6
- package/front_end/panels/application/components/PermissionsPolicySection.ts +201 -157
- package/front_end/panels/application/components/ProtocolHandlersView.ts +117 -80
- package/front_end/panels/application/components/ServiceWorkerRouterView.ts +47 -41
- package/front_end/panels/application/components/StorageMetadataView.ts +31 -34
- package/front_end/panels/application/components/TrustTokensView.ts +76 -68
- package/front_end/panels/console/ConsoleView.ts +3 -2
- package/front_end/panels/console/ConsoleViewMessage.ts +6 -4
- package/front_end/panels/console/console-meta.ts +0 -13
- package/front_end/panels/developer_resources/DeveloperResourcesView.ts +3 -1
- package/front_end/panels/elements/CSSRuleValidator.ts +7 -7
- package/front_end/panels/elements/CSSRuleValidatorHelper.ts +2 -2
- package/front_end/panels/elements/ElementsTreeElement.ts +16 -13
- package/front_end/panels/elements/ElementsTreeOutline.ts +2 -1
- package/front_end/panels/elements/LayoutPane.ts +12 -10
- package/front_end/panels/elements/StylePropertyTreeElement.ts +12 -12
- package/front_end/panels/elements/components/AdornerManager.ts +3 -3
- package/front_end/panels/elements/components/StylePropertyEditor.ts +6 -6
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryHighlightChipList.ts +27 -49
- package/front_end/panels/linear_memory_inspector/components/LinearMemoryInspector.ts +15 -11
- package/front_end/panels/media/PlayerListView.ts +100 -73
- package/front_end/panels/media/playerListView.css +5 -0
- package/front_end/panels/mobile_throttling/ThrottlingSettingsTab.ts +3 -3
- package/front_end/panels/network/RequestConditionsDrawer.ts +5 -5
- package/front_end/panels/network/components/DirectSocketConnectionView.ts +17 -0
- package/front_end/panels/network/resourceChunkView.css +4 -0
- package/front_end/panels/security/CookieControlsView.ts +1 -1
- package/front_end/panels/sensors/LocationsSettingsTab.ts +1 -1
- package/front_end/panels/settings/FrameworkIgnoreListSettingsTab.ts +1 -1
- package/front_end/panels/settings/KeybindsSettingsTab.ts +1 -1
- package/front_end/panels/settings/SettingsScreen.ts +6 -6
- package/front_end/panels/settings/WorkspaceSettingsTab.ts +1 -1
- package/front_end/panels/settings/emulation/DevicesSettingsTab.ts +1 -1
- package/front_end/panels/snippets/SnippetsQuickOpen.ts +4 -2
- package/front_end/panels/sources/CSSPlugin.ts +1 -1
- package/front_end/panels/sources/FilteredUISourceCodeListProvider.ts +13 -5
- package/front_end/panels/sources/GoToLineQuickOpen.ts +4 -2
- package/front_end/panels/sources/NavigatorView.ts +2 -2
- package/front_end/panels/sources/OpenFileQuickOpen.ts +7 -8
- package/front_end/panels/sources/OutlineQuickOpen.ts +6 -3
- package/front_end/panels/sources/ProfilePlugin.ts +21 -12
- package/front_end/panels/sources/UISourceCodeFrame.ts +0 -1
- package/front_end/panels/sources/filteredUISourceCodeListProvider.css +41 -0
- package/front_end/panels/timeline/TimelinePanel.ts +17 -18
- package/front_end/panels/timeline/TimelineSelectorStatsView.ts +3 -3
- package/front_end/panels/timeline/components/insights/SlowCSSSelector.ts +2 -2
- package/front_end/panels/timeline/docs/flame_chart_migration.md +11 -16
- package/front_end/panels/utils/utils.ts +17 -3
- package/front_end/panels/whats_new/ReleaseNoteText.ts +10 -20
- package/front_end/panels/whats_new/resources/WNDT.md +8 -8
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/puppeteer/third_party/mitt/README.chromium +1 -0
- package/front_end/third_party/puppeteer/third_party/parsel/README.chromium +1 -0
- package/front_end/third_party/puppeteer/third_party/rxjs/README.chromium +1 -0
- package/front_end/ui/components/adorners/Adorner.ts +1 -1
- package/front_end/ui/components/annotations/AnnotationRepository.ts +98 -0
- package/front_end/ui/components/annotations/AnnotationType.ts +10 -0
- package/front_end/ui/components/annotations/annotations.ts +6 -0
- package/front_end/ui/components/buttons/Button.ts +1 -1
- package/front_end/ui/components/buttons/FloatingButton.ts +1 -1
- package/front_end/ui/components/chrome_link/ChromeLink.ts +1 -1
- package/front_end/ui/components/dialogs/ButtonDialog.ts +1 -1
- package/front_end/ui/components/dialogs/Dialog.ts +1 -1
- package/front_end/ui/components/dialogs/ShortcutDialog.ts +1 -0
- package/front_end/ui/components/diff_view/DiffView.ts +1 -1
- package/front_end/ui/components/expandable_list/ExpandableList.ts +1 -1
- package/front_end/ui/components/highlighting/HighlightElement.ts +1 -0
- package/front_end/ui/components/highlighting/MarkupHighlight.ts +162 -0
- package/front_end/ui/components/highlighting/highlighting.ts +7 -0
- package/front_end/ui/components/icon_button/FileSourceIcon.ts +1 -1
- package/front_end/ui/components/icon_button/Icon.ts +4 -2
- package/front_end/ui/components/icon_button/IconButton.ts +1 -1
- package/front_end/ui/components/issue_counter/IssueCounter.ts +1 -1
- package/front_end/ui/components/issue_counter/IssueLinkIcon.ts +1 -1
- package/front_end/ui/components/legacy_wrapper/LegacyWrapper.ts +1 -1
- package/front_end/ui/components/linkifier/LinkifierImpl.ts +1 -1
- package/front_end/ui/components/list/List.ts +184 -0
- package/front_end/ui/components/list/list.css +90 -0
- package/front_end/ui/components/{cards/cards.ts → list/lists.ts} +3 -3
- package/front_end/ui/components/markdown_view/CodeBlock.ts +1 -1
- package/front_end/ui/components/markdown_view/MarkdownImage.ts +1 -1
- package/front_end/ui/components/markdown_view/MarkdownLink.ts +1 -1
- package/front_end/ui/components/markdown_view/MarkdownView.ts +1 -1
- package/front_end/ui/components/menus/Menu.ts +1 -1
- package/front_end/ui/components/menus/SelectMenu.ts +1 -1
- package/front_end/ui/components/node_text/NodeText.ts +1 -1
- package/front_end/ui/components/panel_feedback/FeedbackButton.ts +1 -1
- package/front_end/ui/components/panel_feedback/PanelFeedback.ts +1 -1
- package/front_end/ui/components/panel_feedback/PreviewToggle.ts +1 -1
- package/front_end/ui/components/panel_introduction_steps/PanelIntroductionSteps.ts +1 -1
- package/front_end/ui/components/report_view/ReportView.ts +1 -1
- package/front_end/ui/components/request_link_icon/RequestLinkIcon.ts +1 -1
- package/front_end/ui/components/settings/SettingCheckbox.ts +1 -1
- package/front_end/ui/components/settings/SettingDeprecationWarning.ts +1 -1
- package/front_end/ui/components/snackbars/Snackbar.ts +1 -1
- package/front_end/ui/components/spinners/Spinner.ts +1 -1
- package/front_end/ui/components/srgb_overlay/SrgbOverlay.ts +1 -1
- package/front_end/ui/components/suggestion_input/SuggestionInput.ts +1 -0
- package/front_end/ui/components/survey_link/SurveyLink.ts +1 -1
- package/front_end/ui/components/switch/SwitchImpl.ts +1 -1
- package/front_end/ui/components/text_editor/TextEditor.ts +1 -0
- package/front_end/ui/components/text_prompt/TextPrompt.ts +1 -1
- package/front_end/ui/components/tooltips/Tooltip.ts +1 -1
- package/front_end/ui/components/tree_outline/TreeOutline.ts +1 -1
- package/front_end/ui/kit/kit.ts +5 -0
- package/front_end/ui/legacy/TabbedPane.ts +98 -0
- package/front_end/ui/legacy/UIUtils.ts +0 -184
- package/front_end/ui/legacy/ViewManager.ts +23 -8
- package/front_end/ui/legacy/ViewRegistration.ts +21 -22
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +5 -4
- package/front_end/ui/legacy/components/perf_ui/LineLevelProfile.ts +73 -35
- package/front_end/ui/legacy/components/perf_ui/LiveHeapProfile.ts +11 -2
- package/front_end/ui/legacy/components/quick_open/CommandMenu.ts +12 -13
- package/front_end/ui/legacy/components/quick_open/FilteredListWidget.ts +7 -16
- package/front_end/ui/legacy/components/quick_open/HelpQuickOpen.ts +5 -6
- package/front_end/ui/legacy/components/quick_open/filteredListWidget.css +18 -65
- package/front_end/ui/legacy/components/source_frame/JSONView.ts +2 -1
- package/front_end/ui/legacy/tabbedPane.css +10 -0
- package/front_end/ui/visual_logging/KnownContextValues.ts +3 -0
- package/inspector_overlay/README.md +3 -3
- package/mcp/HostBindings.ts +310 -0
- package/mcp/mcp.ts +17 -0
- package/mcp/tsconfig.json +6 -1
- package/package.json +26 -24
- /package/front_end/ui/{components → kit}/cards/Card.ts +0 -0
- /package/front_end/ui/{components → kit}/cards/card.css +0 -0
|
@@ -2,6 +2,17 @@
|
|
|
2
2
|
// Use of this source code is governed by a BSD-style license that can be
|
|
3
3
|
// found in the LICENSE file.
|
|
4
4
|
|
|
5
|
+
// This file supports the gutter decorations visible in the Sources panel when a
|
|
6
|
+
// performance trace is active, showing either the runtime sample measures or the
|
|
7
|
+
// memory sampling (memory is behind the LiveHeapProfile experiment).
|
|
8
|
+
//
|
|
9
|
+
// When profiles are added, the associated UISourceCodes are given the profile data
|
|
10
|
+
// as decorations. The raw profile locations are mapped to original source files in
|
|
11
|
+
// this way.
|
|
12
|
+
//
|
|
13
|
+
// Note, while this is called "LineLevel", it's the profile data is actually granular
|
|
14
|
+
// to the column.
|
|
15
|
+
|
|
5
16
|
import type * as Platform from '../../../../core/platform/platform.js';
|
|
6
17
|
import * as SDK from '../../../../core/sdk/sdk.js';
|
|
7
18
|
import type * as Protocol from '../../../../generated/protocol.js';
|
|
@@ -29,8 +40,12 @@ export class Performance {
|
|
|
29
40
|
return performanceInstance;
|
|
30
41
|
}
|
|
31
42
|
|
|
32
|
-
|
|
43
|
+
initialize(profiles: CPUProfile.CPUProfileDataModel.CPUProfileDataModel[], target: SDK.Target.Target|null): void {
|
|
33
44
|
this.helper.reset();
|
|
45
|
+
for (const profile of profiles) {
|
|
46
|
+
this.appendCPUProfile(profile, target);
|
|
47
|
+
}
|
|
48
|
+
void this.helper.update();
|
|
34
49
|
}
|
|
35
50
|
|
|
36
51
|
private appendLegacyCPUProfile(
|
|
@@ -56,12 +71,13 @@ export class Performance {
|
|
|
56
71
|
}
|
|
57
72
|
}
|
|
58
73
|
|
|
59
|
-
appendCPUProfile(profile: CPUProfile.CPUProfileDataModel.CPUProfileDataModel, target: SDK.Target.Target|null):
|
|
74
|
+
private appendCPUProfile(profile: CPUProfile.CPUProfileDataModel.CPUProfileDataModel, target: SDK.Target.Target|null):
|
|
75
|
+
void {
|
|
60
76
|
if (!profile.lines) {
|
|
61
77
|
this.appendLegacyCPUProfile(profile, target);
|
|
62
|
-
this.helper.scheduleUpdate();
|
|
63
78
|
return;
|
|
64
79
|
}
|
|
80
|
+
|
|
65
81
|
if (!profile.samples || !profile.columns) {
|
|
66
82
|
return;
|
|
67
83
|
}
|
|
@@ -83,12 +99,12 @@ export class Performance {
|
|
|
83
99
|
const time = profile.timestamps[i] - profile.timestamps[i - 1];
|
|
84
100
|
this.helper.addLocationData(target, scriptIdOrUrl, {line, column}, time);
|
|
85
101
|
}
|
|
86
|
-
this.helper.scheduleUpdate();
|
|
87
102
|
}
|
|
88
103
|
}
|
|
89
104
|
|
|
90
105
|
let memoryInstance: Memory;
|
|
91
106
|
|
|
107
|
+
// Note: this is used only by LiveHeapProfile (a drawer panel) if the experiment is enabled.
|
|
92
108
|
export class Memory {
|
|
93
109
|
private readonly helper: Helper;
|
|
94
110
|
private constructor() {
|
|
@@ -108,12 +124,23 @@ export class Memory {
|
|
|
108
124
|
|
|
109
125
|
reset(): void {
|
|
110
126
|
this.helper.reset();
|
|
127
|
+
void this.helper.update();
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
initialize(profilesAndTargets: Array<{
|
|
131
|
+
profile: Protocol.HeapProfiler.SamplingHeapProfile,
|
|
132
|
+
target: SDK.Target.Target,
|
|
133
|
+
}>): void {
|
|
134
|
+
this.helper.reset();
|
|
135
|
+
for (const {profile, target} of profilesAndTargets) {
|
|
136
|
+
this.appendHeapProfile(profile, target);
|
|
137
|
+
}
|
|
138
|
+
void this.helper.update();
|
|
111
139
|
}
|
|
112
140
|
|
|
113
|
-
appendHeapProfile(profile: Protocol.HeapProfiler.SamplingHeapProfile, target: SDK.Target.Target|null): void {
|
|
141
|
+
private appendHeapProfile(profile: Protocol.HeapProfiler.SamplingHeapProfile, target: SDK.Target.Target|null): void {
|
|
114
142
|
const helper = this.helper;
|
|
115
143
|
processNode(profile.head);
|
|
116
|
-
helper.scheduleUpdate();
|
|
117
144
|
|
|
118
145
|
function processNode(node: Protocol.HeapProfiler.SamplingHeapProfileNode): void {
|
|
119
146
|
node.children.forEach(processNode);
|
|
@@ -125,8 +152,8 @@ export class Memory {
|
|
|
125
152
|
return;
|
|
126
153
|
}
|
|
127
154
|
const line = node.callFrame.lineNumber + 1;
|
|
128
|
-
|
|
129
|
-
helper.addLocationData(target, script, {line, column
|
|
155
|
+
const column = node.callFrame.columnNumber + 1;
|
|
156
|
+
helper.addLocationData(target, script, {line, column}, node.selfSize);
|
|
130
157
|
}
|
|
131
158
|
}
|
|
132
159
|
}
|
|
@@ -134,13 +161,14 @@ export class Memory {
|
|
|
134
161
|
export class Helper {
|
|
135
162
|
private readonly type: Workspace.UISourceCode.DecoratorType;
|
|
136
163
|
private readonly locationPool = new Bindings.LiveLocation.LiveLocationPool();
|
|
137
|
-
|
|
164
|
+
|
|
138
165
|
/**
|
|
139
166
|
* Given a location in a script (with line and column numbers being 1-based) stores
|
|
140
167
|
* the time spent at that location in a performance profile.
|
|
141
168
|
*/
|
|
142
|
-
private locationData =
|
|
143
|
-
|
|
169
|
+
private locationData = new Map<
|
|
170
|
+
SDK.Target.Target|null,
|
|
171
|
+
Map<Platform.DevToolsPath.UrlString|number, Workspace.UISourceCode.LineColumnProfileMap>>();
|
|
144
172
|
constructor(type: Workspace.UISourceCode.DecoratorType) {
|
|
145
173
|
this.type = type;
|
|
146
174
|
this.reset();
|
|
@@ -149,7 +177,6 @@ export class Helper {
|
|
|
149
177
|
reset(): void {
|
|
150
178
|
// The second map uses string keys for script URLs and numbers for scriptId.
|
|
151
179
|
this.locationData = new Map();
|
|
152
|
-
this.scheduleUpdate();
|
|
153
180
|
}
|
|
154
181
|
|
|
155
182
|
/**
|
|
@@ -176,20 +203,10 @@ export class Helper {
|
|
|
176
203
|
lineData.set(column, (lineData.get(column) || 0) + data);
|
|
177
204
|
}
|
|
178
205
|
|
|
179
|
-
|
|
180
|
-
if (this.updateTimer) {
|
|
181
|
-
return;
|
|
182
|
-
}
|
|
183
|
-
this.updateTimer = window.setTimeout(() => {
|
|
184
|
-
this.updateTimer = null;
|
|
185
|
-
void this.doUpdate();
|
|
186
|
-
}, 0);
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
private async doUpdate(): Promise<void> {
|
|
206
|
+
async update(): Promise<void> {
|
|
190
207
|
this.locationPool.disposeAll();
|
|
191
208
|
// Map from sources to line->value profile maps.
|
|
192
|
-
const decorationsBySource
|
|
209
|
+
const decorationsBySource: Workspace.UISourceCode.ProfileDataMap = new Map();
|
|
193
210
|
const pending: Array<Promise<void>> = [];
|
|
194
211
|
for (const [target, scriptToLineMap] of this.locationData) {
|
|
195
212
|
const debuggerModel = target ? target.model(SDK.DebuggerModel.DebuggerModel) : null;
|
|
@@ -211,18 +228,21 @@ export class Helper {
|
|
|
211
228
|
String(scriptIdOrUrl) as Protocol.Runtime.ScriptId, zeroBasedLine, zeroBasedColumn || 0);
|
|
212
229
|
if (rawLocation) {
|
|
213
230
|
pending.push(workspaceBinding.rawLocationToUILocation(rawLocation).then(uiLocation => {
|
|
214
|
-
if (uiLocation) {
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
231
|
+
if (!uiLocation) {
|
|
232
|
+
return;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
this.addLineColumnData(
|
|
236
|
+
decorationsBySource, uiLocation.uiSourceCode, uiLocation.lineNumber + 1,
|
|
237
|
+
(uiLocation.columnNumber ?? 0) + 1, data);
|
|
238
|
+
|
|
239
|
+
// If the above was a source mapped UILocation, then we also need to add it to the generated UILocation.
|
|
240
|
+
if (uiLocation.uiSourceCode.contentType().isFromSourceMap()) {
|
|
241
|
+
const script = rawLocation.script();
|
|
242
|
+
const uiSourceCode = script ? workspaceBinding.uiSourceCodeForScript(script) : null;
|
|
243
|
+
if (uiSourceCode) {
|
|
244
|
+
this.addLineColumnData(decorationsBySource, uiSourceCode, lineNumber, columnNumber, data);
|
|
224
245
|
}
|
|
225
|
-
columnMap.set((zeroBasedColumn || 0) + 1, data);
|
|
226
246
|
}
|
|
227
247
|
}));
|
|
228
248
|
}
|
|
@@ -247,4 +267,22 @@ export class Helper {
|
|
|
247
267
|
}
|
|
248
268
|
}
|
|
249
269
|
}
|
|
270
|
+
|
|
271
|
+
private addLineColumnData(
|
|
272
|
+
decorationsBySource: Workspace.UISourceCode.ProfileDataMap, uiSourceCode: Workspace.UISourceCode.UISourceCode,
|
|
273
|
+
lineOneIndexed: number, columnOneIndexed: number, data: number): void {
|
|
274
|
+
let lineMap = decorationsBySource.get(uiSourceCode);
|
|
275
|
+
if (!lineMap) {
|
|
276
|
+
lineMap = new Map();
|
|
277
|
+
decorationsBySource.set(uiSourceCode, lineMap);
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
let columnMap = lineMap.get(lineOneIndexed);
|
|
281
|
+
if (!columnMap) {
|
|
282
|
+
columnMap = new Map();
|
|
283
|
+
lineMap.set(lineOneIndexed, columnMap);
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
columnMap.set(columnOneIndexed, (columnMap.get(columnOneIndexed) ?? 0) + data);
|
|
287
|
+
}
|
|
250
288
|
}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import * as Common from '../../../../core/common/common.js';
|
|
6
6
|
import * as Host from '../../../../core/host/host.js';
|
|
7
7
|
import * as SDK from '../../../../core/sdk/sdk.js';
|
|
8
|
+
import type * as Protocol from '../../../../generated/protocol.js';
|
|
8
9
|
|
|
9
10
|
import {Memory} from './LineLevelProfile.js';
|
|
10
11
|
|
|
@@ -64,15 +65,23 @@ export class LiveHeapProfile implements Common.Runnable.Runnable,
|
|
|
64
65
|
if (sessionId !== this.sessionId) {
|
|
65
66
|
break;
|
|
66
67
|
}
|
|
67
|
-
|
|
68
|
+
|
|
69
|
+
const profilesAndTargets: Array<{
|
|
70
|
+
profile: Protocol.HeapProfiler.SamplingHeapProfile,
|
|
71
|
+
target: SDK.Target.Target,
|
|
72
|
+
}> = [];
|
|
68
73
|
for (let i = 0; i < profiles.length; ++i) {
|
|
69
74
|
const profile = profiles[i];
|
|
70
75
|
if (!profile) {
|
|
71
76
|
continue;
|
|
72
77
|
}
|
|
73
78
|
|
|
74
|
-
|
|
79
|
+
const target = models[i].target();
|
|
80
|
+
profilesAndTargets.push({profile, target});
|
|
75
81
|
}
|
|
82
|
+
|
|
83
|
+
Memory.instance().initialize(profilesAndTargets);
|
|
84
|
+
|
|
76
85
|
await Promise.race([
|
|
77
86
|
new Promise(r => window.setTimeout(r, Host.InspectorFrontendHost.isUnderTest() ? 10 : 5000)),
|
|
78
87
|
new Promise(r => {
|
|
@@ -201,7 +201,7 @@ export class CommandMenu {
|
|
|
201
201
|
locations.set(name, category);
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
|
-
const views = UI.ViewManager.getRegisteredViewExtensions();
|
|
204
|
+
const views = UI.ViewManager.ViewManager.instance().getRegisteredViewExtensions();
|
|
205
205
|
for (const view of views) {
|
|
206
206
|
const viewLocation = view.location();
|
|
207
207
|
const category = viewLocation && locations.get(viewLocation);
|
|
@@ -340,19 +340,23 @@ export class CommandMenuProvider extends Provider {
|
|
|
340
340
|
return score;
|
|
341
341
|
}
|
|
342
342
|
|
|
343
|
-
override renderItem(itemIndex: number, query: string,
|
|
343
|
+
override renderItem(itemIndex: number, query: string, wrapperElement: Element): void {
|
|
344
344
|
const command = this.commands[itemIndex];
|
|
345
345
|
|
|
346
|
+
const itemElement = wrapperElement.createChild('div');
|
|
347
|
+
const titleElement = itemElement.createChild('div');
|
|
348
|
+
|
|
346
349
|
titleElement.removeChildren();
|
|
347
350
|
const icon = IconButton.Icon.create(categoryIcons[command.category]);
|
|
348
|
-
|
|
351
|
+
wrapperElement.insertBefore(icon, itemElement);
|
|
349
352
|
UI.UIUtils.createTextChild(titleElement, command.title);
|
|
350
353
|
FilteredListWidget.highlightRanges(titleElement, query, true);
|
|
351
354
|
|
|
355
|
+
const subtitleElement = itemElement.createChild('div');
|
|
352
356
|
if (command.featurePromotionId) {
|
|
353
357
|
const badge = UI.UIUtils.maybeCreateNewBadge(command.featurePromotionId);
|
|
354
358
|
if (badge) {
|
|
355
|
-
|
|
359
|
+
itemElement.insertBefore(badge, subtitleElement);
|
|
356
360
|
}
|
|
357
361
|
}
|
|
358
362
|
|
|
@@ -360,16 +364,11 @@ export class CommandMenuProvider extends Provider {
|
|
|
360
364
|
|
|
361
365
|
const deprecationWarning = command.deprecationWarning;
|
|
362
366
|
if (deprecationWarning) {
|
|
363
|
-
const deprecatedTagElement =
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
deprecatedTagElement.title = deprecationWarning;
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
|
-
const tagElement = titleElement.parentElement?.parentElement?.createChild('span', 'tag');
|
|
370
|
-
if (!tagElement) {
|
|
371
|
-
return;
|
|
367
|
+
const deprecatedTagElement = itemElement.createChild('span', 'deprecated-tag');
|
|
368
|
+
deprecatedTagElement.textContent = i18nString(UIStrings.deprecated);
|
|
369
|
+
deprecatedTagElement.title = deprecationWarning;
|
|
372
370
|
}
|
|
371
|
+
const tagElement = wrapperElement.createChild('span', 'tag');
|
|
373
372
|
tagElement.textContent = command.category;
|
|
374
373
|
}
|
|
375
374
|
|
|
@@ -9,6 +9,7 @@ import * as Platform from '../../../../core/platform/platform.js';
|
|
|
9
9
|
import * as Geometry from '../../../../models/geometry/geometry.js';
|
|
10
10
|
import * as TextUtils from '../../../../models/text_utils/text_utils.js';
|
|
11
11
|
import * as Diff from '../../../../third_party/diff/diff.js';
|
|
12
|
+
import * as Highlighting from '../../../../ui/components/highlighting/highlighting.js';
|
|
12
13
|
import * as TextPrompt from '../../../../ui/components/text_prompt/text_prompt.js';
|
|
13
14
|
import * as VisualLogging from '../../../visual_logging/visual_logging.js';
|
|
14
15
|
import * as UI from '../../legacy.js';
|
|
@@ -147,7 +148,7 @@ export class FilteredListWidget extends Common.ObjectWrapper.eventMixin<EventTyp
|
|
|
147
148
|
ranges = rangesForMatch(text.toUpperCase(), query.toUpperCase());
|
|
148
149
|
}
|
|
149
150
|
if (ranges) {
|
|
150
|
-
|
|
151
|
+
Highlighting.highlightRangesWithStyleClass(element, ranges, 'highlight');
|
|
151
152
|
return true;
|
|
152
153
|
}
|
|
153
154
|
return false;
|
|
@@ -282,20 +283,14 @@ export class FilteredListWidget extends Common.ObjectWrapper.eventMixin<EventTyp
|
|
|
282
283
|
|
|
283
284
|
createElementForItem(item: number): Element {
|
|
284
285
|
const wrapperElement = document.createElement('div');
|
|
285
|
-
wrapperElement.className = 'filtered-list-widget-item
|
|
286
|
-
|
|
287
|
-
const itemElement = wrapperElement.createChild('div');
|
|
288
|
-
const renderAsTwoRows = this.provider?.renderAsTwoRows();
|
|
289
|
-
itemElement.className = 'filtered-list-widget-item ' + (renderAsTwoRows ? 'two-rows' : 'one-row');
|
|
290
|
-
const titleElement = itemElement.createChild('div', 'filtered-list-widget-title');
|
|
291
|
-
const subtitleElement = itemElement.createChild('div', 'filtered-list-widget-subtitle');
|
|
292
|
-
subtitleElement.textContent = '\u200B';
|
|
286
|
+
wrapperElement.className = 'filtered-list-widget-item';
|
|
287
|
+
|
|
293
288
|
if (this.provider) {
|
|
294
|
-
this.provider.renderItem(item, this.cleanValue(),
|
|
289
|
+
this.provider.renderItem(item, this.cleanValue(), wrapperElement);
|
|
295
290
|
wrapperElement.setAttribute(
|
|
296
291
|
'jslog', `${VisualLogging.item(this.provider.jslogContextAt(item)).track({click: true})}`);
|
|
297
292
|
}
|
|
298
|
-
UI.ARIAUtils.markAsOption(
|
|
293
|
+
UI.ARIAUtils.markAsOption(wrapperElement);
|
|
299
294
|
return wrapperElement;
|
|
300
295
|
}
|
|
301
296
|
|
|
@@ -627,17 +622,13 @@ export class Provider {
|
|
|
627
622
|
return 1;
|
|
628
623
|
}
|
|
629
624
|
|
|
630
|
-
renderItem(_itemIndex: number, _query: string,
|
|
625
|
+
renderItem(_itemIndex: number, _query: string, _wrapperElement: Element): void {
|
|
631
626
|
}
|
|
632
627
|
|
|
633
628
|
jslogContextAt(_itemIndex: number): string {
|
|
634
629
|
return this.jslogContext;
|
|
635
630
|
}
|
|
636
631
|
|
|
637
|
-
renderAsTwoRows(): boolean {
|
|
638
|
-
return false;
|
|
639
|
-
}
|
|
640
|
-
|
|
641
632
|
selectItem(_itemIndex: number|null, _promptValue: string): void {
|
|
642
633
|
}
|
|
643
634
|
|
|
@@ -44,13 +44,16 @@ export class HelpQuickOpen extends Provider {
|
|
|
44
44
|
return -this.providers[itemIndex].prefix.length;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
override renderItem(itemIndex: number, _query: string,
|
|
47
|
+
override renderItem(itemIndex: number, _query: string, wrapperElement: Element): void {
|
|
48
48
|
const provider = this.providers[itemIndex];
|
|
49
49
|
|
|
50
|
+
const itemElement = wrapperElement.createChild('div');
|
|
51
|
+
const titleElement = itemElement.createChild('div');
|
|
52
|
+
|
|
50
53
|
const iconElement = new IconButton.Icon.Icon();
|
|
51
54
|
iconElement.name = provider.iconName;
|
|
52
55
|
iconElement.classList.add('large');
|
|
53
|
-
|
|
56
|
+
wrapperElement.insertBefore(iconElement, itemElement);
|
|
54
57
|
|
|
55
58
|
UI.UIUtils.createTextChild(titleElement, provider.title);
|
|
56
59
|
}
|
|
@@ -64,10 +67,6 @@ export class HelpQuickOpen extends Provider {
|
|
|
64
67
|
QuickOpenImpl.show(this.providers[itemIndex].prefix);
|
|
65
68
|
}
|
|
66
69
|
}
|
|
67
|
-
|
|
68
|
-
override renderAsTwoRows(): boolean {
|
|
69
|
-
return false;
|
|
70
|
-
}
|
|
71
70
|
}
|
|
72
71
|
|
|
73
72
|
registerProvider({
|
|
@@ -58,16 +58,20 @@ devtools-text-prompt {
|
|
|
58
58
|
overflow: hidden auto;
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
.filtered-list-widget-item
|
|
61
|
+
.filtered-list-widget-item {
|
|
62
62
|
color: var(--sys-color-on-surface);
|
|
63
63
|
display: flex;
|
|
64
64
|
font-family: ".SFNSDisplay-Regular", "Helvetica Neue", "Lucida Grande", sans-serif;
|
|
65
65
|
padding: 0 var(--sys-size-7);
|
|
66
66
|
gap: var(--sys-size-7);
|
|
67
67
|
height: var(--sys-size-14);
|
|
68
|
+
white-space: break-spaces;
|
|
69
|
+
overflow: hidden;
|
|
70
|
+
text-overflow: ellipsis;
|
|
71
|
+
font-size: var(--sys-typescale-body4-size);
|
|
68
72
|
}
|
|
69
73
|
|
|
70
|
-
.filtered-list-widget-item
|
|
74
|
+
.filtered-list-widget-item devtools-icon {
|
|
71
75
|
align-self: center;
|
|
72
76
|
flex: none;
|
|
73
77
|
width: 18px;
|
|
@@ -78,84 +82,38 @@ devtools-text-prompt {
|
|
|
78
82
|
}
|
|
79
83
|
}
|
|
80
84
|
|
|
81
|
-
.filtered-list-widget-item
|
|
85
|
+
.filtered-list-widget-item.selected {
|
|
82
86
|
background-color: var(--sys-color-state-hover-on-subtle);
|
|
83
87
|
}
|
|
84
88
|
|
|
85
|
-
.filtered-list-widget-item {
|
|
86
|
-
white-space: break-spaces;
|
|
87
|
-
overflow: hidden;
|
|
88
|
-
text-overflow: ellipsis;
|
|
89
|
-
align-self: center;
|
|
90
|
-
font-size: var(--sys-typescale-body4-size);
|
|
89
|
+
.filtered-list-widget-item > div {
|
|
91
90
|
flex: auto;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
.filtered-list-widget-item.is-ignore-listed * {
|
|
95
|
-
color: var(--sys-color-state-disabled);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
.filtered-list-widget-item span.highlight {
|
|
99
|
-
font-weight: var(--ref-typeface-weight-bold);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
.filtered-list-widget-item .filtered-list-widget-title {
|
|
103
91
|
white-space: nowrap;
|
|
104
|
-
flex: initial;
|
|
105
92
|
overflow: hidden;
|
|
106
93
|
text-overflow: ellipsis;
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
flex: none;
|
|
111
|
-
overflow: hidden;
|
|
112
|
-
text-overflow: ellipsis;
|
|
113
|
-
color: var(--sys-color-on-surface-subtle);
|
|
114
|
-
padding-left: var(--sys-size-3);
|
|
94
|
+
line-height: var(--sys-typescale-body3-line-height);
|
|
95
|
+
align-items: center;
|
|
96
|
+
align-content: center;
|
|
115
97
|
display: flex;
|
|
116
|
-
|
|
98
|
+
gap: var(--sys-size-4);
|
|
117
99
|
}
|
|
118
100
|
|
|
119
|
-
.filtered-list-widget-item .
|
|
120
|
-
|
|
121
|
-
overflow: hidden;
|
|
122
|
-
text-overflow: ellipsis;
|
|
101
|
+
.filtered-list-widget-item span.highlight {
|
|
102
|
+
font-weight: var(--ref-typeface-weight-bold);
|
|
123
103
|
}
|
|
124
104
|
|
|
125
|
-
.filtered-list-widget-item
|
|
105
|
+
.filtered-list-widget-item .tag {
|
|
126
106
|
font-size: var(--sys-typescale-body5-size);
|
|
127
107
|
line-height: var(--sys-typescale-headline5-line-height);
|
|
128
108
|
align-self: center;
|
|
129
109
|
flex-shrink: 0;
|
|
130
110
|
}
|
|
131
111
|
|
|
132
|
-
.filtered-list-widget-item
|
|
112
|
+
.filtered-list-widget-item .deprecated-tag {
|
|
133
113
|
font-size: 11px;
|
|
134
114
|
color: var(--sys-color-token-subtle);
|
|
135
115
|
}
|
|
136
116
|
|
|
137
|
-
.filtered-list-widget-item.one-row {
|
|
138
|
-
line-height: var(--sys-typescale-body3-line-height);
|
|
139
|
-
align-items: center;
|
|
140
|
-
align-content: center;
|
|
141
|
-
display: flex;
|
|
142
|
-
gap: var(--sys-size-4);
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
.filtered-list-widget-item.one-row .filtered-list-widget-title {
|
|
146
|
-
display: inline;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
.filtered-list-widget-item.two-rows {
|
|
150
|
-
display: grid;
|
|
151
|
-
align-content: center;
|
|
152
|
-
gap: var(--sys-size-2);
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
.filtered-list-widget-item-wrapper:not(.search-mode) .filtered-list-widget-item.two-rows .filtered-list-widget-title {
|
|
156
|
-
font-weight: var(--ref-typeface-weight-bold);
|
|
157
|
-
}
|
|
158
|
-
|
|
159
117
|
.not-found-text {
|
|
160
118
|
height: 34px;
|
|
161
119
|
line-height: 34px;
|
|
@@ -179,18 +137,13 @@ devtools-text-prompt {
|
|
|
179
137
|
border-color: ButtonText;
|
|
180
138
|
}
|
|
181
139
|
|
|
182
|
-
.filtered-list-widget-item
|
|
183
|
-
.filtered-list-widget-item-wrapper .filtered-list-widget-subtitle,
|
|
140
|
+
.filtered-list-widget-item,
|
|
184
141
|
.quickpick-description {
|
|
185
142
|
color: ButtonText;
|
|
186
143
|
}
|
|
187
144
|
|
|
188
|
-
.filtered-list-widget-item
|
|
145
|
+
.filtered-list-widget-item.selected {
|
|
189
146
|
background-color: Highlight;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
.filtered-list-widget-item-wrapper.selected .filtered-list-widget-item .filtered-list-widget-title,
|
|
193
|
-
.filtered-list-widget-item-wrapper.selected .filtered-list-widget-item .filtered-list-widget-subtitle {
|
|
194
147
|
color: HighlightText;
|
|
195
148
|
}
|
|
196
149
|
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import * as i18n from '../../../../core/i18n/i18n.js';
|
|
7
7
|
import * as Platform from '../../../../core/platform/platform.js';
|
|
8
8
|
import * as SDK from '../../../../core/sdk/sdk.js';
|
|
9
|
+
import * as Highlighting from '../../../components/highlighting/highlighting.js';
|
|
9
10
|
import * as VisualLogging from '../../../visual_logging/visual_logging.js';
|
|
10
11
|
import * as UI from '../../legacy.js';
|
|
11
12
|
import * as ObjectUI from '../object_ui/object_ui.js';
|
|
@@ -172,7 +173,7 @@ export class JSONView extends UI.Widget.VBox implements UI.SearchableView.Search
|
|
|
172
173
|
const newFocusElement = this.currentSearchTreeElements[index];
|
|
173
174
|
if (newFocusElement) {
|
|
174
175
|
this.updateSearchIndex(index);
|
|
175
|
-
newFocusElement.setSearchRegex(this.searchRegex,
|
|
176
|
+
newFocusElement.setSearchRegex(this.searchRegex, Highlighting.highlightedCurrentSearchResultClassName);
|
|
176
177
|
newFocusElement.reveal();
|
|
177
178
|
} else {
|
|
178
179
|
this.updateSearchIndex(0);
|
|
@@ -520,3 +520,13 @@
|
|
|
520
520
|
--tabbed-pane-close-icon-color: HighlightText;
|
|
521
521
|
}
|
|
522
522
|
}
|
|
523
|
+
|
|
524
|
+
.tabbed-pane-header-tab.ai .ai-icon {
|
|
525
|
+
background-color: var(--sys-color-primary);
|
|
526
|
+
border-radius: 50%;
|
|
527
|
+
margin-left: 4px;
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
.tabbed-pane-header-tab.ai .ai-icon devtools-icon {
|
|
531
|
+
color: var(--sys-color-on-primary);
|
|
532
|
+
}
|
|
@@ -5,7 +5,7 @@ Inspector Overlay provides JS/CSS modules which are responsible for rendering th
|
|
|
5
5
|
## How build works
|
|
6
6
|
|
|
7
7
|
- Overlay modules are built using rollup and copied to $root_gen_dir.
|
|
8
|
-
- CSS files are imported using a custom rollup plugin that transforms CSS into a CSSStyleSheet.
|
|
8
|
+
- CSS files are imported using a custom rollup plugin that transforms CSS into a CSSStyleSheet. _Only use CSS imports in the bundle entrypoint_.
|
|
9
9
|
- `inspector_overlay_resources.grd` file is copied as well and it defines how modules are packaged in a `.pak` file.
|
|
10
10
|
- The Chromium build uses `inspector_overlay_resources.grd` and produces a `.pak` file.
|
|
11
11
|
- `inspector_overlay_agent.cc` extracts the modules and inlines them onto the overlay page.
|
|
@@ -41,7 +41,7 @@ generated modules and notify you if they are too big.
|
|
|
41
41
|
|
|
42
42
|
## Tests
|
|
43
43
|
|
|
44
|
-
Overlay modules can be unit tested like other parts of DevTools. For an example, see `test/unittests/front_end/inspector_overlay/
|
|
44
|
+
Overlay modules can be unit tested like other parts of DevTools. For an example, see `test/unittests/front_end/inspector_overlay/common.test.ts`.
|
|
45
45
|
|
|
46
46
|
## Lifecycle of the overlay
|
|
47
47
|
|
|
@@ -56,4 +56,4 @@ Then when the overlay is being painted, the following calls are made by the back
|
|
|
56
56
|
- `reset(params)` to notify the overlay about actual params of the page such as viewport size, device scale factor and others.
|
|
57
57
|
- Invokes tool-specific methods such as `drawHighlight`.
|
|
58
58
|
|
|
59
|
-
In the overlay code, these calls are received through a global `dispatch(methodName, ...args)` function.
|
|
59
|
+
In the overlay code, these calls are received through a global `dispatch(methodName, ...args)` function.
|