chrome-devtools-frontend 1.0.1660788 → 1.0.1662289

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.
Files changed (177) hide show
  1. package/.agents/skills/evaluate-ai-css-completion/SKILL.md +143 -0
  2. package/.agents/skills/evaluate-ai-css-completion/scripts/evaluate.js +104 -0
  3. package/.agents/skills/migrate-chromium-test/SKILL.md +7 -2
  4. package/.agents/skills/ui-eng-vision-local-lit-renderer/SKILL.md +7 -1
  5. package/docs/ui_engineering.md +75 -42
  6. package/eslint.config.mjs +7 -0
  7. package/extension-api/ExtensionAPI.d.ts +88 -0
  8. package/front_end/core/common/SettingRegistration.ts +0 -5
  9. package/front_end/core/host/InspectorFrontendHost.ts +1 -0
  10. package/front_end/core/host/InspectorFrontendHostStub.ts +2 -0
  11. package/front_end/core/platform/ArrayUtilities.ts +10 -0
  12. package/front_end/core/platform/StringUtilities.ts +20 -4
  13. package/front_end/core/sdk/CPUThrottlingManager.ts +2 -0
  14. package/front_end/core/sdk/DOMDebuggerModel.ts +2 -0
  15. package/front_end/core/sdk/DOMModel.ts +1 -0
  16. package/front_end/core/sdk/DebuggerModel.ts +4 -4
  17. package/front_end/core/sdk/EventBreakpointsModel.ts +2 -0
  18. package/front_end/core/sdk/FrameManager.ts +1 -0
  19. package/front_end/core/sdk/IsolateManager.ts +1 -0
  20. package/front_end/core/sdk/NetworkManager.ts +2 -0
  21. package/front_end/core/sdk/NetworkRequest.ts +1 -0
  22. package/front_end/core/sdk/PageResourceLoader.ts +2 -0
  23. package/front_end/core/sdk/SourceMap.ts +5 -5
  24. package/front_end/core/sdk/SourceMapManager.ts +3 -2
  25. package/front_end/core/sdk/TargetManager.ts +4 -0
  26. package/front_end/entrypoints/main/MainImpl.ts +2 -1
  27. package/front_end/foundation/README.md +86 -0
  28. package/front_end/generated/InspectorBackendCommands.ts +4 -5
  29. package/front_end/generated/protocol.ts +20 -38
  30. package/front_end/models/bindings/CompilerScriptMapping.ts +5 -5
  31. package/front_end/models/bindings/ContentProviderBasedProject.ts +2 -3
  32. package/front_end/models/bindings/DebuggerLanguagePlugins.ts +3 -3
  33. package/front_end/models/bindings/DefaultScriptMapping.ts +3 -3
  34. package/front_end/models/bindings/ResourceMapping.ts +3 -3
  35. package/front_end/models/bindings/ResourceScriptMapping.ts +2 -2
  36. package/front_end/models/bindings/SASSSourceMapping.ts +3 -3
  37. package/front_end/models/bindings/TempFile.ts +8 -3
  38. package/front_end/models/extensions/ExtensionAPI.ts +110 -46
  39. package/front_end/models/extensions/RecorderExtensionEndpoint.ts +7 -5
  40. package/front_end/models/formatter/ScriptFormatter.ts +8 -11
  41. package/front_end/models/heap_snapshot/HeapSnapshotProxy.ts +14 -5
  42. package/front_end/models/issues_manager/CheckFormsIssuesTrigger.ts +8 -9
  43. package/front_end/models/issues_manager/CookieIssue.ts +21 -9
  44. package/front_end/models/issues_manager/Issue.ts +3 -4
  45. package/front_end/models/issues_manager/IssueAggregator.ts +0 -9
  46. package/front_end/models/issues_manager/IssueResolver.ts +2 -2
  47. package/front_end/models/issues_manager/IssuesManager.ts +136 -137
  48. package/front_end/models/issues_manager/RelatedIssue.ts +10 -8
  49. package/front_end/models/issues_manager/issues_manager.ts +0 -2
  50. package/front_end/models/javascript_metadata/NativeFunctions.js +1 -1
  51. package/front_end/models/logs/RequestResolver.ts +2 -2
  52. package/front_end/models/source_map_scopes/FunctionCodeResolver.ts +12 -9
  53. package/front_end/models/trace/handlers/FramesHandler.ts +4 -7
  54. package/front_end/models/trace/handlers/ModelHandlers.ts +0 -1
  55. package/front_end/models/trace/handlers/RendererHandler.ts +2 -15
  56. package/front_end/models/trace/handlers/Threads.ts +4 -11
  57. package/front_end/models/trace/insights/DOMSize.ts +1 -1
  58. package/front_end/models/workspace_diff/WorkspaceDiff.ts +10 -4
  59. package/front_end/panels/ai_assistance/components/ChatMessage.ts +2 -1
  60. package/front_end/panels/application/ApplicationPanelSidebar.ts +0 -44
  61. package/front_end/panels/application/CookieItemsView.ts +1 -1
  62. package/front_end/panels/application/ServiceWorkersView.ts +494 -411
  63. package/front_end/panels/application/WebMCPView.ts +38 -43
  64. package/front_end/panels/application/application.ts +0 -6
  65. package/front_end/panels/application/components/AdsView.ts +201 -30
  66. package/front_end/panels/application/components/adsView.css +25 -0
  67. package/front_end/panels/application/components/components.ts +0 -2
  68. package/front_end/panels/application/preloading/components/PreloadingDetailsReportView.ts +1 -1
  69. package/front_end/panels/application/preloading/components/RuleSetDetailsView.ts +2 -2
  70. package/front_end/panels/application/serviceWorkersView.css +40 -4
  71. package/front_end/panels/browser_debugger/XHRBreakpointsSidebarPane.ts +147 -123
  72. package/front_end/panels/common/ExtensionServer.ts +3 -3
  73. package/front_end/panels/console/ConsoleView.ts +3 -2
  74. package/front_end/panels/console/PromptBuilder.ts +2 -1
  75. package/front_end/panels/emulation/DeviceModeView.ts +164 -113
  76. package/front_end/panels/issues/AffectedResourcesView.ts +1 -1
  77. package/front_end/panels/issues/IssueView.ts +0 -2
  78. package/front_end/panels/issues/IssuesPane.ts +1 -8
  79. package/front_end/panels/js_timeline/js_timeline-meta.ts +3 -2
  80. package/front_end/panels/lighthouse/LighthouseProtocolService.ts +53 -12
  81. package/front_end/panels/linear_memory_inspector/LinearMemoryInspectorController.ts +3 -3
  82. package/front_end/panels/linear_memory_inspector/LinearMemoryInspectorPane.ts +5 -5
  83. package/front_end/panels/linear_memory_inspector/components/LinearMemoryHighlightChipList.ts +4 -4
  84. package/front_end/panels/linear_memory_inspector/components/LinearMemoryInspector.ts +2 -2
  85. package/front_end/panels/linear_memory_inspector/components/LinearMemoryNavigator.ts +6 -6
  86. package/front_end/panels/linear_memory_inspector/components/LinearMemoryValueInterpreter.ts +3 -3
  87. package/front_end/panels/linear_memory_inspector/components/ValueInterpreterDisplay.ts +8 -9
  88. package/front_end/panels/linear_memory_inspector/components/ValueInterpreterDisplayUtils.ts +2 -2
  89. package/front_end/panels/linear_memory_inspector/components/ValueInterpreterSettings.ts +1 -1
  90. package/front_end/panels/linear_memory_inspector/linear_memory_inspector-meta.ts +2 -2
  91. package/front_end/panels/network/RequestPayloadView.ts +92 -52
  92. package/front_end/panels/network/RequestTimingView.ts +95 -127
  93. package/front_end/panels/network/components/ResponseHeaderSection.ts +5 -3
  94. package/front_end/panels/profiler/HeapSnapshotView.ts +3 -3
  95. package/front_end/panels/profiler/WritableProfileHeader.ts +2 -2
  96. package/front_end/panels/recorder/{components/ControlButton.ts → ControlButton.ts} +9 -10
  97. package/front_end/panels/recorder/{components/CreateRecordingView.ts → CreateRecordingView.ts} +48 -47
  98. package/front_end/panels/recorder/{components/ExtensionView.ts → ExtensionView.ts} +8 -8
  99. package/front_end/panels/recorder/RecorderController.ts +302 -127
  100. package/front_end/panels/recorder/RecorderPanel.ts +1 -1
  101. package/front_end/panels/recorder/{components/RecordingListView.ts → RecordingListView.ts} +19 -20
  102. package/front_end/panels/recorder/{components/RecordingView.ts → RecordingView.ts} +88 -88
  103. package/front_end/panels/recorder/{components/ReplaySection.ts → ReplaySection.ts} +11 -11
  104. package/front_end/panels/recorder/{components/SelectorPicker.ts → SelectorPicker.ts} +13 -13
  105. package/front_end/panels/recorder/{components/StepEditor.ts → StepEditor.ts} +15 -15
  106. package/front_end/panels/recorder/{components/StepView.ts → StepView.ts} +10 -10
  107. package/front_end/panels/recorder/{components/TimelineSection.ts → TimelineSection.ts} +2 -2
  108. package/front_end/panels/recorder/recorder.ts +23 -1
  109. package/front_end/panels/recorder/util/util.ts +113 -0
  110. package/front_end/panels/sources/SourcesView.ts +0 -17
  111. package/front_end/panels/sources/TabbedEditorContainer.ts +1 -1
  112. package/front_end/panels/sources/UISourceCodeFrame.ts +42 -0
  113. package/front_end/panels/sources/sources.ts +0 -2
  114. package/front_end/panels/timeline/CompatibilityTracksAppender.ts +0 -17
  115. package/front_end/panels/timeline/IsolateSelector.ts +10 -8
  116. package/front_end/panels/timeline/ThreadAppender.ts +0 -106
  117. package/front_end/panels/timeline/TimelinePanel.ts +18 -7
  118. package/front_end/panels/timeline/TimelineUIUtils.ts +144 -129
  119. package/front_end/panels/timeline/timeline-meta.ts +3 -2
  120. package/front_end/third_party/chromium/README.chromium +1 -1
  121. package/front_end/ui/components/report_view/ReportView.ts +11 -5
  122. package/front_end/ui/components/report_view/report.css +4 -1
  123. package/front_end/ui/legacy/TextPrompt.ts +49 -1
  124. package/front_end/ui/legacy/Treeoutline.ts +3 -0
  125. package/front_end/ui/legacy/UIUtils.ts +11 -1
  126. package/front_end/ui/legacy/Widget.ts +14 -15
  127. package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +2 -2
  128. package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +11 -7
  129. package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +2 -1
  130. package/front_end/ui/legacy/components/utils/JSPresentationUtils.ts +10 -1
  131. package/front_end/ui/legacy/textPrompt.css +10 -0
  132. package/front_end/ui/visual_logging/KnownContextValues.ts +1 -0
  133. package/package.json +1 -1
  134. package/front_end/models/issues_manager/AttributionReportingIssue.ts +0 -247
  135. package/front_end/models/issues_manager/descriptions/arInsecureContext.md +0 -7
  136. package/front_end/models/issues_manager/descriptions/arInvalidInfoHeader.md +0 -5
  137. package/front_end/models/issues_manager/descriptions/arInvalidRegisterOsSourceHeader.md +0 -5
  138. package/front_end/models/issues_manager/descriptions/arInvalidRegisterOsTriggerHeader.md +0 -5
  139. package/front_end/models/issues_manager/descriptions/arInvalidRegisterSourceHeader.md +0 -5
  140. package/front_end/models/issues_manager/descriptions/arInvalidRegisterTriggerHeader.md +0 -5
  141. package/front_end/models/issues_manager/descriptions/arNavigationRegistrationUniqueScopeAlreadySet.md +0 -5
  142. package/front_end/models/issues_manager/descriptions/arNavigationRegistrationWithoutTransientUserActivation.md +0 -6
  143. package/front_end/models/issues_manager/descriptions/arNoRegisterOsSourceHeader.md +0 -5
  144. package/front_end/models/issues_manager/descriptions/arNoRegisterOsTriggerHeader.md +0 -5
  145. package/front_end/models/issues_manager/descriptions/arNoRegisterSourceHeader.md +0 -5
  146. package/front_end/models/issues_manager/descriptions/arNoRegisterTriggerHeader.md +0 -5
  147. package/front_end/models/issues_manager/descriptions/arNoWebOrOsSupport.md +0 -4
  148. package/front_end/models/issues_manager/descriptions/arOsSourceIgnored.md +0 -18
  149. package/front_end/models/issues_manager/descriptions/arOsTriggerIgnored.md +0 -19
  150. package/front_end/models/issues_manager/descriptions/arPermissionPolicyDisabled.md +0 -8
  151. package/front_end/models/issues_manager/descriptions/arSourceAndTriggerHeaders.md +0 -9
  152. package/front_end/models/issues_manager/descriptions/arSourceIgnored.md +0 -13
  153. package/front_end/models/issues_manager/descriptions/arTriggerIgnored.md +0 -12
  154. package/front_end/models/issues_manager/descriptions/arUntrustworthyReportingOrigin.md +0 -10
  155. package/front_end/models/issues_manager/descriptions/arWebAndOsHeaders.md +0 -11
  156. package/front_end/models/trace/handlers/AuctionWorkletsHandler.ts +0 -183
  157. package/front_end/panels/application/InterestGroupStorageModel.ts +0 -81
  158. package/front_end/panels/application/InterestGroupStorageView.ts +0 -151
  159. package/front_end/panels/application/InterestGroupTreeElement.ts +0 -65
  160. package/front_end/panels/application/components/InterestGroupAccessGrid.ts +0 -135
  161. package/front_end/panels/application/components/interestGroupAccessGrid.css +0 -27
  162. package/front_end/panels/application/interestGroupStorageView.css +0 -9
  163. package/front_end/panels/issues/AttributionReportingIssueDetailsView.ts +0 -182
  164. package/front_end/panels/recorder/components/components.ts +0 -25
  165. package/front_end/panels/recorder/components/util.ts +0 -116
  166. package/front_end/panels/sources/InplaceFormatterEditorAction.ts +0 -149
  167. /package/front_end/panels/recorder/{components/controlButton.css → controlButton.css} +0 -0
  168. /package/front_end/panels/recorder/{components/createRecordingView.css → createRecordingView.css} +0 -0
  169. /package/front_end/panels/recorder/{components/extensionView.css → extensionView.css} +0 -0
  170. /package/front_end/panels/recorder/{components/recordingListView.css → recordingListView.css} +0 -0
  171. /package/front_end/panels/recorder/{components/recordingView.css → recordingView.css} +0 -0
  172. /package/front_end/panels/recorder/{components/replaySection.css → replaySection.css} +0 -0
  173. /package/front_end/panels/recorder/{components/selectorPicker.css → selectorPicker.css} +0 -0
  174. /package/front_end/panels/recorder/{components/startView.css → startView.css} +0 -0
  175. /package/front_end/panels/recorder/{components/stepEditor.css → stepEditor.css} +0 -0
  176. /package/front_end/panels/recorder/{components/stepView.css → stepView.css} +0 -0
  177. /package/front_end/panels/recorder/{components/timelineSection.css → timelineSection.css} +0 -0
