chrome-devtools-frontend 1.0.1667564 → 1.0.1669021
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/.agents/skills/devtools-ci/SKILL.md +65 -0
- package/.agents/skills/devtools-setting-migration/SKILL.md +290 -0
- package/.agents/skills/gerrit-cli/SKILL.md +59 -0
- package/.agents/skills/gerrit-cli/references/commands.md +93 -0
- package/.agents/skills/gerrit-cli/references/workflows.md +56 -0
- package/.agents/skills/gerrit-cli/scripts/gerrit_client_wrapper.py +47 -0
- package/.agents/skills/gerrit-cli/scripts/import_upstream.py +230 -0
- package/.agents/skills/ui-eng-vision-widget-promoter/SKILL.md +11 -4
- package/.agents/skills/ui-widgets/SKILL.md +25 -1
- package/docs/contributing/infrastructure.md +7 -1
- package/docs/ui_engineering.md +44 -1
- package/front_end/core/common/Settings.ts +11 -4
- package/front_end/core/host/AidaClient.ts +66 -47
- package/front_end/core/host/GcaClient.ts +4 -6
- package/front_end/core/host/ResourceLoader.ts +4 -2
- package/front_end/core/root/Runtime.ts +5 -5
- package/front_end/core/sdk/CSSModel.test.api.ts +102 -0
- package/front_end/core/sdk/CSSModel.ts +3 -2
- package/front_end/core/sdk/ConsoleModel.ts +3 -2
- package/front_end/core/sdk/DebuggerModel.ts +16 -7
- package/front_end/core/sdk/SDKSettings.ts +38 -0
- package/front_end/core/sdk/sdk-meta.ts +0 -120
- package/front_end/core/sdk/sdk.ts +2 -0
- package/front_end/entrypoints/main/MainImpl.ts +10 -3
- package/front_end/foundation/Universe.ts +7 -0
- package/front_end/generated/InspectorBackendCommands.ts +2 -2
- package/front_end/generated/protocol.ts +11 -3
- package/front_end/models/ai_assistance/AiAgent2.ts +1 -1
- package/front_end/models/ai_assistance/AiUtils.ts +67 -4
- package/front_end/models/ai_assistance/BuiltInAi.ts +11 -6
- package/front_end/models/ai_assistance/ChangeManager.ts +17 -1
- package/front_end/models/ai_assistance/StorageItem.ts +26 -5
- package/front_end/models/ai_code_completion/AiCodeCompletion.ts +2 -19
- package/front_end/models/ai_code_generation/AiCodeGeneration.ts +2 -3
- package/front_end/models/javascript_metadata/NativeFunctions.js +22 -9
- package/front_end/models/source_map_scopes/NamesResolver.ts +23 -17
- package/front_end/models/trace/handlers/RendererHandler.ts +20 -4
- package/front_end/models/trace/types/File.ts +1 -0
- package/front_end/models/workspace/UISourceCode.ts +0 -10
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +61 -182
- package/front_end/panels/ai_assistance/components/ChatInput.ts +25 -8
- package/front_end/panels/ai_assistance/components/ChatMessage.ts +13 -69
- package/front_end/panels/ai_assistance/components/ChatView.ts +14 -8
- package/front_end/panels/ai_assistance/components/chatMessage.css +2 -20
- package/front_end/panels/application/ApplicationPanelSidebar.ts +2 -2
- package/front_end/panels/application/ApplicationPanelTreeElement.ts +41 -3
- package/front_end/panels/application/ServiceWorkerUpdateCycleView.ts +131 -134
- package/front_end/panels/application/ServiceWorkersView.ts +8 -8
- package/front_end/panels/application/application.ts +2 -0
- package/front_end/panels/application/components/AdsView.ts +10 -6
- package/front_end/panels/application/preloading/PreloadingView.ts +53 -45
- package/front_end/panels/application/preloading/components/PreloadingDetailsReportView.ts +111 -119
- package/front_end/panels/application/preloading/components/preloadingDetailsReportView.css +22 -24
- package/front_end/panels/application/serviceWorkerUpdateCycleView.css +105 -102
- package/front_end/panels/common/AiCodeCompletionDisclaimer.ts +107 -96
- package/front_end/panels/common/AiCodeCompletionSummaryToolbar.ts +17 -19
- package/front_end/panels/common/AiCodeCompletionTeaser.ts +6 -6
- package/front_end/panels/common/AiCodeGenerationTeaser.ts +28 -26
- package/front_end/panels/common/common.ts +1 -1
- package/front_end/panels/console/ConsoleInsightTeaser.ts +6 -8
- package/front_end/panels/console/ConsoleView.ts +6 -4
- package/front_end/panels/console/ConsoleViewMessage.ts +1 -1
- package/front_end/panels/console/console-meta.ts +28 -0
- package/front_end/panels/elements/StylesAiCodeCompletionProvider.ts +1 -1
- package/front_end/panels/elements/StylesSidebarPane.ts +3 -2
- package/front_end/panels/emulation/DeviceModeToolbar.ts +2 -2
- package/front_end/panels/emulation/DeviceModeView.ts +63 -104
- package/front_end/panels/emulation/DeviceModeWrapper.ts +18 -4
- package/front_end/panels/explain/components/ConsoleInsight.ts +4 -6
- package/front_end/panels/explain/explain-meta.ts +7 -49
- package/front_end/panels/network/NetworkDataGridNode.ts +1 -1
- package/front_end/panels/network/NetworkLogView.ts +1 -0
- package/front_end/panels/network/OriginalResourceChunkView.ts +340 -0
- package/front_end/panels/network/ResourceChunkView.ts +72 -46
- package/front_end/panels/network/ResourceDirectSocketChunkView.ts +3 -2
- package/front_end/panels/network/ResourceWebSocketFrameView.ts +3 -3
- package/front_end/panels/network/originalResourceChunkView.css +49 -0
- package/front_end/panels/screencast/ScreencastView.ts +401 -260
- package/front_end/panels/screencast/screencastView.css +113 -100
- package/front_end/panels/sensors/LocationsSettingsTab.ts +329 -135
- package/front_end/panels/sensors/locationsSettingsTab.css +78 -4
- package/front_end/panels/settings/AISettingsTab.ts +17 -100
- package/front_end/panels/snippets/ScriptSnippetFileSystem.ts +2 -2
- package/front_end/panels/snippets/SnippetsQuickOpen.ts +4 -4
- package/front_end/panels/sources/AddSourceMapURLDialog.ts +3 -3
- package/front_end/panels/sources/AiCodeCompletionPlugin.ts +4 -3
- package/front_end/panels/sources/BreakpointEditDialog.ts +14 -14
- package/front_end/panels/sources/BreakpointsView.ts +14 -14
- package/front_end/panels/sources/CallStackSidebarPane.ts +6 -6
- package/front_end/panels/sources/CategorizedBreakpointL10n.ts +18 -18
- package/front_end/panels/sources/CoveragePlugin.ts +7 -7
- package/front_end/panels/sources/DebuggerPausedMessage.ts +23 -23
- package/front_end/panels/sources/DebuggerPlugin.ts +31 -31
- package/front_end/panels/sources/FilteredUISourceCodeListProvider.ts +2 -2
- package/front_end/panels/sources/GoToLineQuickOpen.ts +10 -10
- package/front_end/panels/sources/NavigatorView.ts +34 -27
- package/front_end/panels/sources/OutlineQuickOpen.ts +3 -3
- package/front_end/panels/sources/PersistenceActions.ts +9 -9
- package/front_end/panels/sources/ProfilePlugin.ts +1 -1
- package/front_end/panels/sources/ScopeChainSidebarPane.ts +5 -5
- package/front_end/panels/sources/SnippetsPlugin.ts +2 -2
- package/front_end/panels/sources/SourcesNavigator.ts +20 -18
- package/front_end/panels/sources/SourcesPanel.ts +26 -25
- package/front_end/panels/sources/SourcesView.ts +5 -6
- package/front_end/panels/sources/TabbedEditorContainer.ts +3 -3
- package/front_end/panels/sources/ThreadsSidebarPane.ts +1 -1
- package/front_end/panels/sources/UISourceCodeFrame.ts +0 -2
- package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +7 -7
- package/front_end/panels/sources/components/HeadersView.ts +2 -2
- package/front_end/panels/sources/sources-meta.ts +164 -71
- package/front_end/panels/sources/sources.ts +0 -2
- package/front_end/panels/timeline/TimelineHistoryManager.ts +14 -3
- package/front_end/panels/timeline/TimelineLoader.ts +72 -42
- package/front_end/panels/timeline/TimelinePanel.ts +29 -4
- package/front_end/panels/timeline/timelineHistoryManager.css +4 -0
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/puppeteer/README.chromium +2 -2
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.d.ts +187 -1
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +91 -38
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Browser.d.ts +145 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Browser.js +0 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/BrowserContext.d.ts +0 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/BrowserContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/BrowserContext.js +0 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/BrowserContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Dialog.d.ts +3 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Dialog.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Dialog.js +8 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Dialog.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/JSHandle.d.ts +0 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/JSHandle.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/JSHandle.js +0 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/JSHandle.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Page.d.ts +1 -3
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Page.js +0 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Realm.d.ts +0 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Realm.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Realm.js +0 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Realm.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/BidiOverCdp.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/BidiOverCdp.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/BidiOverCdp.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Browser.d.ts +5 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Browser.js +12 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/HTTPResponse.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/HTTPResponse.js +4 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/HTTPResponse.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Browser.d.ts +5 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Browser.js +49 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/EventEmitter.d.ts +0 -6
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/EventEmitter.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/EventEmitter.js +0 -6
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/EventEmitter.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/generated/injected.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/generated/injected.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/generated/injected.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/generated/injected.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/injected/util.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/injected/util.js +3 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/injected/util.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/ScreenRecorder.d.ts +0 -3
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/ScreenRecorder.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/ScreenRecorder.js +0 -3
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/ScreenRecorder.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/revisions.d.ts +3 -3
- package/front_end/third_party/puppeteer/package/lib/puppeteer/revisions.js +3 -3
- package/front_end/third_party/puppeteer/package/lib/puppeteer/util/disposable.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/util/disposable.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/util/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/util/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/types.d.ts +187 -1
- package/front_end/third_party/puppeteer/package/package.json +5 -5
- package/front_end/third_party/puppeteer/package/src/api/Browser.ts +155 -2
- package/front_end/third_party/puppeteer/package/src/api/BrowserContext.ts +0 -2
- package/front_end/third_party/puppeteer/package/src/api/Dialog.ts +10 -2
- package/front_end/third_party/puppeteer/package/src/api/JSHandle.ts +0 -2
- package/front_end/third_party/puppeteer/package/src/api/Page.ts +1 -3
- package/front_end/third_party/puppeteer/package/src/api/Realm.ts +0 -1
- package/front_end/third_party/puppeteer/package/src/bidi/BidiOverCdp.ts +4 -2
- package/front_end/third_party/puppeteer/package/src/bidi/Browser.ts +17 -0
- package/front_end/third_party/puppeteer/package/src/bidi/HTTPResponse.ts +5 -4
- package/front_end/third_party/puppeteer/package/src/cdp/Browser.ts +66 -0
- package/front_end/third_party/puppeteer/package/src/common/EventEmitter.ts +0 -6
- package/front_end/third_party/puppeteer/package/src/generated/injected.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/injected/util.ts +4 -1
- package/front_end/third_party/puppeteer/package/src/node/ScreenRecorder.ts +0 -3
- package/front_end/third_party/puppeteer/package/src/revisions.ts +3 -3
- package/front_end/third_party/puppeteer/package/src/util/disposable.ts +2 -2
- package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
- package/front_end/ui/components/text_editor/AiCodeCompletionProvider.ts +9 -7
- package/front_end/ui/components/text_editor/AiCodeGenerationProvider.ts +7 -8
- package/front_end/ui/legacy/Dialog.ts +103 -4
- package/front_end/ui/legacy/InspectorView.ts +1 -5
- package/front_end/ui/legacy/PopoverHelper.ts +5 -5
- package/front_end/ui/legacy/TabbedPane.ts +7 -2
- package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +40 -24
- package/front_end/ui/legacy/components/data_grid/DataGrid.ts +1 -0
- package/front_end/ui/legacy/components/data_grid/DataGridElement.ts +8 -4
- package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +14 -7
- package/front_end/ui/legacy/components/quick_open/CommandMenu.ts +11 -1
- package/front_end/ui/visual_logging/KnownContextValues.ts +3 -0
- package/package.json +1 -1
- package/front_end/panels/sources/AiWarningInfobarPlugin.ts +0 -78
|
@@ -6,8 +6,6 @@ import * as Common from '../../core/common/common.js';
|
|
|
6
6
|
import * as Host from '../../core/host/host.js';
|
|
7
7
|
import * as Root from '../../core/root/root.js';
|
|
8
8
|
|
|
9
|
-
let builtInAiInstance: BuiltInAi|undefined;
|
|
10
|
-
|
|
11
9
|
export interface LanguageModel {
|
|
12
10
|
promptStreaming: (arg0: string, opts?: {
|
|
13
11
|
signal?: AbortSignal,
|
|
@@ -33,10 +31,11 @@ export class BuiltInAi extends Common.ObjectWrapper.ObjectWrapper<EventTypes> {
|
|
|
33
31
|
#currentlyCreatingSession = false;
|
|
34
32
|
|
|
35
33
|
static instance(): BuiltInAi {
|
|
36
|
-
if (
|
|
37
|
-
|
|
34
|
+
if (!Root.DevToolsContext.globalInstance().has(BuiltInAi)) {
|
|
35
|
+
Root.DevToolsContext.globalInstance().set(BuiltInAi, new BuiltInAi());
|
|
38
36
|
}
|
|
39
|
-
|
|
37
|
+
|
|
38
|
+
return Root.DevToolsContext.globalInstance().get(BuiltInAi);
|
|
40
39
|
}
|
|
41
40
|
|
|
42
41
|
constructor() {
|
|
@@ -107,6 +106,12 @@ export class BuiltInAi extends Common.ObjectWrapper.ObjectWrapper<EventTypes> {
|
|
|
107
106
|
}
|
|
108
107
|
|
|
109
108
|
#isGpuAvailable(): boolean {
|
|
109
|
+
// In node-based API tests, there is no global `document` available. Since this
|
|
110
|
+
// class is instantiated during Universe bootstrapping, we need to guard against
|
|
111
|
+
// using document when not in the browser.
|
|
112
|
+
if (typeof document === 'undefined') {
|
|
113
|
+
return false;
|
|
114
|
+
}
|
|
110
115
|
const canvas = document.createElement('canvas');
|
|
111
116
|
try {
|
|
112
117
|
const webgl = canvas.getContext('webgl');
|
|
@@ -197,7 +202,7 @@ Your instructions are as follows:
|
|
|
197
202
|
}
|
|
198
203
|
|
|
199
204
|
static removeInstance(): void {
|
|
200
|
-
|
|
205
|
+
Root.DevToolsContext.globalInstance().delete(BuiltInAi);
|
|
201
206
|
}
|
|
202
207
|
|
|
203
208
|
async * getConsoleInsight(prompt: string, abortController: AbortController): AsyncGenerator<string> {
|
|
@@ -25,13 +25,15 @@ function formatStyles(styles: Record<string, string>, indent = 2): string {
|
|
|
25
25
|
* primarily for stylesheet generation based on all changes.
|
|
26
26
|
*/
|
|
27
27
|
export class ChangeManager {
|
|
28
|
+
readonly #targetManager: SDK.TargetManager.TargetManager;
|
|
28
29
|
readonly #stylesheetMutex = new Common.Mutex.Mutex();
|
|
29
30
|
readonly #cssModelToStylesheetId =
|
|
30
31
|
new Map<SDK.CSSModel.CSSModel, Map<Protocol.Page.FrameId, Protocol.DOM.StyleSheetId>>();
|
|
31
32
|
readonly #stylesheetChanges = new Map<Protocol.DOM.StyleSheetId, Change[]>();
|
|
32
33
|
|
|
33
34
|
constructor(targetManager: SDK.TargetManager.TargetManager = SDK.TargetManager.TargetManager.instance()) {
|
|
34
|
-
targetManager
|
|
35
|
+
this.#targetManager = targetManager;
|
|
36
|
+
this.#targetManager.addModelListener(
|
|
35
37
|
SDK.ResourceTreeModel.ResourceTreeModel,
|
|
36
38
|
SDK.ResourceTreeModel.Events.PrimaryPageChanged,
|
|
37
39
|
this.clear,
|
|
@@ -39,6 +41,20 @@ export class ChangeManager {
|
|
|
39
41
|
);
|
|
40
42
|
}
|
|
41
43
|
|
|
44
|
+
dispose(): void {
|
|
45
|
+
this.#targetManager.removeModelListener(
|
|
46
|
+
SDK.ResourceTreeModel.ResourceTreeModel,
|
|
47
|
+
SDK.ResourceTreeModel.Events.PrimaryPageChanged,
|
|
48
|
+
this.clear,
|
|
49
|
+
this,
|
|
50
|
+
);
|
|
51
|
+
for (const cssModel of this.#cssModelToStylesheetId.keys()) {
|
|
52
|
+
cssModel.removeEventListener(SDK.CSSModel.Events.ModelDisposed, this.#onCssModelDisposed, this);
|
|
53
|
+
}
|
|
54
|
+
this.#cssModelToStylesheetId.clear();
|
|
55
|
+
this.#stylesheetChanges.clear();
|
|
56
|
+
}
|
|
57
|
+
|
|
42
58
|
async clear(): Promise<void> {
|
|
43
59
|
const models = Array.from(this.#cssModelToStylesheetId.keys());
|
|
44
60
|
const results = await Promise.allSettled(models.map(async model => {
|
|
@@ -2,6 +2,8 @@
|
|
|
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
|
+
export const EMPTY_ORIGIN = '';
|
|
6
|
+
|
|
5
7
|
export class StorageItem {
|
|
6
8
|
constructor(
|
|
7
9
|
/**
|
|
@@ -10,12 +12,20 @@ export class StorageItem {
|
|
|
10
12
|
*/
|
|
11
13
|
readonly primaryTargetOrigin: string,
|
|
12
14
|
/**
|
|
13
|
-
* The origin of the selected storage or cookie item
|
|
14
|
-
* If
|
|
15
|
+
* The origin of the selected storage or cookie item.
|
|
16
|
+
* If empty (''), this represents a generic category-level context (e.g., all Local Storage or all Cookies).
|
|
15
17
|
*/
|
|
16
|
-
readonly origin: string,
|
|
18
|
+
readonly origin: string = EMPTY_ORIGIN,
|
|
17
19
|
) {
|
|
18
20
|
}
|
|
21
|
+
|
|
22
|
+
get isGenericContext(): boolean {
|
|
23
|
+
return this.origin === EMPTY_ORIGIN;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
static createGenericContext(primaryTargetOrigin: string, ..._args: unknown[]): StorageItem {
|
|
27
|
+
return new StorageItem(primaryTargetOrigin, EMPTY_ORIGIN);
|
|
28
|
+
}
|
|
19
29
|
}
|
|
20
30
|
|
|
21
31
|
export class DOMStorageItem extends StorageItem {
|
|
@@ -23,18 +33,29 @@ export class DOMStorageItem extends StorageItem {
|
|
|
23
33
|
primaryTargetOrigin: string,
|
|
24
34
|
origin: string,
|
|
25
35
|
/** The storage key partition identifier used by the browser storage engine. */
|
|
26
|
-
readonly storageKey: string,
|
|
36
|
+
readonly storageKey: string|undefined,
|
|
27
37
|
/** The sub-category of DOM storage: 'localStorage' or 'sessionStorage'. */
|
|
28
|
-
readonly type:
|
|
38
|
+
readonly type: 'localStorage'|'sessionStorage',
|
|
29
39
|
/** The optional specific key of the selected item in this storage partition. */
|
|
30
40
|
readonly key?: string,
|
|
31
41
|
) {
|
|
32
42
|
super(primaryTargetOrigin, origin);
|
|
33
43
|
}
|
|
44
|
+
|
|
45
|
+
static override createGenericContext(
|
|
46
|
+
primaryTargetOrigin: string,
|
|
47
|
+
type: 'localStorage'|'sessionStorage',
|
|
48
|
+
): DOMStorageItem {
|
|
49
|
+
return new DOMStorageItem(primaryTargetOrigin, EMPTY_ORIGIN, undefined, type);
|
|
50
|
+
}
|
|
34
51
|
}
|
|
35
52
|
|
|
36
53
|
export class CookieItem extends StorageItem {
|
|
37
54
|
constructor(primaryTargetOrigin: string, origin: string, readonly name?: string) {
|
|
38
55
|
super(primaryTargetOrigin, origin);
|
|
39
56
|
}
|
|
57
|
+
|
|
58
|
+
static override createGenericContext(primaryTargetOrigin: string): CookieItem {
|
|
59
|
+
return new CookieItem(primaryTargetOrigin, EMPTY_ORIGIN);
|
|
60
|
+
}
|
|
40
61
|
}
|
|
@@ -145,18 +145,15 @@ export class AiCodeCompletion {
|
|
|
145
145
|
#renderingTimeout?: number;
|
|
146
146
|
#aidaRequestCache?: CachedRequest;
|
|
147
147
|
#lastEmptyResponseText?: string;
|
|
148
|
-
// TODO(b/445394511): Remove panel from the class
|
|
149
|
-
#panel: ContextFlavor;
|
|
150
148
|
#callbacks?: Callbacks;
|
|
151
149
|
|
|
152
150
|
readonly #sessionId: string = crypto.randomUUID();
|
|
153
151
|
readonly #aidaClient: Host.AidaClient.AidaClient;
|
|
154
152
|
readonly #serverSideLoggingEnabled: boolean;
|
|
155
153
|
|
|
156
|
-
constructor(opts: AgentOptions,
|
|
154
|
+
constructor(opts: AgentOptions, callbacks?: Callbacks, stopSequences?: string[]) {
|
|
157
155
|
this.#aidaClient = opts.aidaClient;
|
|
158
156
|
this.#serverSideLoggingEnabled = opts.serverSideLoggingEnabled ?? false;
|
|
159
|
-
this.#panel = panel;
|
|
160
157
|
this.#stopSequences = stopSequences ?? [];
|
|
161
158
|
this.#callbacks = callbacks;
|
|
162
159
|
}
|
|
@@ -172,15 +169,7 @@ export class AiCodeCompletion {
|
|
|
172
169
|
// As a temporary fix for b/441221870 we are prepending a newline for each prefix.
|
|
173
170
|
prefix = '\n' + prefix;
|
|
174
171
|
|
|
175
|
-
|
|
176
|
-
if (!additionalContextFiles) {
|
|
177
|
-
additionalContextFiles = this.#panel === ContextFlavor.CONSOLE ? [{
|
|
178
|
-
path: 'devtools-console-context.js',
|
|
179
|
-
content: consoleAdditionalContextFileContent,
|
|
180
|
-
included_reason: Host.AidaClient.Reason.RELATED_FILE,
|
|
181
|
-
}] :
|
|
182
|
-
undefined;
|
|
183
|
-
}
|
|
172
|
+
const additionalContextFiles = additionalFiles;
|
|
184
173
|
return {
|
|
185
174
|
client: Host.AidaClient.CLIENT_NAME,
|
|
186
175
|
prefix,
|
|
@@ -384,9 +373,3 @@ export class AiCodeCompletion {
|
|
|
384
373
|
return Boolean(aidaAvailability.enabled && AiCodeCompletion.isAiCodeCompletionStylesAvailable());
|
|
385
374
|
}
|
|
386
375
|
}
|
|
387
|
-
|
|
388
|
-
export const enum ContextFlavor {
|
|
389
|
-
CONSOLE = 'console', // generated code can contain console specific APIs like `$0`.
|
|
390
|
-
SOURCES = 'sources',
|
|
391
|
-
STYLES = 'styles',
|
|
392
|
-
}
|
|
@@ -158,9 +158,8 @@ export class AiCodeGeneration {
|
|
|
158
158
|
Host.userMetrics.actionTaken(Host.UserMetrics.Action.AiCodeGenerationSuggestionAccepted);
|
|
159
159
|
}
|
|
160
160
|
|
|
161
|
-
async generateCode(
|
|
162
|
-
|
|
163
|
-
options?: {signal?: AbortSignal}): Promise<Host.AidaClient.GenerateCodeResponse|null> {
|
|
161
|
+
async generateCode(prompt: string, preamble: string, inferenceLanguage?: Host.AidaClient.AidaInferenceLanguage,
|
|
162
|
+
options?: {signal?: AbortSignal}): Promise<Host.AidaClient.GenerateCodeResponse> {
|
|
164
163
|
const request = this.#buildRequest(prompt, preamble, inferenceLanguage);
|
|
165
164
|
const response = await this.#aidaClient.generateCode(request, options);
|
|
166
165
|
|
|
@@ -117,11 +117,6 @@ export const NativeFunctions = [
|
|
|
117
117
|
signatures: [["id"]],
|
|
118
118
|
receivers: ["Clients","BackgroundFetchManager"]
|
|
119
119
|
},
|
|
120
|
-
{
|
|
121
|
-
name: "get",
|
|
122
|
-
signatures: [["entry"]],
|
|
123
|
-
receivers: ["RouteMap"]
|
|
124
|
-
},
|
|
125
120
|
{
|
|
126
121
|
name: "set",
|
|
127
122
|
signatures: [["v"]],
|
|
@@ -2003,6 +1998,11 @@ export const NativeFunctions = [
|
|
|
2003
1998
|
signatures: [["start","end"]],
|
|
2004
1999
|
receivers: ["SourceBuffer"]
|
|
2005
2000
|
},
|
|
2001
|
+
{
|
|
2002
|
+
name: "remove",
|
|
2003
|
+
signatures: [["slot"]],
|
|
2004
|
+
receivers: ["GPUResourceTable"]
|
|
2005
|
+
},
|
|
2006
2006
|
{
|
|
2007
2007
|
name: "remove",
|
|
2008
2008
|
signatures: [["manifest_ids"]],
|
|
@@ -3302,6 +3302,11 @@ export const NativeFunctions = [
|
|
|
3302
3302
|
signatures: [["response"]],
|
|
3303
3303
|
receivers: ["MediaKeySession"]
|
|
3304
3304
|
},
|
|
3305
|
+
{
|
|
3306
|
+
name: "update",
|
|
3307
|
+
signatures: [["slot","resource"]],
|
|
3308
|
+
receivers: ["GPUResourceTable"]
|
|
3309
|
+
},
|
|
3305
3310
|
{
|
|
3306
3311
|
name: "createObjectStore",
|
|
3307
3312
|
signatures: [["name","?options"]]
|
|
@@ -6685,6 +6690,14 @@ export const NativeFunctions = [
|
|
|
6685
6690
|
name: "writeTimestamp",
|
|
6686
6691
|
signatures: [["querySet","queryIndex"]]
|
|
6687
6692
|
},
|
|
6693
|
+
{
|
|
6694
|
+
name: "setResourceTable",
|
|
6695
|
+
signatures: [["table"]]
|
|
6696
|
+
},
|
|
6697
|
+
{
|
|
6698
|
+
name: "createResourceTable",
|
|
6699
|
+
signatures: [["descriptor"]]
|
|
6700
|
+
},
|
|
6688
6701
|
{
|
|
6689
6702
|
name: "GPUInternalError",
|
|
6690
6703
|
signatures: [["message"]]
|
|
@@ -6713,6 +6726,10 @@ export const NativeFunctions = [
|
|
|
6713
6726
|
name: "multiDrawIndexedIndirect",
|
|
6714
6727
|
signatures: [["indirectBuffer","indirectOffset","maxDrawCount","?drawCountBuffer","?drawCountBufferOffset"]]
|
|
6715
6728
|
},
|
|
6729
|
+
{
|
|
6730
|
+
name: "insert",
|
|
6731
|
+
signatures: [["resource"]]
|
|
6732
|
+
},
|
|
6716
6733
|
{
|
|
6717
6734
|
name: "GPUUncapturedErrorEvent",
|
|
6718
6735
|
signatures: [["type","gpuUncapturedErrorEventInitDict"]]
|
|
@@ -8469,10 +8486,6 @@ export const NativeFunctions = [
|
|
|
8469
8486
|
name: "removeProcessingInstruction",
|
|
8470
8487
|
signatures: [["pi"]]
|
|
8471
8488
|
},
|
|
8472
|
-
{
|
|
8473
|
-
name: "RouteEvent",
|
|
8474
|
-
signatures: [["type"]]
|
|
8475
|
-
},
|
|
8476
8489
|
{
|
|
8477
8490
|
name: "ResizeObserver",
|
|
8478
8491
|
signatures: [["callback"]]
|
|
@@ -187,21 +187,21 @@ const enum Punctuation {
|
|
|
187
187
|
EQUALS = 'equals',
|
|
188
188
|
}
|
|
189
189
|
|
|
190
|
-
const resolveDebuggerScope =
|
|
191
|
-
scope: SDK.DebuggerModel.ScopeChainEntry,
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
190
|
+
const resolveDebuggerScope =
|
|
191
|
+
async(scope: SDK.DebuggerModel.ScopeChainEntry,
|
|
192
|
+
debuggerWorkspaceBinding: Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding):
|
|
193
|
+
Promise<{variableMapping: Map<string, string>, thisMapping: string | null}> => {
|
|
194
|
+
if (!scope.callFrame()
|
|
195
|
+
.debuggerModel.target()
|
|
196
|
+
.targetManager()
|
|
197
|
+
.settings.resolve(SDK.SDKSettings.jsSourceMapsEnabledSettingDescriptor)
|
|
198
|
+
.get()) {
|
|
199
|
+
return {variableMapping: new Map(), thisMapping: null};
|
|
200
|
+
}
|
|
201
|
+
const script = scope.callFrame().script;
|
|
202
|
+
const scopeChain = await findScopeChainForDebuggerScope(scope);
|
|
203
|
+
return await resolveScope(script, scopeChain, debuggerWorkspaceBinding);
|
|
204
|
+
};
|
|
205
205
|
|
|
206
206
|
const resolveScope = async(script: SDK.Script.Script, scopeChain: Formatter.FormatterWorkerPool.ScopeTreeNode[],
|
|
207
207
|
debuggerWorkspaceBinding: Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding):
|
|
@@ -400,7 +400,10 @@ export const allVariablesInCallFrame = async(
|
|
|
400
400
|
callFrame: SDK.DebuggerModel.CallFrame,
|
|
401
401
|
debuggerWorkspaceBinding: Bindings.DebuggerWorkspaceBinding.DebuggerWorkspaceBinding):
|
|
402
402
|
Promise<Map<string, string|null>> => {
|
|
403
|
-
if (!callFrame.debuggerModel.target()
|
|
403
|
+
if (!callFrame.debuggerModel.target()
|
|
404
|
+
.targetManager()
|
|
405
|
+
.settings.resolve(SDK.SDKSettings.jsSourceMapsEnabledSettingDescriptor)
|
|
406
|
+
.get()) {
|
|
404
407
|
return new Map<string, string|null>();
|
|
405
408
|
}
|
|
406
409
|
const cachedMap = cachedMapByCallFrame.get(callFrame);
|
|
@@ -443,7 +446,10 @@ export const allVariablesAtPosition =
|
|
|
443
446
|
if (!script) {
|
|
444
447
|
return reverseMapping;
|
|
445
448
|
}
|
|
446
|
-
if (!script.debuggerModel.target()
|
|
449
|
+
if (!script.debuggerModel.target()
|
|
450
|
+
.targetManager()
|
|
451
|
+
.settings.resolve(SDK.SDKSettings.jsSourceMapsEnabledSettingDescriptor)
|
|
452
|
+
.get()) {
|
|
447
453
|
return reverseMapping;
|
|
448
454
|
}
|
|
449
455
|
|
|
@@ -305,13 +305,23 @@ export function sanitizeThreads(processes: Map<Types.Events.ProcessID, RendererP
|
|
|
305
305
|
export function buildHierarchy(
|
|
306
306
|
processes: Map<Types.Events.ProcessID, RendererProcess>,
|
|
307
307
|
options?: {filter: {has: (name: Types.Events.Name) => boolean}}): void {
|
|
308
|
+
// Ensure threads that only contain V8 CPU profiler samples (such as WebAssembly
|
|
309
|
+
// background execution threads) are registered in their process before we iterate.
|
|
310
|
+
// These threads do not receive standard renderer trace events, so their RendererThread
|
|
311
|
+
// objects must be initialized here so SamplesIntegrator can inject profile calls.
|
|
308
312
|
const samplesData = samplesHandlerData();
|
|
313
|
+
for (const [pid, profilesByThread] of samplesData.profilesInProcess) {
|
|
314
|
+
const process = processes.get(pid);
|
|
315
|
+
if (!process) {
|
|
316
|
+
continue;
|
|
317
|
+
}
|
|
318
|
+
for (const [tid] of profilesByThread) {
|
|
319
|
+
getOrCreateRendererThread(process, tid);
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
|
|
309
323
|
for (const [pid, process] of processes) {
|
|
310
324
|
for (const [tid, thread] of process.threads) {
|
|
311
|
-
if (!thread.entries.length) {
|
|
312
|
-
thread.tree = Helpers.TreeHelpers.makeEmptyTraceEntryTree();
|
|
313
|
-
continue;
|
|
314
|
-
}
|
|
315
325
|
// Step 1. Massage the data.
|
|
316
326
|
Helpers.Trace.sortTraceEventsInPlace(thread.entries);
|
|
317
327
|
// Step 2. Inject profile calls from samples
|
|
@@ -333,6 +343,12 @@ export function buildHierarchy(
|
|
|
333
343
|
}
|
|
334
344
|
}
|
|
335
345
|
}
|
|
346
|
+
|
|
347
|
+
if (!thread.entries.length) {
|
|
348
|
+
thread.tree = Helpers.TreeHelpers.makeEmptyTraceEntryTree();
|
|
349
|
+
continue;
|
|
350
|
+
}
|
|
351
|
+
|
|
336
352
|
// Step 3. Build the tree.
|
|
337
353
|
const treeData = Helpers.TreeHelpers.treify(thread.entries, options);
|
|
338
354
|
thread.tree = treeData.tree;
|
|
@@ -47,7 +47,6 @@ export class UISourceCode extends Common.ObjectWrapper.ObjectWrapper<EventTypes>
|
|
|
47
47
|
#contentEncoded: boolean|undefined;
|
|
48
48
|
#isKnownThirdParty = false;
|
|
49
49
|
#isUnconditionallyIgnoreListed = false;
|
|
50
|
-
#containsAiChanges = false;
|
|
51
50
|
|
|
52
51
|
constructor(project: Project, url: Platform.DevToolsPath.UrlString, contentType: Common.ResourceType.ResourceType) {
|
|
53
52
|
super();
|
|
@@ -343,7 +342,6 @@ export class UISourceCode extends Common.ObjectWrapper.ObjectWrapper<EventTypes>
|
|
|
343
342
|
#resetWorkingCopy(): void {
|
|
344
343
|
this.#workingCopy = null;
|
|
345
344
|
this.#workingCopyGetter = null;
|
|
346
|
-
this.setContainsAiChanges(false);
|
|
347
345
|
}
|
|
348
346
|
|
|
349
347
|
setWorkingCopy(newWorkingCopy: string): void {
|
|
@@ -352,14 +350,6 @@ export class UISourceCode extends Common.ObjectWrapper.ObjectWrapper<EventTypes>
|
|
|
352
350
|
this.#workingCopyChanged();
|
|
353
351
|
}
|
|
354
352
|
|
|
355
|
-
setContainsAiChanges(containsAiChanges: boolean): void {
|
|
356
|
-
this.#containsAiChanges = containsAiChanges;
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
containsAiChanges(): boolean {
|
|
360
|
-
return this.#containsAiChanges;
|
|
361
|
-
}
|
|
362
|
-
|
|
363
353
|
setContent(content: string, isBase64: boolean): void {
|
|
364
354
|
this.#contentEncoded = isBase64;
|
|
365
355
|
if (this.#project.canSetFileContent()) {
|