chrome-devtools-frontend 1.0.1736236 → 1.0.1738725
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/rules/ui-and-widgets/ui-css-scoping-and-flex-layout.md +1 -1
- package/.agents/skills/version-control/SKILL.md +63 -11
- package/docs/devtools-protocol.md +3 -1
- package/eslint.config.mjs +0 -6
- package/front_end/core/host/AidaClient.ts +14 -36
- package/front_end/core/host/AidaGcaTranslation.ts +8 -5
- package/front_end/core/root/Runtime.ts +0 -5
- package/front_end/design_system_tokens.css +1 -0
- package/front_end/entrypoints/main/GlobalAiButton.ts +2 -9
- package/front_end/entrypoints/main/MainImpl.ts +0 -4
- package/front_end/generated/SupportedCSSProperties.ts +8 -23
- package/front_end/models/ai-utils/AiUtils.ts +1 -5
- package/front_end/models/ai_assistance/agents/AiAgent.ts +2 -18
- package/front_end/models/ai_assistance/contexts/FileContext.ts +1 -2
- package/front_end/models/ai_assistance/tools/ListSources.ts +3 -1
- package/front_end/models/ai_code_generation/AiCodeGeneration.ts +0 -6
- package/front_end/models/javascript_metadata/NativeFunctions.ts +9 -5
- package/front_end/models/trace/EventsSerializer.ts +0 -8
- package/front_end/models/workspace/UISourceCode.ts +30 -8
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +1 -7
- package/front_end/panels/ai_assistance/ai_assistance-meta.ts +15 -34
- package/front_end/panels/ai_assistance/components/ChatView.ts +2 -16
- package/front_end/panels/ai_assistance/components/chatView.css +0 -32
- package/front_end/panels/ai_assistance/components/walkthroughView.css +1 -1
- package/front_end/panels/animation/AnimationTimeline.ts +1 -1
- package/front_end/panels/animation/animationTimeline.css +5 -3
- package/front_end/panels/application/PrivateVerificationTokensView.ts +114 -26
- package/front_end/panels/application/ResourcesPanel.ts +1 -0
- package/front_end/panels/application/backgroundServiceView.css +2 -2
- package/front_end/panels/application/components/permissionsPolicySection.css +0 -4
- package/front_end/panels/application/frameDetailsReportView.css +0 -7
- package/front_end/panels/application/indexedDBViews.css +3 -3
- package/front_end/panels/application/privateVerificationTokensView.css +6 -0
- package/front_end/panels/application/serviceWorkerUpdateCycleView.css +1 -1
- package/front_end/panels/application/serviceWorkersView.css +2 -2
- package/front_end/panels/comments/CommentsPane.ts +1 -1
- package/front_end/panels/comments/commentsPane.css +1 -1
- package/front_end/panels/common/common.ts +0 -1
- package/front_end/panels/console/ConsoleView.ts +11 -1
- package/front_end/panels/console/ConsoleViewMessage.ts +5 -1
- package/front_end/panels/console/consolePinPane.css +1 -1
- package/front_end/panels/console/consoleView.css +5 -4
- package/front_end/panels/elements/DOMTreeWidget.ts +47 -5
- package/front_end/panels/elements/layoutPane.css +0 -1
- package/front_end/panels/emulation/InspectedPagePlaceholder.ts +1 -0
- package/front_end/panels/emulation/deviceModeView.css +0 -1
- package/front_end/panels/issues/issuesTree.css +2 -2
- package/front_end/panels/layer_viewer/LayerDetailsView.ts +34 -17
- package/front_end/panels/layer_viewer/LayerTreeOutline.ts +39 -17
- package/front_end/panels/layer_viewer/Layers3DView.ts +34 -13
- package/front_end/panels/layer_viewer/layerDetailsView.css +1 -1
- package/front_end/panels/layer_viewer/layers3DView.css +0 -4
- package/front_end/panels/media/playerListView.css +0 -18
- package/front_end/panels/media/playerPropertiesView.css +1 -1
- package/front_end/panels/network/NetworkWaterfallColumn.ts +22 -10
- package/front_end/panels/network/RequestPreviewView.ts +182 -63
- package/front_end/panels/network/SignedExchangeInfoView.ts +242 -158
- package/front_end/panels/network/networkConfigView.css +1 -1
- package/front_end/panels/network/networkLogView.css +2 -1
- package/front_end/panels/network/networkPanel.css +0 -5
- package/front_end/panels/network/networkTimingTable.css +1 -1
- package/front_end/panels/network/signedExchangeInfoView.css +12 -8
- package/front_end/panels/performance_monitor/performanceMonitor.css +2 -2
- package/front_end/panels/profiler/IsolateSelector.ts +31 -10
- package/front_end/panels/profiler/profilesPanel.css +0 -8
- package/front_end/panels/protocol_monitor/JSONEditor.css +1 -1
- package/front_end/panels/screencast/screencastView.css +2 -2
- package/front_end/panels/security/SecurityPanel.ts +474 -418
- package/front_end/panels/security/SecurityPanelSidebar.ts +68 -48
- package/front_end/panels/security/lockIcon.css +52 -50
- package/front_end/panels/security/mainView.css +149 -145
- package/front_end/panels/security/originView.css +117 -115
- package/front_end/panels/sensors/LocationsSettingsTab.ts +2 -50
- package/front_end/panels/sensors/locationsSettingsTab.css +1 -21
- package/front_end/panels/settings/AISettingsTab.ts +1 -2
- package/front_end/panels/settings/SettingsScreen.ts +1 -1
- package/front_end/panels/sources/CallStackSidebarPane.ts +31 -6
- package/front_end/panels/sources/NavigatorView.ts +105 -31
- package/front_end/panels/sources/breakpointsView.css +2 -1
- package/front_end/panels/sources/scopeChainSidebarPane.css +1 -1
- package/front_end/panels/timeline/ThirdPartyTreeView.ts +1 -0
- package/front_end/panels/timeline/TimelineLayersView.ts +108 -46
- package/front_end/panels/timeline/TimelinePanel.ts +4 -2
- package/front_end/panels/timeline/components/insights/BaseInsightComponent.ts +1 -1
- package/front_end/panels/timeline/components/networkRequestDetails.css +1 -1
- package/front_end/panels/timeline/overlays/components/EntryLabelOverlay.ts +0 -7
- package/front_end/panels/web_audio/webAudio.css +1 -2
- package/front_end/panels/webauthn/WebauthnPane.ts +1 -1
- package/front_end/panels/whats_new/ReleaseNoteText.ts +6 -6
- package/front_end/panels/whats_new/resources/WNDT.md +6 -6
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/ui/comments/CommentAnchorResolver.ts +45 -4
- package/front_end/ui/comments/CommentOverlayManager.ts +45 -12
- package/front_end/ui/components/buttons/FloatingButton.ts +2 -6
- package/front_end/ui/components/buttons/button.css +2 -2
- package/front_end/ui/components/buttons/floatingButton.css +0 -44
- package/front_end/ui/components/icon_button/iconButton.css +1 -1
- package/front_end/ui/components/markdown_view/markdownView.css +1 -1
- package/front_end/ui/legacy/ContextMenu.ts +7 -5
- package/front_end/ui/legacy/InspectorDrawerView.ts +1 -0
- package/front_end/ui/legacy/InspectorView.ts +5 -1
- package/front_end/ui/legacy/PopoverHelper.ts +1 -0
- package/front_end/ui/legacy/RootView.ts +9 -3
- package/front_end/ui/legacy/SplitWidget.ts +1 -0
- package/front_end/ui/legacy/Treeoutline.ts +9 -0
- package/front_end/ui/legacy/UIUtils.ts +1 -1
- package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +130 -137
- package/front_end/ui/legacy/components/inline_editor/CSSShadowEditor.ts +1 -1
- package/front_end/ui/legacy/components/inline_editor/SwatchPopoverHelper.ts +1 -0
- package/front_end/ui/legacy/components/inline_editor/bezierEditor.css +1 -1
- package/front_end/ui/legacy/components/inline_editor/cssAngleEditor.css +3 -1
- package/front_end/ui/legacy/components/inline_editor/cssShadowEditor.css +7 -6
- package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +2 -0
- package/front_end/ui/legacy/components/perf_ui/pieChart.css +2 -2
- package/front_end/ui/legacy/components/quick_open/filteredListWidget.css +1 -10
- package/front_end/ui/legacy/filter.css +1 -1
- package/front_end/ui/legacy/infobar.css +1 -1
- package/front_end/ui/legacy/inspectorCommon.css +2 -2
- package/front_end/ui/legacy/inspectorDrawerTabbedPane.css +3 -3
- package/front_end/ui/legacy/listWidget.css +2 -7
- package/front_end/ui/legacy/softDropDownButton.css +1 -1
- package/front_end/ui/legacy/tabbedPane.css +2 -1
- package/front_end/ui/legacy/treeoutline.css +3 -2
- package/front_end/ui/visual_logging/KnownContextValues.ts +133 -0
- package/front_end/ui/visual_logging/LoggingEvents.ts +1 -1
- package/package.json +1 -1
- package/front_end/Images/geminiInDevTools.png +0 -0
- package/front_end/Images/geminiInDevTools_2x.png +0 -0
- package/front_end/generated/InspectorBackendCommands.ts +0 -1690
- package/front_end/generated/protocol-mapping.d.ts +0 -5986
- package/front_end/generated/protocol-proxy-api.d.ts +0 -5452
- package/front_end/generated/protocol.ts +0 -23364
- package/front_end/panels/common/GeminiRebrandPromoDialog.ts +0 -193
- package/front_end/panels/common/geminiRebrandPromoDialog.css +0 -47
|
@@ -5,7 +5,7 @@ severity: nit
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
**Rule.** Scope light-DOM stylesheets and align elements using flexbox or grid rather than competing margin and position offsets
|
|
8
|
-
- **Look for**: Unscoped generic selectors in light-DOM `.css` files (or `:host` inside `@scope` blocks instead of `:scope`), redundant `@scope to (devtools-widget > *)` wrappers on shadow-DOM (`useShadowDom: 'pure'` or `useShadowDom: true`) widgets that have no child `<devtools-widget>` elements,
|
|
8
|
+
- **Look for**: Unscoped generic selectors in light-DOM `.css` files (or `:host` inside `@scope` blocks instead of `:scope`), redundant `@scope to (devtools-widget > *)` wrappers on shadow-DOM (`useShadowDom: 'pure'` or `useShadowDom: true`) widgets that have no child `<devtools-widget>` elements, CSS rules combining `vertical-align`, negative `margin-top`, and pixel offsets to center icons and buttons, or `this.registerRequiredCSS(...)` or `widget.registerRequiredCSS(...)` calls in widgets migrated to Lit view functions instead of rendering `<style>${styles}</style>` inside the view template.
|
|
9
9
|
- **Do not flag**: Shadow DOM component stylesheets where `:host` scoping is native. `<style>${styles}</style>` interpolations of `*.css.js` default imports in Lit templates (generated `.css.js` files export plain CSS strings, not `CSSStyleSheet` objects, and `<style>${...}</style>` is the standard replacement for deprecated `registerRequiredCSS`).
|
|
10
10
|
|
|
11
11
|
**Why.** Unscoped class or tag selectors in light-DOM widget stylesheets leak across the DevTools document, while combining `vertical-align`, negative margins, and `position: relative` offsets creates brittle layouts that break under font scaling or zoom.
|
|
@@ -61,22 +61,71 @@ git rebase-update && gclient sync -Df
|
|
|
61
61
|
* **Clean up old branches first:** Before running `git rebase-update`, archive landed/closed branches (`git cl archive -f`) or mark dormant (`git config branch.<branch>.dormant true`) any obsolete branches so they do not trigger unnecessary rebase conflicts.
|
|
62
62
|
* **Always sync dependencies after rebase:** Always run `gclient sync -Df` after a `git rebase-update`. CIPD dependency updates do not show up in `git status`, so skipping `gclient sync -Df` risks leaving your checkout out of sync.
|
|
63
63
|
|
|
64
|
-
###
|
|
65
|
-
|
|
64
|
+
### Uploading & Requesting Review
|
|
65
|
+
Always run `ChromiumCodeReviewAgent` on a Work-in-Progress (WIP) CL and resolve any `ERROR` or `WARNING` findings **before** marking the CL Ready for Review or adding human reviewers.
|
|
66
|
+
|
|
67
|
+
#### Step 1 — Upload as WIP and trigger AI review
|
|
68
|
+
Upload without `--send-mail` (`-s`) (and without `-c` / `--use-commit-queue`, which implies `--send-mail`) so the CL stays in Work-in-Progress, and trigger a CQ dry run (`--cq-dry-run` / `-d`) before adding human reviewers to the attention set:
|
|
69
|
+
```bash
|
|
70
|
+
git cl upload -f --cq-dry-run --commit-description="<description>"
|
|
71
|
+
```
|
|
72
|
+
Or, if the WIP patchset is already uploaded, vote `Commit-Queue+1` via `/google/bin/releases/gemini-agents-gerrit/gerrit`:
|
|
66
73
|
```bash
|
|
67
|
-
|
|
74
|
+
/google/bin/releases/gemini-agents-gerrit/gerrit vote Commit-Queue 1 \
|
|
75
|
+
--change=<CL_NUMBER> \
|
|
76
|
+
--host=https://chromium-review.googlesource.com
|
|
68
77
|
```
|
|
69
78
|
* Always include `-f` (`--force`) so that `git cl upload` runs non-interactively without opening a text editor or prompting.
|
|
70
|
-
* Use the same writing style as the current committer
|
|
71
|
-
* Keep line length below 72
|
|
72
|
-
* Add a
|
|
73
|
-
* Amend formatter/linter changes and fix linter issues.
|
|
74
|
-
* For a brand new stack of CLs, perform the initial upload on each branch individually in parent-to-child order so each CL receives its own commit description.
|
|
79
|
+
* Use the same writing style as the current committer.
|
|
80
|
+
* Keep line length below 72.
|
|
81
|
+
* Add a `Bug: <issue number>` (or `Fixed: <issue number>` / `Bug: None`) trailer on a separate line.
|
|
82
|
+
* Amend formatter/linter changes and fix linter issues before uploading.
|
|
83
|
+
* For a brand new stack of CLs, perform the initial WIP upload on each branch individually in parent-to-child order so each CL receives its own commit description.
|
|
84
|
+
|
|
85
|
+
#### Step 2 — Poll for `ChromiumCodeReviewAgent` findings
|
|
86
|
+
Poll every ~60 seconds (up to ~5 minutes) until the `ChromiumCodeReviewAgent` run completes:
|
|
87
|
+
1. Check whether the `ChromiumCodeReviewAgent` run has reached `"status": "COMPLETED"`:
|
|
88
|
+
```bash
|
|
89
|
+
gerrit_client.py checks \
|
|
90
|
+
--host https://chromium-review.googlesource.com \
|
|
91
|
+
--change <CL_NUMBER> \
|
|
92
|
+
--revision <PS> \
|
|
93
|
+
--json_file <TMP_CHECKS_JSON>
|
|
94
|
+
```
|
|
95
|
+
2. Fetch the findings with `/google/bin/releases/gemini-agents-gerrit/gerrit findings` (include `--all` because `ChromiumCodeReviewAgent` marks `WARNING` findings `actionable: false`, which `gerrit findings` omits by default; if the internal binary is unavailable, read `results` on the `ChromiumCodeReviewAgent` entry in `<TMP_CHECKS_JSON>`):
|
|
96
|
+
```bash
|
|
97
|
+
/google/bin/releases/gemini-agents-gerrit/gerrit findings \
|
|
98
|
+
--change=<CL_NUMBER> \
|
|
99
|
+
--patchset=<PS> \
|
|
100
|
+
--all \
|
|
101
|
+
--json \
|
|
102
|
+
--host=https://chromium-review.googlesource.com
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
#### Step 3 — Address findings before starting human review
|
|
106
|
+
Inspect all `ChromiumCodeReviewAgent` findings with `ERROR` or `WARNING` severity (consulting `.agents/skills/code-review/SKILL.md`, including its Shared False-Positive Guards):
|
|
107
|
+
* **Real issue:** Fix the issue locally, re-verify (`devtools-verification`), `git commit --amend`, upload a new WIP patchset with `--cq-dry-run` (`git cl upload -f --cq-dry-run -t "<one sentence patch set description>"`), and repeat Step 2 on the new patchset.
|
|
108
|
+
* **Confirmed false positive:** While the CL is still in WIP (before adding human reviewers), reply on the CL explaining why the finding does not apply (citing `ref: f/...` if present):
|
|
109
|
+
```bash
|
|
110
|
+
/google/bin/releases/gemini-agents-gerrit/gerrit messages post \
|
|
111
|
+
--change=<CL_NUMBER> \
|
|
112
|
+
--message="<explanation citing ref: f/...>" \
|
|
113
|
+
--host=https://chromium-review.googlesource.com
|
|
114
|
+
```
|
|
115
|
+
* **Start human review:** Once `ChromiumCodeReviewAgent` completes with all `ERROR` and `WARNING` findings addressed, mark the CL Ready for Review and add human reviewers:
|
|
116
|
+
```bash
|
|
117
|
+
/google/bin/releases/gemini-agents-gerrit/gerrit reviewers add \
|
|
118
|
+
--change=<CL_NUMBER> \
|
|
119
|
+
--ready \
|
|
120
|
+
--reviewer=<reviewer1@chromium.org>,<reviewer2@chromium.org> \
|
|
121
|
+
--host=https://chromium-review.googlesource.com
|
|
122
|
+
```
|
|
123
|
+
(Or run `git cl upload -f --send-mail -r <reviewer1@chromium.org> -r <reviewer2@chromium.org>`.)
|
|
75
124
|
|
|
76
125
|
### Subsequent upload & Updating Stacks
|
|
77
126
|
To upload an updated CL:
|
|
78
127
|
```bash
|
|
79
|
-
git cl upload -f -
|
|
128
|
+
git cl upload -f --cq-dry-run -t "<one sentence patch set description>"
|
|
80
129
|
```
|
|
81
130
|
* **Updating an existing stack of CLs:** Once all CLs in a stack have been initially created, **only run `git cl upload` from the leaf (latest) branch in the chain** for subsequent updates. Uploading from the leaf branch automatically runs presubmit checks and uploads new patchsets for all parent CLs in the stack simultaneously. Never upload intermediate CLs one by one when updating a stack.
|
|
82
131
|
|
|
@@ -93,8 +142,10 @@ To check whether a DevTools commit (`devtools/devtools-frontend`) has rolled int
|
|
|
93
142
|
| Create new CL from main | `git new-branch <name>` |
|
|
94
143
|
| Create stacked CL | `git new-branch --upstream_current <name>` |
|
|
95
144
|
| Update current CL | `git commit --amend` |
|
|
96
|
-
| Initial CL upload | `git cl upload -f -
|
|
97
|
-
|
|
|
145
|
+
| Initial WIP CL upload + CQ dry run | `git cl upload -f --cq-dry-run --commit-description="<description>"` |
|
|
146
|
+
| Poll `ChromiumCodeReviewAgent` findings | `/google/bin/releases/gemini-agents-gerrit/gerrit findings --change=<CL> --patchset=<PS> --all --json --host=https://chromium-review.googlesource.com` |
|
|
147
|
+
| Mark Ready for Review & add reviewers | `/google/bin/releases/gemini-agents-gerrit/gerrit reviewers add --change=<CL> --ready --reviewer=<emails> --host=https://chromium-review.googlesource.com` |
|
|
148
|
+
| Subsequent CL upload (or update stack from leaf) | `git cl upload -f --cq-dry-run -t "<message>"` |
|
|
98
149
|
| Reparent branch to root (`origin/main`) | `git reparent-branch --root` |
|
|
99
150
|
| Change branch parent | `git reparent-branch <new-parent>` |
|
|
100
151
|
| Archive landed/closed branches | `git cl archive -f` |
|
|
@@ -103,6 +154,7 @@ To check whether a DevTools commit (`devtools/devtools-frontend`) has rolled int
|
|
|
103
154
|
| Check release & roll status | Query `https://chromiumdash.appspot.com/fetch_commit?commit=<sha>` |
|
|
104
155
|
|
|
105
156
|
## Common Mistakes
|
|
157
|
+
- **Starting human review before resolving `ChromiumCodeReviewAgent` findings:** Never pass `--send-mail` (`-s`) or `-c` (`--use-commit-queue`) on the initial upload, or add human reviewers to the attention set before AI review finishes. Upload in WIP with `--cq-dry-run`, wait for `ChromiumCodeReviewAgent` to complete, and address all `ERROR` and `WARNING` findings first.
|
|
106
158
|
- **Multiple commits on one branch:** Gerrit expects one commit per CL. Always `commit --amend`.
|
|
107
159
|
- **Using `git checkout -b`:** Does not set up tracking information correctly for `depot_tools`. Use `git new-branch`.
|
|
108
160
|
- **Manual rebasing of stacked branches:** Never use manual `git rebase` loops. Always use `git rebase-update` or `git reparent-branch` to let `depot_tools` handle tracking updates.
|
|
@@ -33,7 +33,9 @@ handlers spanning several layers and processes, e.g. have instances in
|
|
|
33
33
|
### browser_protocol.pdl
|
|
34
34
|
|
|
35
35
|
The `browser_protocol.pdl` file is the source of truth that is used to generate
|
|
36
|
-
the
|
|
36
|
+
the `.ts`, `.h` and `.cc` files. DevTools generates its TypeScript types from
|
|
37
|
+
it at build time (see `front_end/generated/BUILD.gn`); they end up under
|
|
38
|
+
`out/Default/gen/front_end/generated/`.
|
|
37
39
|
|
|
38
40
|
However, there are multiple `browser_protocol.pdl` files across the codebase.
|
|
39
41
|
The main one is located at (in your chromium repo):
|
package/eslint.config.mjs
CHANGED
|
@@ -28,11 +28,6 @@ export default defineConfig([
|
|
|
28
28
|
|
|
29
29
|
'front_end/diff/diff_match_patch.js',
|
|
30
30
|
'front_end/models/javascript_metadata/NativeFunctions.ts',
|
|
31
|
-
// All of these scripts are auto-generated so don't lint them.
|
|
32
|
-
'front_end/generated/InspectorBackendCommands.ts',
|
|
33
|
-
'front_end/generated/protocol-mapping.d.ts',
|
|
34
|
-
'front_end/generated/protocol-proxy-api.d.ts',
|
|
35
|
-
'front_end/generated/protocol.ts',
|
|
36
31
|
// Any third_party addition has its source code checked out into
|
|
37
32
|
// third_party/X/package, so we ignore that code as it's not code we author or
|
|
38
33
|
// own.
|
|
@@ -1020,7 +1015,6 @@ export default defineConfig([
|
|
|
1020
1015
|
'front_end/panels/screencast/InputModel.ts',
|
|
1021
1016
|
'front_end/panels/screencast/ScreencastView.ts',
|
|
1022
1017
|
'front_end/panels/security/SecurityModel.ts',
|
|
1023
|
-
'front_end/panels/security/SecurityPanel.ts',
|
|
1024
1018
|
'front_end/panels/sensors/LocationsSettingsTab.ts',
|
|
1025
1019
|
'front_end/panels/sensors/SensorsView.ts',
|
|
1026
1020
|
'front_end/panels/settings/FrameworkIgnoreListSettingsTab.ts',
|
|
@@ -106,7 +106,7 @@ function conversationSurfaceHistogram(feature: ClientFeature): UserMetrics.AiCli
|
|
|
106
106
|
|
|
107
107
|
/**
|
|
108
108
|
* Returns a closure that records the request outcome histogram once per call.
|
|
109
|
-
* One-shot recording prevents
|
|
109
|
+
* One-shot recording prevents inner validation branches and outer catch blocks from double-counting outcomes.
|
|
110
110
|
*/
|
|
111
111
|
function createOutcomeRecorder(surfaceHistogram?: UserMetrics.AiClientSurfaceHistogram):
|
|
112
112
|
(result: UserMetrics.AiClientRequestResult) => void {
|
|
@@ -190,7 +190,8 @@ export class AidaClient {
|
|
|
190
190
|
throw new Error('dispatchHttpRequest is not available');
|
|
191
191
|
}
|
|
192
192
|
|
|
193
|
-
|
|
193
|
+
// Defaults to ABORTED so early caller exits (`break` / `return`) before `completed: true` record as aborted.
|
|
194
|
+
let outcome = UserMetrics.AiClientRequestResult.ABORTED;
|
|
194
195
|
let abortListener: (() => void)|undefined;
|
|
195
196
|
let streamId: number|undefined;
|
|
196
197
|
try {
|
|
@@ -198,13 +199,6 @@ export class AidaClient {
|
|
|
198
199
|
throw new AidaAbortError();
|
|
199
200
|
}
|
|
200
201
|
|
|
201
|
-
// Disable logging for now.
|
|
202
|
-
// For context, see b/454563259#comment35.
|
|
203
|
-
// We should be able to remove this ~end of April.
|
|
204
|
-
if (Root.Runtime.hostConfig.devToolsGeminiRebranding?.enabled) {
|
|
205
|
-
request.metadata.disable_user_content_logging = true;
|
|
206
|
-
}
|
|
207
|
-
|
|
208
202
|
const stream = (() => {
|
|
209
203
|
let {promise, resolve, reject} = Promise.withResolvers<string|null>();
|
|
210
204
|
// Prevent unhandled promise rejections if stream.fail() is called after
|
|
@@ -254,14 +248,17 @@ export class AidaClient {
|
|
|
254
248
|
debugLog('doConversation failed with error:', JSON.stringify(err));
|
|
255
249
|
stream.fail(mapError(err));
|
|
256
250
|
});
|
|
257
|
-
|
|
258
|
-
|
|
251
|
+
for await (const chunk of this.#handleResponseStream(stream)) {
|
|
252
|
+
if (chunk.completed) {
|
|
253
|
+
outcome = UserMetrics.AiClientRequestResult.SUCCESS;
|
|
254
|
+
}
|
|
255
|
+
yield chunk;
|
|
256
|
+
}
|
|
259
257
|
} catch (err) {
|
|
260
|
-
|
|
258
|
+
outcome = classifyRequestError(err);
|
|
261
259
|
throw err;
|
|
262
260
|
} finally {
|
|
263
|
-
|
|
264
|
-
recordOutcome(UserMetrics.AiClientRequestResult.ABORTED);
|
|
261
|
+
UserMetrics.userMetrics.aiClientRequestResult(outcome, conversationSurfaceHistogram(request.client_feature));
|
|
265
262
|
if (options?.signal && abortListener) {
|
|
266
263
|
options.signal.removeEventListener('abort', abortListener);
|
|
267
264
|
}
|
|
@@ -317,7 +314,9 @@ export class AidaClient {
|
|
|
317
314
|
});
|
|
318
315
|
} else if ('error' in result) {
|
|
319
316
|
throw mapError(result.error);
|
|
320
|
-
} else {
|
|
317
|
+
} else if (!result.metadata) {
|
|
318
|
+
// Chunks from thought-only parts or trailing metadata-only chunks lack text or function calls
|
|
319
|
+
// and carry only metadata.
|
|
321
320
|
throw new Error(`Unknown chunk result ${JSON.stringify(result)}`);
|
|
322
321
|
}
|
|
323
322
|
}
|
|
@@ -372,13 +371,6 @@ export class AidaClient {
|
|
|
372
371
|
}
|
|
373
372
|
|
|
374
373
|
registerClientEvent(clientEvent: AidaRegisterClientEvent): Promise<AidaClientResult> {
|
|
375
|
-
// Disable logging for now.
|
|
376
|
-
// For context, see b/454563259#comment35.
|
|
377
|
-
// We should be able to remove this ~end of April.
|
|
378
|
-
if (Root.Runtime.hostConfig.devToolsGeminiRebranding?.enabled) {
|
|
379
|
-
clientEvent.disable_user_content_logging = true;
|
|
380
|
-
}
|
|
381
|
-
|
|
382
374
|
if (this.#gcaClient.enabled()) {
|
|
383
375
|
return this.#gcaClient.registerClientEvent(clientEvent);
|
|
384
376
|
}
|
|
@@ -401,13 +393,6 @@ export class AidaClient {
|
|
|
401
393
|
throw new Error('aidaCodeComplete is not available');
|
|
402
394
|
}
|
|
403
395
|
|
|
404
|
-
// Disable logging for now.
|
|
405
|
-
// For context, see b/454563259#comment35.
|
|
406
|
-
// We should be able to remove this ~end of April.
|
|
407
|
-
if (Root.Runtime.hostConfig.devToolsGeminiRebranding?.enabled) {
|
|
408
|
-
request.metadata.disable_user_content_logging = true;
|
|
409
|
-
}
|
|
410
|
-
|
|
411
396
|
const recordOutcome = createOutcomeRecorder(EnumeratedHistogram.AiClientRequestResultCodeComplete);
|
|
412
397
|
try {
|
|
413
398
|
if (this.#gcaClient.enabled()) {
|
|
@@ -473,13 +458,6 @@ export class AidaClient {
|
|
|
473
458
|
}
|
|
474
459
|
|
|
475
460
|
async generateCode(request: GenerateCodeRequest, options?: {signal?: AbortSignal}): Promise<GenerateCodeResponse> {
|
|
476
|
-
// Disable logging for now.
|
|
477
|
-
// For context, see b/454563259#comment35.
|
|
478
|
-
// We should be able to remove this ~end of April.
|
|
479
|
-
if (Root.Runtime.hostConfig.devToolsGeminiRebranding?.enabled) {
|
|
480
|
-
request.metadata.disable_user_content_logging = true;
|
|
481
|
-
}
|
|
482
|
-
|
|
483
461
|
const surfaceHistogram = EnumeratedHistogram.AiClientRequestResultCodeGenerate;
|
|
484
462
|
try {
|
|
485
463
|
const response = this.#gcaClient.enabled() ?
|
|
@@ -130,7 +130,8 @@ function extractTextFromGcaParts(parts: GCA.Part[]|undefined): string {
|
|
|
130
130
|
if (!parts) {
|
|
131
131
|
return '';
|
|
132
132
|
}
|
|
133
|
-
|
|
133
|
+
// Exclude internal chain-of-thought parts from the visible explanation text.
|
|
134
|
+
return parts.map(p => (p.thought ? '' : p.text || '')).join('');
|
|
134
135
|
}
|
|
135
136
|
|
|
136
137
|
export function aidaEventToGcaTelemetryRequest(clientEvent: AIDA.AidaRegisterClientEvent): GCA.SendTelemetryRequest {
|
|
@@ -532,12 +533,14 @@ export function gcaChunkResponseToAidaChunkResponse(response: GCA.GenerateConten
|
|
|
532
533
|
})),
|
|
533
534
|
};
|
|
534
535
|
}
|
|
535
|
-
|
|
536
|
-
|
|
536
|
+
// Trailing chunks without parts still yield metadata so the client receives the final
|
|
537
|
+
// rpcGlobalId, modelVersion, usageMetadata, and citationMetadata.
|
|
538
|
+
const chunks: AIDA.AidaChunkResponse[] = parts.length === 0 ? [{metadata}] : parts.map(part => {
|
|
537
539
|
const aidaChunkResponse: AIDA.AidaChunkResponse = {metadata};
|
|
538
|
-
|
|
540
|
+
// Exclude empty text parts and internal model chain-of-thought from rendering in the UI.
|
|
541
|
+
if (part.text && !part.thought) {
|
|
539
542
|
aidaChunkResponse.textChunk = {
|
|
540
|
-
text:
|
|
543
|
+
text: part.text,
|
|
541
544
|
};
|
|
542
545
|
}
|
|
543
546
|
if (part.functionCall) {
|
|
@@ -389,10 +389,6 @@ export interface HostConfigGreenDevUi {
|
|
|
389
389
|
enabled: boolean;
|
|
390
390
|
}
|
|
391
391
|
|
|
392
|
-
export interface HostConfigGeminiRebranding {
|
|
393
|
-
enabled: boolean;
|
|
394
|
-
}
|
|
395
|
-
|
|
396
392
|
export interface HostConfigVeLogging {
|
|
397
393
|
enabled: boolean;
|
|
398
394
|
testing: boolean;
|
|
@@ -578,7 +574,6 @@ export type HostConfig = Platform.TypeScriptUtilities.RecursivePartial<{
|
|
|
578
574
|
devToolsEnableDurableMessages: DevToolsEnableDurableMessages,
|
|
579
575
|
devToolsAiAssistanceContextSelectionAgent: HostConfigAiAssistanceContextSelectionAgent,
|
|
580
576
|
devToolsConsoleInsightsTeasers: ConsoleInsightsTeasers,
|
|
581
|
-
devToolsGeminiRebranding: HostConfigGeminiRebranding,
|
|
582
577
|
devToolsProtocolMonitor: DevToolsProtocolMonitor,
|
|
583
578
|
devToolsAdsPanel: DevToolsAdsPanel,
|
|
584
579
|
devToolsUseGcaApi: UseGcaApi,
|
|
@@ -737,6 +737,7 @@
|
|
|
737
737
|
--sys-typescale-body1-line-height: 24px;
|
|
738
738
|
--sys-typescale-body2-line-height: 20px;
|
|
739
739
|
--sys-typescale-body3-line-height: 20px;
|
|
740
|
+
--sys-typescale-body3-5-line-height: 18px;
|
|
740
741
|
--sys-typescale-body4-line-height: 16px;
|
|
741
742
|
--sys-typescale-body5-line-height: 16px;
|
|
742
743
|
--sys-typescale-label-line-height: 9px;
|
|
@@ -23,10 +23,6 @@ const UIStrings = {
|
|
|
23
23
|
* @description Tooltip for the AI assistance button in the main DevTools toolbar.
|
|
24
24
|
*/
|
|
25
25
|
openAiAssistance: 'Open AI assistance panel',
|
|
26
|
-
/**
|
|
27
|
-
* @description Tooltip for the Gemini button in the main DevTools toolbar.
|
|
28
|
-
*/
|
|
29
|
-
openGemini: 'Open `Gemini` panel',
|
|
30
26
|
} as const;
|
|
31
27
|
const str_ = i18n.i18n.registerUIStrings('entrypoints/main/GlobalAiButton.ts', UIStrings);
|
|
32
28
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
@@ -60,18 +56,15 @@ export const DEFAULT_VIEW = (input: ViewInput, output: undefined, target: HTMLEl
|
|
|
60
56
|
expanded: inPromotionState,
|
|
61
57
|
});
|
|
62
58
|
|
|
63
|
-
const strings = AIAssistance.AiUtils.isGeminiBranding() ?
|
|
64
|
-
{title: i18nString(UIStrings.openGemini), label: i18n.i18n.lockedString('Gemini')} :
|
|
65
|
-
{title: i18nString(UIStrings.openAiAssistance), label: i18nString(UIStrings.aiAssistance)};
|
|
66
59
|
const icon = AIAssistance.AiUtils.getIconName();
|
|
67
60
|
|
|
68
61
|
// clang-format off
|
|
69
62
|
render(html`
|
|
70
63
|
<style>${globalAiButtonStyles}</style>
|
|
71
64
|
<div class="global-ai-button-container">
|
|
72
|
-
<button class=${classes} @click=${input.onClick} title=${
|
|
65
|
+
<button class=${classes} @click=${input.onClick} title=${i18nString(UIStrings.openAiAssistance)} jslog=${VisualLogging.action().track({click: true}).context('global-ai-button')}>
|
|
73
66
|
<devtools-icon name=${icon}></devtools-icon>
|
|
74
|
-
<span class="button-text">${` ${
|
|
67
|
+
<span class="button-text">${` ${i18nString(UIStrings.aiAssistance)}`}</span>
|
|
75
68
|
</button>
|
|
76
69
|
</div>
|
|
77
70
|
`, target);
|
|
@@ -498,10 +498,6 @@ export class MainImpl {
|
|
|
498
498
|
});
|
|
499
499
|
}
|
|
500
500
|
|
|
501
|
-
if (Root.Runtime.hostConfig.devToolsGeminiRebranding?.enabled) {
|
|
502
|
-
await PanelCommon.GeminiRebrandPromoDialog.maybeShow();
|
|
503
|
-
}
|
|
504
|
-
|
|
505
501
|
MainImpl.timeEnd('Main._createAppUI');
|
|
506
502
|
|
|
507
503
|
const appProvider = UI.AppProvider.getRegisteredAppProviders()[0];
|
|
@@ -4681,9 +4681,6 @@ export const generatedProperties: CSSProperty[] = [
|
|
|
4681
4681
|
"grid-rows",
|
|
4682
4682
|
"grid-columns",
|
|
4683
4683
|
"grid-order",
|
|
4684
|
-
"grid-lanes-flow",
|
|
4685
|
-
"grid-lanes-track",
|
|
4686
|
-
"grid-lanes-order",
|
|
4687
4684
|
"source-order"
|
|
4688
4685
|
],
|
|
4689
4686
|
"name": "reading-flow"
|
|
@@ -4865,9 +4862,7 @@ export const generatedProperties: CSSProperty[] = [
|
|
|
4865
4862
|
"none",
|
|
4866
4863
|
"spaces"
|
|
4867
4864
|
],
|
|
4868
|
-
"name": "ruby-overhang"
|
|
4869
|
-
"runtime_flag": "CSSRubyOverhang",
|
|
4870
|
-
"runtime_flag_status": "stable"
|
|
4865
|
+
"name": "ruby-overhang"
|
|
4871
4866
|
},
|
|
4872
4867
|
{
|
|
4873
4868
|
"inherited": true,
|
|
@@ -5163,8 +5158,7 @@ export const generatedProperties: CSSProperty[] = [
|
|
|
5163
5158
|
{
|
|
5164
5159
|
"keywords": [
|
|
5165
5160
|
"normal",
|
|
5166
|
-
"always"
|
|
5167
|
-
"before"
|
|
5161
|
+
"always"
|
|
5168
5162
|
],
|
|
5169
5163
|
"name": "scroll-snap-stop"
|
|
5170
5164
|
},
|
|
@@ -5411,8 +5405,7 @@ export const generatedProperties: CSSProperty[] = [
|
|
|
5411
5405
|
"-webkit-right",
|
|
5412
5406
|
"-webkit-center",
|
|
5413
5407
|
"start",
|
|
5414
|
-
"end"
|
|
5415
|
-
"match-parent"
|
|
5408
|
+
"end"
|
|
5416
5409
|
],
|
|
5417
5410
|
"name": "text-align"
|
|
5418
5411
|
},
|
|
@@ -5434,8 +5427,7 @@ export const generatedProperties: CSSProperty[] = [
|
|
|
5434
5427
|
"left",
|
|
5435
5428
|
"right",
|
|
5436
5429
|
"center",
|
|
5437
|
-
"justify"
|
|
5438
|
-
"match-parent"
|
|
5430
|
+
"justify"
|
|
5439
5431
|
],
|
|
5440
5432
|
"name": "text-align-last"
|
|
5441
5433
|
},
|
|
@@ -5530,8 +5522,7 @@ export const generatedProperties: CSSProperty[] = [
|
|
|
5530
5522
|
"inherited": true,
|
|
5531
5523
|
"keywords": [
|
|
5532
5524
|
"none",
|
|
5533
|
-
"auto"
|
|
5534
|
-
"all"
|
|
5525
|
+
"auto"
|
|
5535
5526
|
],
|
|
5536
5527
|
"name": "text-decoration-skip-ink"
|
|
5537
5528
|
},
|
|
@@ -5965,8 +5956,7 @@ export const generatedProperties: CSSProperty[] = [
|
|
|
5965
5956
|
"auto",
|
|
5966
5957
|
"none",
|
|
5967
5958
|
"text",
|
|
5968
|
-
"all"
|
|
5969
|
-
"contain"
|
|
5959
|
+
"all"
|
|
5970
5960
|
],
|
|
5971
5961
|
"name": "user-select"
|
|
5972
5962
|
},
|
|
@@ -8454,9 +8444,6 @@ export const generatedPropertyValues: Record<string, CSSPropertyValue> = {
|
|
|
8454
8444
|
"grid-rows",
|
|
8455
8445
|
"grid-columns",
|
|
8456
8446
|
"grid-order",
|
|
8457
|
-
"grid-lanes-flow",
|
|
8458
|
-
"grid-lanes-track",
|
|
8459
|
-
"grid-lanes-order",
|
|
8460
8447
|
"source-order"
|
|
8461
8448
|
]
|
|
8462
8449
|
},
|
|
@@ -8664,8 +8651,7 @@ export const generatedPropertyValues: Record<string, CSSPropertyValue> = {
|
|
|
8664
8651
|
"scroll-snap-stop": {
|
|
8665
8652
|
"values": [
|
|
8666
8653
|
"normal",
|
|
8667
|
-
"always"
|
|
8668
|
-
"before"
|
|
8654
|
+
"always"
|
|
8669
8655
|
]
|
|
8670
8656
|
},
|
|
8671
8657
|
"scroll-snap-type": {
|
|
@@ -8860,8 +8846,7 @@ export const generatedPropertyValues: Record<string, CSSPropertyValue> = {
|
|
|
8860
8846
|
"text-decoration-skip-ink": {
|
|
8861
8847
|
"values": [
|
|
8862
8848
|
"none",
|
|
8863
|
-
"auto"
|
|
8864
|
-
"all"
|
|
8849
|
+
"auto"
|
|
8865
8850
|
]
|
|
8866
8851
|
},
|
|
8867
8852
|
"text-decoration-skip-spaces": {
|
|
@@ -127,10 +127,6 @@ export const aiAssistanceV2OptInChangeDialogSeenSettingDescriptor: Common.Settin
|
|
|
127
127
|
defaultValue: false,
|
|
128
128
|
};
|
|
129
129
|
|
|
130
|
-
export function isGeminiBranding(): boolean {
|
|
131
|
-
return !!Root.Runtime.hostConfig.devToolsGeminiRebranding?.enabled;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
130
|
export function isNaturalLanguageInterfaceEnabled(): boolean {
|
|
135
131
|
return Boolean(Root.Runtime.hostConfig.devToolsAiNaturalLanguageInterface?.enabled);
|
|
136
132
|
}
|
|
@@ -199,7 +195,7 @@ export function getDisabledReasons(aidaAvailability: Host.AidaClient.AidaAccessP
|
|
|
199
195
|
}
|
|
200
196
|
|
|
201
197
|
export function getIconName(): string {
|
|
202
|
-
return
|
|
198
|
+
return 'smart-assistant';
|
|
203
199
|
}
|
|
204
200
|
|
|
205
201
|
export interface OneShotPromptRequest {
|
|
@@ -807,14 +807,7 @@ export abstract class AiAgent<T> {
|
|
|
807
807
|
|
|
808
808
|
constructor(opts: AgentOptions) {
|
|
809
809
|
this.#aidaClient = opts.aidaClient;
|
|
810
|
-
|
|
811
|
-
// Disable logging for now.
|
|
812
|
-
// For context, see b/454563259#comment35.
|
|
813
|
-
// We should be able to remove this ~end of April.
|
|
814
|
-
if (Root.Runtime.hostConfig.devToolsGeminiRebranding?.enabled) {
|
|
815
|
-
serverSideLoggingAllowed = false;
|
|
816
|
-
}
|
|
817
|
-
this.#serverSideLoggingActive = serverSideLoggingAllowed;
|
|
810
|
+
this.#serverSideLoggingActive = opts.serverSideLoggingAllowed ?? false;
|
|
818
811
|
this.#sessionId = opts.sessionId ?? crypto.randomUUID();
|
|
819
812
|
this.confirmSideEffect = opts.confirmSideEffectForTest ?? (() => Promise.withResolvers());
|
|
820
813
|
this.#history = opts.history ?? [];
|
|
@@ -1602,20 +1595,11 @@ export abstract class AiAgent<T> {
|
|
|
1602
1595
|
|
|
1603
1596
|
const requestTimestamp = Math.floor(Date.now() * 1000);
|
|
1604
1597
|
for await (aidaResponse of this.#aidaClient.doConversation(request, options)) {
|
|
1605
|
-
if (aidaResponse.functionCalls?.length) {
|
|
1606
|
-
yield {
|
|
1607
|
-
rpcId,
|
|
1608
|
-
functionCalls: aidaResponse.functionCalls,
|
|
1609
|
-
completed: true,
|
|
1610
|
-
text: aidaResponse.explanation,
|
|
1611
|
-
};
|
|
1612
|
-
break;
|
|
1613
|
-
}
|
|
1614
|
-
|
|
1615
1598
|
rpcId = aidaResponse.metadata.rpcGlobalId ?? rpcId;
|
|
1616
1599
|
yield {
|
|
1617
1600
|
rpcId,
|
|
1618
1601
|
text: aidaResponse.explanation,
|
|
1602
|
+
functionCalls: aidaResponse.functionCalls,
|
|
1619
1603
|
completed: aidaResponse.completed,
|
|
1620
1604
|
};
|
|
1621
1605
|
}
|
|
@@ -21,8 +21,7 @@ export class FileContext extends ConversationContext<Workspace.UISourceCode.UISo
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
|
-
* Returns the security origin of the
|
|
25
|
-
* back to the origin derived from the file URL.
|
|
24
|
+
* Returns the security origin of the workspace file.
|
|
26
25
|
*/
|
|
27
26
|
override getOrigin(): SDK.SecurityOrigin.SecurityOrigin {
|
|
28
27
|
return this.#file.securityOrigin();
|
|
@@ -73,7 +73,9 @@ export class ListSourcesTool implements
|
|
|
73
73
|
if (uiSourceCode.isIgnoreListed()) {
|
|
74
74
|
continue;
|
|
75
75
|
}
|
|
76
|
-
|
|
76
|
+
// A source map on an allowed page can still point to cross-origin URLs,
|
|
77
|
+
// so a file's origin may differ from its project's origin.
|
|
78
|
+
if (!isOriginAllowedByLock(originLock, uiSourceCode.securityOrigin())) {
|
|
77
79
|
continue;
|
|
78
80
|
}
|
|
79
81
|
|
|
@@ -59,12 +59,6 @@ export class AiCodeGeneration {
|
|
|
59
59
|
constructor(opts: Options) {
|
|
60
60
|
this.#aidaClient = opts.aidaClient;
|
|
61
61
|
this.#serverSideLoggingEnabled = opts.serverSideLoggingEnabled ?? false;
|
|
62
|
-
// Disable logging for now.
|
|
63
|
-
// For context, see b/454563259#comment35.
|
|
64
|
-
// We should be able to remove this ~end of April.
|
|
65
|
-
if (Root.Runtime.hostConfig.devToolsGeminiRebranding?.enabled) {
|
|
66
|
-
this.#serverSideLoggingEnabled = false;
|
|
67
|
-
}
|
|
68
62
|
}
|
|
69
63
|
|
|
70
64
|
#buildRequest(
|
|
@@ -227,7 +227,7 @@ export const NativeFunctions: readonly NativeFunctionValue[] = [
|
|
|
227
227
|
{
|
|
228
228
|
name: "create",
|
|
229
229
|
signatures: [["?options"]],
|
|
230
|
-
receivers: ["CredentialsContainer","DecisionModel"
|
|
230
|
+
receivers: ["CredentialsContainer","DecisionModel"]
|
|
231
231
|
},
|
|
232
232
|
{
|
|
233
233
|
name: "defineProperty",
|
|
@@ -8317,10 +8317,6 @@ export const NativeFunctions: readonly NativeFunctionValue[] = [
|
|
|
8317
8317
|
name: "LanguageModelToolError",
|
|
8318
8318
|
signatures: [["init"]]
|
|
8319
8319
|
},
|
|
8320
|
-
{
|
|
8321
|
-
name: "embed",
|
|
8322
|
-
signatures: [["input","?options"]]
|
|
8323
|
-
},
|
|
8324
8320
|
{
|
|
8325
8321
|
name: "setPrivateToken",
|
|
8326
8322
|
signatures: [["privateToken"]]
|
|
@@ -8501,6 +8497,10 @@ export const NativeFunctions: readonly NativeFunctionValue[] = [
|
|
|
8501
8497
|
name: "resumeTool",
|
|
8502
8498
|
signatures: [["token","callback"]]
|
|
8503
8499
|
},
|
|
8500
|
+
{
|
|
8501
|
+
name: "waitForToolsUntil",
|
|
8502
|
+
signatures: [["promise"]]
|
|
8503
|
+
},
|
|
8504
8504
|
{
|
|
8505
8505
|
name: "TaskController",
|
|
8506
8506
|
signatures: [["?init"]]
|
|
@@ -8521,6 +8521,10 @@ export const NativeFunctions: readonly NativeFunctionValue[] = [
|
|
|
8521
8521
|
name: "removeProcessingInstruction",
|
|
8522
8522
|
signatures: [["pi"]]
|
|
8523
8523
|
},
|
|
8524
|
+
{
|
|
8525
|
+
name: "setJavascriptURLs",
|
|
8526
|
+
signatures: [["allow"]]
|
|
8527
|
+
},
|
|
8524
8528
|
{
|
|
8525
8529
|
name: "ResizeObserver",
|
|
8526
8530
|
signatures: [["callback"]]
|
|
@@ -7,8 +7,6 @@ import type {ParsedTrace} from './ModelImpl.js';
|
|
|
7
7
|
import * as Types from './types/types.js';
|
|
8
8
|
|
|
9
9
|
export class EventsSerializer {
|
|
10
|
-
#modifiedProfileCallByKey = new Map<Types.File.ProfileCallKeyValues, Types.Events.SyntheticProfileCall>();
|
|
11
|
-
|
|
12
10
|
keyForEvent(event: Types.Events.Event): Types.File.SerializableKey|null {
|
|
13
11
|
if (Types.Events.isProfileCall(event)) {
|
|
14
12
|
return `${Types.File.EventKeyType.PROFILE_CALL}-${event.pid}-${event.tid}-${
|
|
@@ -116,10 +114,6 @@ export class EventsSerializer {
|
|
|
116
114
|
|
|
117
115
|
#getModifiedProfileCallByKeyValues(key: Types.File.ProfileCallKeyValues,
|
|
118
116
|
parsedTrace: ParsedTrace): Types.Events.SyntheticProfileCall {
|
|
119
|
-
const cacheResult = this.#modifiedProfileCallByKey.get(key);
|
|
120
|
-
if (cacheResult) {
|
|
121
|
-
return cacheResult;
|
|
122
|
-
}
|
|
123
117
|
const profileCallsInThread =
|
|
124
118
|
parsedTrace.data.Renderer.processes.get(key.processID)?.threads.get(key.threadID)?.profileCalls;
|
|
125
119
|
if (!profileCallsInThread) {
|
|
@@ -132,8 +126,6 @@ export class EventsSerializer {
|
|
|
132
126
|
if (!match) {
|
|
133
127
|
throw new Error(`Unknown profile call serializable key: ${(JSON.stringify(key))}`);
|
|
134
128
|
}
|
|
135
|
-
// Cache to avoid looking up in subsequent calls.
|
|
136
|
-
this.#modifiedProfileCallByKey.set(key, match);
|
|
137
129
|
return match;
|
|
138
130
|
}
|
|
139
131
|
}
|