@@ -1,5 +0,0 @@
1
- # Ensure that the `Attribution-Reporting-Info` header is valid
2
-
3
- This page tried to register a source or trigger using the Attribution Reporting
4
- API but failed because an `Attribution-Reporting-Info` response header was
5
- invalid.
@@ -1,5 +0,0 @@
1
- # Ensure that the `Attribution-Reporting-Register-OS-Source` header is valid
2
-
3
- This page tried to register an OS source using the Attribution Reporting API
4
- but failed because an `Attribution-Reporting-Register-OS-Source` response
5
- header was invalid.
@@ -1,5 +0,0 @@
1
- # Ensure that the `Attribution-Reporting-Register-OS-Trigger` header is valid
2
-
3
- This page tried to register an OS trigger using the Attribution Reporting API
4
- but failed because an `Attribution-Reporting-Register-OS-Trigger` response
5
- header was invalid.
@@ -1,5 +0,0 @@
1
- # Ensure that the `Attribution-Reporting-Register-Source` header is valid
2
-
3
- This page tried to register a source using the Attribution Reporting API but
4
- failed because an `Attribution-Reporting-Register-Source` response header was
5
- invalid.
@@ -1,5 +0,0 @@
1
- # Ensure that the `Attribution-Reporting-Register-Trigger` header is valid
2
-
3
- This page tried to register a trigger using the Attribution Reporting API but
4
- failed because an `Attribution-Reporting-Register-Trigger` response header was
5
- invalid.
@@ -1,5 +0,0 @@
1
- # Ensure that multiple sources associated with the same navigation have the same attribution scopes
2
-
3
- The page tried to register a source using Attribution Reporting API, but the
4
- source was rejected because a previous source associated with the same
5
- navigation and reporting origin used a different set of attribution scopes.
@@ -1,6 +0,0 @@
1
- # Ensure that navigation-source registrations are initiated by a user gesture
2
-
3
- This page tried to register a navigation source using the Attribution Reporting
4
- API but failed because the navigation was not initiated by a user gesture.
5
- Compared to event sources, navigation sources can release more cross-site
6
- information, and are therefore subject to this additional privacy control.
@@ -1,5 +0,0 @@
1
- # OS attribution source expected but corresponding header not found
2
-
3
- The page indicated, via the `Attribution-Reporting-Info` header, that it
4
- intended to register an OS source using the Attribution Reporting API, but the
5
- corresponding `Attribution-Reporting-Register-OS-Source` header was missing.
@@ -1,5 +0,0 @@
1
- # OS attribution trigger expected but corresponding header not found
2
-
3
- The page indicated, via the `Attribution-Reporting-Info` header, that it
4
- intended to register an OS trigger using the Attribution Reporting API, but the
5
- corresponding `Attribution-Reporting-Register-OS-Trigger` header was missing.
@@ -1,5 +0,0 @@
1
- # Web attribution source expected but corresponding header not found
2
-
3
- The page indicated, via the `Attribution-Reporting-Info` header, that it
4
- intended to register a web source using the Attribution Reporting API, but the
5
- corresponding `Attribution-Reporting-Register-Source` header was missing.
@@ -1,5 +0,0 @@
1
- # Web attribution trigger expected but corresponding header not found
2
-
3
- The page indicated, via the `Attribution-Reporting-Info` header, that it
4
- intended to register a web trigger using the Attribution Reporting API, but the
5
- corresponding `Attribution-Reporting-Register-Trigger` header was missing.
@@ -1,4 +0,0 @@
1
- # No web or OS support for Attribution Reporting
2
-
3
- The page tried to send an attributionsrc request, but there was neither web nor
4
- OS support for the Attribution Reporting API, so the request was skipped.
@@ -1,18 +0,0 @@
1
- # An attribution OS source registration was ignored because the request was ineligible
2
-
3
- This page tried to register an OS source using the Attribution Reporting API,
4
- but the request was ineligible to do so, so the OS source registration was
5
- ignored.
6
-
7
- A request is eligible for OS source registration if it has all of the following:
8
-
9
- - An `Attribution-Reporting-Eligible` header whose value is a structured
10
- dictionary that contains the key `navigation-source` or `event-source`
11
- - An `Attribution-Reporting-Support` header whose value is a structured
12
- dictionary that contains the key `os`
13
-
14
- Otherwise, any `Attribution-Reporting-Register-OS-Source` response header will
15
- be ignored.
16
-
17
- Additionally, a single HTTP redirect chain may register only all sources or all
18
- triggers, not a combination of both.
@@ -1,19 +0,0 @@
1
- # An attribution OS trigger registration was ignored because the request was ineligible
2
-
3
- This page tried to register an OS trigger using the Attribution Reporting API,
4
- but the request was ineligible to do so, so the OS trigger registration was
5
- ignored.
6
-
7
- A request is eligible for OS trigger registration if it has all of the following:
8
-
9
- - No `Attribution-Reporting-Eligible` header or an
10
- `Attribution-Reporting-Eligible` header whose value is a structured
11
- dictionary that contains the key `trigger`
12
- - An `Attribution-Reporting-Support` header whose value is a structured
13
- dictionary that contains the key `os`
14
-
15
- Otherwise, any `Attribution-Reporting-Register-OS-Trigger` response header will
16
- be ignored.
17
-
18
- Additionally, a single HTTP redirect chain may register only all sources or all
19
- triggers, not a combination of both.
@@ -1,8 +0,0 @@
1
- # The Attribution Reporting API can’t be used because Permissions Policy has been disabled
2
-
3
- This page tried to use the Attribution Reporting API but failed because the
4
- `attribution-reporting` Permission Policy was explicitly disabled.
5
-
6
- This API is currently enabled by default for top-level and cross-origin frames,
7
- but it is still possible for frames to have the permission disabled by their
8
- parent, e.g. with `<iframe src="…" allow="attribution-reporting 'none'">`.
@@ -1,9 +0,0 @@
1
- # Ensure that attribution responses contain either source or trigger, not both
2
-
3
- This page tried to register a source and a trigger in the same HTTP response
4
- using the Attribution Reporting API, which is prohibited.
5
-
6
- The corresponding request was eligible to register either a source or a
7
- trigger, but the response may only set either the
8
- `Attribution-Reporting-Register-Source` header or the
9
- `Attribution-Reporting-Register-Trigger` header, not both.
@@ -1,13 +0,0 @@
1
- # An attribution source registration was ignored because the request was ineligible
2
-
3
- This page tried to register a source using the Attribution Reporting API, but
4
- the request was ineligible to do so, so the source registration was ignored.
5
-
6
- A request is eligible for source registration if it has an
7
- `Attribution-Reporting-Eligible` header whose value is a structured dictionary
8
- that contains the key `navigation-source` or `event-source`. If the header is
9
- absent or does not contain one of those keys, any
10
- `Attribution-Reporting-Register-Source` response header will be ignored.
11
-
12
- Additionally, a single HTTP redirect chain may register only all sources or all
13
- triggers, not a combination of both.
@@ -1,12 +0,0 @@
1
- # An attribution trigger registration was ignored because the request was ineligible
2
-
3
- This page tried to register a trigger using the Attribution Reporting API, but
4
- the request was ineligible to do so, so the trigger registration was ignored.
5
-
6
- A request is eligible for trigger registration if it has an
7
- `Attribution-Reporting-Eligible` header whose value is a structured dictionary
8
- that contains the key `trigger`, or if the header is absent. Otherwise, any
9
- `Attribution-Reporting-Register-Trigger` response header will be ignored.
10
-
11
- Additionally, a single HTTP redirect chain may register only all sources or all
12
- triggers, not a combination of both.
@@ -1,10 +0,0 @@
1
- # Ensure that attribution reporting origins are trustworthy
2
-
3
- This page tried to register a source or trigger using the Attribution Reporting
4
- API but failed because the reporting origin was not potentially trustworthy.
5
-
6
- The reporting origin is typically the server that sets the
7
- `Attribution-Reporting-Register-Source` or
8
- `Attribution-Reporting-Register-Trigger` header.
9
-
10
- The reporting origin must use HTTPS unless it is `localhost` or `127.0.0.1`.
@@ -1,11 +0,0 @@
1
- # Ensure that attribution responses contain either web or OS headers, not both
2
-
3
- This page included web and OS Attribution Reporting API headers in the same
4
- HTTP response, which is prohibited.
5
-
6
- The response may set at most one of the following headers:
7
-
8
- - `Attribution-Reporting-Register-OS-Source`
9
- - `Attribution-Reporting-Register-OS-Trigger`
10
- - `Attribution-Reporting-Register-Source`
11
- - `Attribution-Reporting-Register-Trigger`
@@ -1,183 +0,0 @@
1
- // Copyright 2023 The Chromium Authors
2
- // Use of this source code is governed by a BSD-style license that can be
3
- // found in the LICENSE file.
4
-
5
- import * as Helpers from '../helpers/helpers.js';
6
- import * as Types from '../types/types.js';
7
-
8
- /**
9
- * There are two metadata events that we care about.
10
- * => AuctionWorkletRunningInProcess tells us which process the Auction Worklet
11
- * has taken to run in.
12
- * => AuctionWorkletDoneWithProcess tells us when the worklet is done with that
13
- * process. This is less useful - but in the future we might want to surface
14
- * this information so we still parse and return the event.
15
- *
16
- * It is important to note that the top level PID on these events is NOT the
17
- * PID that the worklet is running on; instead we have to look at its
18
- * args.data.pid property, which is the PID of the process that it is running
19
- * on.
20
- *
21
- * For any given RunningInProcess event, we would typically expect to see a
22
- * DoneWithProcess event, however this is not guaranteed, especially as users
23
- * can record any chunk of time in DevTools.
24
- *
25
- * Similarly, it is also possible to see a DoneWithProcess event without a
26
- * RunningInProcess event, if the user started recording after the auction
27
- * worklets started. Therefore we are happy to create
28
- * SyntheticAuctionWorklets as long as we see just one of these events.
29
- *
30
- * If we do get two events and need to pair them, we can use the
31
- * args.data.target property, which is a string ID shared by both
32
- * events.
33
- */
34
- let runningInProcessEvents = new Map<Types.Events.ProcessID, Types.Events.AuctionWorkletRunningInProcess>();
35
- let doneWithProcessEvents = new Map<Types.Events.ProcessID, Types.Events.AuctionWorkletDoneWithProcess>();
36
-
37
- // Keyed by the PID defined in `args.data.pid` on AuctionWorklet trace events..
38
- let createdSyntheticEvents = new Map<Types.Events.ProcessID, Types.Events.SyntheticAuctionWorklet>();
39
-
40
- // Each AuctonWorklet takes over a process and has 2 threads (that we care
41
- // about and want to show as tracks):
42
- // 1. A CrUtilityMain thread which is known as the "control process".
43
- // 2. A AuctionV8HelperThread which is the actual auction worklet and will be
44
- // either a "Seller" or a "Bidder"
45
- // To detect these we look for the metadata thread_name events. We key these by
46
- // PID so that we can easily look them up later without having to loop through.
47
- let utilityThreads = new Map<Types.Events.ProcessID, Types.Events.ThreadName>();
48
- let v8HelperThreads = new Map<Types.Events.ProcessID, Types.Events.ThreadName>();
49
-
50
- export function reset(): void {
51
- runningInProcessEvents = new Map();
52
- doneWithProcessEvents = new Map();
53
- createdSyntheticEvents = new Map();
54
- utilityThreads = new Map();
55
- v8HelperThreads = new Map();
56
- }
57
-
58
- export function handleEvent(event: Types.Events.Event): void {
59
- if (Types.Events.isAuctionWorkletRunningInProcess(event)) {
60
- runningInProcessEvents.set(event.args.data.pid, event);
61
- return;
62
- }
63
-
64
- if (Types.Events.isAuctionWorkletDoneWithProcess(event)) {
65
- doneWithProcessEvents.set(event.args.data.pid, event);
66
- return;
67
- }
68
-
69
- if (Types.Events.isThreadName(event)) {
70
- if (event.args.name === 'auction_worklet.CrUtilityMain') {
71
- utilityThreads.set(event.pid, event);
72
- return;
73
- }
74
- if (event.args.name === 'AuctionV8HelperThread') {
75
- v8HelperThreads.set(event.pid, event);
76
- }
77
- }
78
- }
79
-
80
- function workletType(input: string): Types.Events.AuctionWorkletType {
81
- switch (input) {
82
- case 'seller':
83
- return Types.Events.AuctionWorkletType.SELLER;
84
- case 'bidder':
85
- return Types.Events.AuctionWorkletType.BIDDER;
86
- default:
87
- return Types.Events.AuctionWorkletType.UNKNOWN;
88
- }
89
- }
90
-
91
- /**
92
- * We cannot make the full event without knowing the type of event, but we can
93
- * create everything other than the `args` field, as those are identical
94
- * regardless of the type of event.
95
- */
96
- function makeSyntheticEventBase(
97
- event: Types.Events.AuctionWorkletDoneWithProcess|
98
- Types.Events.AuctionWorkletRunningInProcess): Omit<Types.Events.SyntheticAuctionWorklet, 'args'> {
99
- return Helpers.SyntheticEvents.SyntheticEventsManager
100
- .registerSyntheticEvent<Omit<Types.Events.SyntheticAuctionWorklet, 'args'>>({
101
- rawSourceEvent: event,
102
- name: 'SyntheticAuctionWorklet',
103
- s: Types.Events.Scope.THREAD,
104
- cat: event.cat,
105
- tid: event.tid,
106
- ts: event.ts,
107
- ph: Types.Events.Phase.INSTANT,
108
- pid: event.args.data.pid,
109
- host: event.args.data.host,
110
- target: event.args.data.target,
111
- type: workletType(event.args.data.type),
112
- });
113
- }
114
-
115
- export async function finalize(): Promise<void> {
116
- // Loop through the utility threads we found to create the worklet events. We
117
- // expect each worklet to have a utility thread, so we can use them as the
118
- // root of our list of worklets.
119
- for (const [pid, utilityThreadNameEvent] of utilityThreads) {
120
- const v8HelperEvent = v8HelperThreads.get(pid);
121
- if (!v8HelperEvent) {
122
- // Bad trace data - AuctionWorklets are expected to always have both threads.
123
- continue;
124
- }
125
-
126
- const runningEvent = runningInProcessEvents.get(pid);
127
- const doneWithEvent = doneWithProcessEvents.get(pid);
128
-
129
- // We can create a worklet from either the runningEvent or doneWithEvent -
130
- // we do not need both. We cannot express that to TypeScript with an early
131
- // return here, so instead we set the event initially to null, and then
132
- // create it from either the running event or the doneWith event. If it is
133
- // still null after this, that means neither event was found, and we drop
134
- // the worklet as we do not have enough information to create the synthetic
135
- // event.
136
-
137
- let syntheticEvent: Types.Events.SyntheticAuctionWorklet|null = null;
138
-
139
- if (runningEvent) {
140
- syntheticEvent = {
141
- ...makeSyntheticEventBase(runningEvent),
142
- args: {
143
- data: {
144
- runningInProcessEvent: runningEvent,
145
- utilityThread: utilityThreadNameEvent,
146
- v8HelperThread: v8HelperEvent,
147
- },
148
- },
149
- };
150
- if (doneWithEvent) {
151
- syntheticEvent.args.data.doneWithProcessEvent = doneWithEvent;
152
- }
153
- } else if (doneWithEvent) {
154
- syntheticEvent = {
155
- ...makeSyntheticEventBase(doneWithEvent),
156
- args: {
157
- data: {
158
- doneWithProcessEvent: doneWithEvent,
159
- utilityThread: utilityThreadNameEvent,
160
- v8HelperThread: v8HelperEvent,
161
- },
162
- },
163
- };
164
- if (runningEvent) {
165
- syntheticEvent.args.data.runningInProcessEvent = runningEvent;
166
- }
167
- }
168
- if (syntheticEvent === null) {
169
- continue;
170
- }
171
- createdSyntheticEvents.set(pid, syntheticEvent);
172
- }
173
- }
174
-
175
- export interface AuctionWorkletsData {
176
- worklets: Map<Types.Events.ProcessID, Types.Events.SyntheticAuctionWorklet>;
177
- }
178
-
179
- export function data(): AuctionWorkletsData {
180
- return {
181
- worklets: createdSyntheticEvents,
182
- };
183
- }
@@ -1,81 +0,0 @@
1
- // Copyright 2021 The Chromium Authors
2
- // Use of this source code is governed by a BSD-style license that can be
3
- // found in the LICENSE file.
4
-
5
- import * as SDK from '../../core/sdk/sdk.js';
6
- import type * as ProtocolProxyApi from '../../generated/protocol-proxy-api.js';
7
- import type * as Protocol from '../../generated/protocol.js';
8
-
9
- export class InterestGroupStorageModel extends SDK.SDKModel.SDKModel<EventTypes> implements
10
- ProtocolProxyApi.StorageDispatcher {
11
- private readonly storageAgent: ProtocolProxyApi.StorageApi;
12
- private enabled?: boolean;
13
-
14
- constructor(target: SDK.Target.Target) {
15
- super(target);
16
- target.registerStorageDispatcher(this);
17
- this.storageAgent = target.storageAgent();
18
- this.enabled = false;
19
- }
20
-
21
- enable(): void {
22
- if (this.enabled) {
23
- return;
24
- }
25
- void this.storageAgent.invoke_setInterestGroupTracking({enable: true});
26
- }
27
-
28
- disable(): void {
29
- if (!this.enabled) {
30
- return;
31
- }
32
- void this.storageAgent.invoke_setInterestGroupTracking({enable: false});
33
- }
34
-
35
- interestGroupAccessed(event: Protocol.Storage.InterestGroupAccessedEvent): void {
36
- this.dispatchEventToListeners(Events.INTEREST_GROUP_ACCESS, event);
37
- }
38
-
39
- indexedDBListUpdated(_event: Protocol.Storage.IndexedDBListUpdatedEvent): void {
40
- }
41
-
42
- indexedDBContentUpdated(_event: Protocol.Storage.IndexedDBContentUpdatedEvent): void {
43
- }
44
-
45
- interestGroupAuctionEventOccurred(_event: Protocol.Storage.InterestGroupAuctionEventOccurredEvent): void {
46
- }
47
-
48
- interestGroupAuctionNetworkRequestCreated(_event: Protocol.Storage.InterestGroupAuctionNetworkRequestCreatedEvent):
49
- void {
50
- }
51
-
52
- cacheStorageListUpdated(_event: Protocol.Storage.CacheStorageListUpdatedEvent): void {
53
- }
54
-
55
- cacheStorageContentUpdated(_event: Protocol.Storage.CacheStorageContentUpdatedEvent): void {
56
- }
57
-
58
- sharedStorageAccessed(_event: Protocol.Storage.SharedStorageAccessedEvent): void {
59
- }
60
-
61
- sharedStorageWorkletOperationExecutionFinished(
62
- _event: Protocol.Storage.SharedStorageWorkletOperationExecutionFinishedEvent): void {
63
- }
64
-
65
- storageBucketCreatedOrUpdated(_event: Protocol.Storage.StorageBucketCreatedOrUpdatedEvent): void {
66
- }
67
-
68
- storageBucketDeleted(_event: Protocol.Storage.StorageBucketDeletedEvent): void {
69
- }
70
- }
71
-
72
- SDK.SDKModel.SDKModel.register(
73
- InterestGroupStorageModel, {capabilities: SDK.Target.Capability.STORAGE, autostart: false});
74
-
75
- export const enum Events {
76
- INTEREST_GROUP_ACCESS = 'InterestGroupAccess',
77
- }
78
-
79
- export interface EventTypes {
80
- [Events.INTEREST_GROUP_ACCESS]: Protocol.Storage.InterestGroupAccessedEvent;
81
- }
@@ -1,151 +0,0 @@
1
- // Copyright 2021 The Chromium Authors
2
- // Use of this source code is governed by a BSD-style license that can be
3
- // found in the LICENSE file.
4
- /* eslint-disable @devtools/no-imperative-dom-api */
5
-
6
- import * as i18n from '../../core/i18n/i18n.js';
7
- import * as Protocol from '../../generated/protocol.js';
8
- import * as SourceFrame from '../../ui/legacy/components/source_frame/source_frame.js';
9
- import * as UI from '../../ui/legacy/legacy.js';
10
- import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
11
-
12
- import * as ApplicationComponents from './components/components.js';
13
- import interestGroupStorageViewStyles from './interestGroupStorageView.css.js';
14
-
15
- const UIStrings = {
16
- /**
17
- * @description Placeholder text shown when nothing has been selected for display
18
- *details.
19
- * An interest group is an ad targeting group stored on the browser that can
20
- * be used to show a certain set of advertisements in the future as the
21
- * outcome of a FLEDGE auction.
22
- */
23
- noValueSelected: 'No interest group selected',
24
- /**
25
- * @description Placeholder text instructing the user how to display interest group
26
- *details.
27
- * An interest group is an ad targeting group stored on the browser that can
28
- * be used to show a certain set of advertisements in the future as the
29
- * outcome of a FLEDGE auction.
30
- */
31
- clickToDisplayBody: 'Select any interest group event to display the group\'s current state',
32
- /**
33
- * @description Placeholder text telling the user no details are available for
34
- *the selected interest group.
35
- */
36
- noDataAvailable: 'No details available',
37
- /**
38
- * @description Placeholder text explaining to the user a potential reason for not having details on
39
- * the interest groups.
40
- * An interest group is an ad targeting group stored on the browser that can
41
- * be used to show a certain set of advertisements in the future as the
42
- * outcome of a FLEDGE auction.
43
- */
44
- noDataDescription: 'The browser may have left the group.',
45
- } as const;
46
- const str_ = i18n.i18n.registerUIStrings('panels/application/InterestGroupStorageView.ts', UIStrings);
47
- const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
48
-
49
- interface InterestGroupDetailsGetter {
50
- getInterestGroupDetails: (owner: string, name: string) => Promise<object|null>;
51
- }
52
-
53
- function eventEquals(
54
- a: Protocol.Storage.InterestGroupAccessedEvent, b: Protocol.Storage.InterestGroupAccessedEvent): boolean {
55
- return (a.accessTime === b.accessTime && a.type === b.type && a.ownerOrigin === b.ownerOrigin && a.name === b.name);
56
- }
57
-
58
- export class InterestGroupStorageView extends UI.SplitWidget.SplitWidget {
59
- private readonly interestGroupGrid = new ApplicationComponents.InterestGroupAccessGrid.InterestGroupAccessGrid();
60
- private events: Protocol.Storage.InterestGroupAccessedEvent[] = [];
61
- private detailsGetter: InterestGroupDetailsGetter;
62
- private noDataView: UI.Widget.VBox;
63
- private noDisplayView: UI.Widget.VBox;
64
-
65
- constructor(detailsGetter: InterestGroupDetailsGetter) {
66
- super(/* isVertical */ false, /* secondIsSidebar: */ true);
67
- this.element.setAttribute('jslog', `${VisualLogging.pane('interest-groups')}`);
68
- this.detailsGetter = detailsGetter;
69
-
70
- const topPanel = new UI.Widget.VBox();
71
- this.noDisplayView =
72
- new UI.EmptyWidget.EmptyWidget(i18nString(UIStrings.noValueSelected), i18nString(UIStrings.clickToDisplayBody));
73
- this.noDataView =
74
- new UI.EmptyWidget.EmptyWidget(i18nString(UIStrings.noDataAvailable), i18nString(UIStrings.noDataDescription));
75
-
76
- topPanel.setMinimumSize(0, 120);
77
- this.setMainWidget(topPanel);
78
- this.noDisplayView.setMinimumSize(0, 80);
79
- this.setSidebarWidget(this.noDisplayView);
80
- this.noDataView.setMinimumSize(0, 80);
81
- this.noDisplayView.contentElement.setAttribute('jslog', `${VisualLogging.pane('details').track({resize: true})}`);
82
- this.noDataView.contentElement.setAttribute('jslog', `${VisualLogging.pane('details').track({resize: true})}`);
83
- this.hideSidebar();
84
-
85
- topPanel.contentElement.appendChild(this.interestGroupGrid);
86
- this.interestGroupGrid.addEventListener('select', this.onFocus.bind(this));
87
- }
88
-
89
- override wasShown(): void {
90
- super.wasShown();
91
- const mainWidget = this.mainWidget();
92
- if (mainWidget) {
93
- mainWidget.registerRequiredCSS(interestGroupStorageViewStyles);
94
- }
95
- }
96
-
97
- addEvent(event: Protocol.Storage.InterestGroupAccessedEvent): void {
98
- if (this.showMode() !== UI.SplitWidget.ShowMode.BOTH) {
99
- this.showBoth();
100
- }
101
- // Only add if not already present.
102
- const foundEvent = this.events.find(t => eventEquals(t, event));
103
- if (!foundEvent) {
104
- this.events.push(event);
105
- this.interestGroupGrid.data = this.events;
106
- }
107
- }
108
-
109
- clearEvents(): void {
110
- this.events = [];
111
- this.interestGroupGrid.data = this.events;
112
- this.setSidebarWidget(this.noDisplayView);
113
- this.sidebarUpdatedForTesting();
114
- }
115
-
116
- private async onFocus(event: Event): Promise<void> {
117
- const focusedEvent = event as CustomEvent<Protocol.Storage.InterestGroupAccessedEvent>;
118
- const {ownerOrigin, name, type: eventType} = focusedEvent.detail;
119
-
120
- let details = null;
121
- // Details of additional bids can't be looked up like regular bids,
122
- // they are ephemeral to the auction.
123
- if (eventType !== Protocol.Storage.InterestGroupAccessType.AdditionalBid &&
124
- eventType !== Protocol.Storage.InterestGroupAccessType.AdditionalBidWin &&
125
- eventType !== Protocol.Storage.InterestGroupAccessType.TopLevelAdditionalBid) {
126
- details = await this.detailsGetter.getInterestGroupDetails(ownerOrigin, name);
127
- }
128
- if (details) {
129
- const jsonView = await SourceFrame.JSONView.JSONView.createView(JSON.stringify(details));
130
- jsonView?.setMinimumSize(0, 40);
131
- if (jsonView) {
132
- jsonView.contentElement.setAttribute('jslog', `${VisualLogging.pane('details').track({resize: true})}`);
133
- this.setSidebarWidget(jsonView);
134
- }
135
- } else {
136
- this.setSidebarWidget(this.noDataView);
137
- }
138
- this.sidebarUpdatedForTesting();
139
- }
140
-
141
- getEventsForTesting(): Protocol.Storage.InterestGroupAccessedEvent[] {
142
- return this.events;
143
- }
144
-
145
- getInterestGroupGridForTesting(): ApplicationComponents.InterestGroupAccessGrid.InterestGroupAccessGrid {
146
- return this.interestGroupGrid;
147
- }
148
-
149
- sidebarUpdatedForTesting(): void {
150
- }
151
- }