chrome-devtools-frontend 1.0.1515796 → 1.0.1515988

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 (129) hide show
  1. package/docs/contributing/infrastructure.md +131 -82
  2. package/front_end/Tests.js +3 -29
  3. package/front_end/core/common/Progress.ts +73 -55
  4. package/front_end/core/host/UserMetrics.ts +0 -1
  5. package/front_end/core/protocol_client/InspectorBackend.ts +2 -0
  6. package/front_end/core/root/Runtime.ts +0 -1
  7. package/front_end/core/sdk/CSSMatchedStyles.ts +12 -10
  8. package/front_end/core/sdk/CSSModel.ts +1 -31
  9. package/front_end/core/sdk/CSSPropertyParserMatchers.ts +27 -7
  10. package/front_end/core/sdk/DebuggerModel.ts +1 -31
  11. package/front_end/core/sdk/EnhancedTracesParser.ts +81 -50
  12. package/front_end/core/sdk/NetworkManager.ts +1 -31
  13. package/front_end/core/sdk/NetworkRequest.ts +1 -31
  14. package/front_end/core/sdk/RehydratingConnection.snapshot.txt +1003 -0
  15. package/front_end/core/sdk/RehydratingConnection.ts +13 -18
  16. package/front_end/core/sdk/RehydratingObject.ts +8 -31
  17. package/front_end/core/sdk/RemoteObject.ts +1 -31
  18. package/front_end/core/sdk/ResourceTreeModel.ts +1 -31
  19. package/front_end/core/sdk/RuntimeModel.ts +1 -31
  20. package/front_end/core/sdk/ServiceWorkerManager.ts +1 -31
  21. package/front_end/core/sdk/SourceMap.ts +1 -31
  22. package/front_end/core/sdk/TraceObject.ts +8 -3
  23. package/front_end/entrypoints/main/MainImpl.ts +0 -2
  24. package/front_end/models/ai_assistance/AiHistoryStorage.ts +1 -3
  25. package/front_end/models/ai_assistance/ConversationHandler.ts +4 -6
  26. package/front_end/models/ai_assistance/agents/AiAgent.ts +4 -1
  27. package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +107 -72
  28. package/front_end/models/ai_assistance/agents/PerformanceAnnotationsAgent.ts +2 -2
  29. package/front_end/models/ai_assistance/agents/StylingAgent.ts +2 -2
  30. package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.snapshot.txt +178 -85
  31. package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.ts +308 -218
  32. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +100 -100
  33. package/front_end/models/ai_assistance/data_formatters/UnitFormatters.ts +10 -1
  34. package/front_end/models/ai_assistance/performance/AIContext.ts +19 -21
  35. package/front_end/models/bindings/ContentProviderBasedProject.ts +6 -4
  36. package/front_end/models/breakpoints/BreakpointManager.ts +3 -3
  37. package/front_end/models/har/Writer.ts +11 -11
  38. package/front_end/models/persistence/FileSystemWorkspaceBinding.ts +3 -3
  39. package/front_end/models/persistence/IsolatedFileSystem.ts +4 -4
  40. package/front_end/models/persistence/IsolatedFileSystemManager.ts +7 -7
  41. package/front_end/models/persistence/PersistenceImpl.ts +8 -8
  42. package/front_end/models/persistence/PlatformFileSystem.ts +1 -1
  43. package/front_end/models/trace/ModelImpl.ts +2 -16
  44. package/front_end/models/trace/Processor.ts +15 -9
  45. package/front_end/models/trace/handlers/AuctionWorkletsHandler.ts +4 -4
  46. package/front_end/models/trace/handlers/FramesHandler.ts +2 -2
  47. package/front_end/models/trace/handlers/LayoutShiftsHandler.ts +7 -10
  48. package/front_end/models/trace/handlers/MetaHandler.ts +11 -9
  49. package/front_end/models/trace/handlers/ScreenshotsHandler.ts +1 -1
  50. package/front_end/models/trace/handlers/ScriptsHandler.ts +5 -5
  51. package/front_end/models/trace/handlers/UserInteractionsHandler.ts +2 -14
  52. package/front_end/models/trace/handlers/UserTimingsHandler.ts +3 -4
  53. package/front_end/models/trace/insights/CLSCulprits.ts +1 -1
  54. package/front_end/models/trace/insights/DocumentLatency.ts +3 -4
  55. package/front_end/models/trace/insights/DuplicatedJavaScript.ts +1 -1
  56. package/front_end/models/trace/insights/INPBreakdown.ts +1 -1
  57. package/front_end/models/trace/insights/ImageDelivery.ts +1 -1
  58. package/front_end/models/trace/insights/LCPBreakdown.ts +1 -1
  59. package/front_end/models/trace/insights/LCPDiscovery.ts +1 -1
  60. package/front_end/models/trace/insights/ModernHTTP.ts +1 -1
  61. package/front_end/models/trace/insights/NetworkDependencyTree.ts +1 -1
  62. package/front_end/models/trace/insights/RenderBlocking.ts +1 -1
  63. package/front_end/models/trace/insights/types.ts +2 -0
  64. package/front_end/models/trace/types/TraceEvents.ts +41 -64
  65. package/front_end/models/trace_source_maps_resolver/trace_source_maps_resolver.ts +1 -1
  66. package/front_end/panels/ai_assistance/AiAssistancePanel.ts +21 -99
  67. package/front_end/panels/application/ServiceWorkersView.ts +0 -1
  68. package/front_end/panels/browser_debugger/CategorizedBreakpointsSidebarPane.ts +2 -3
  69. package/front_end/panels/common/GdpSignUpDialog.ts +6 -3
  70. package/front_end/panels/console/ConsoleView.ts +23 -28
  71. package/front_end/panels/console/ConsoleViewport.ts +2 -2
  72. package/front_end/panels/console/consoleView.css +11 -1
  73. package/front_end/panels/coverage/CoverageView.ts +2 -2
  74. package/front_end/panels/elements/ElementsTreeOutline.ts +2 -2
  75. package/front_end/panels/elements/StyleEditorWidget.ts +8 -19
  76. package/front_end/panels/elements/StylePropertyTreeElement.ts +39 -25
  77. package/front_end/panels/elements/StylesSidebarPane.ts +2 -2
  78. package/front_end/panels/elements/stylePropertiesTreeOutline.css +4 -3
  79. package/front_end/panels/layer_viewer/Layers3DView.ts +2 -2
  80. package/front_end/panels/layers/LayerTreeModel.ts +3 -3
  81. package/front_end/panels/mobile_throttling/ThrottlingSettingsTab.ts +4 -4
  82. package/front_end/panels/network/NetworkLogView.ts +1 -1
  83. package/front_end/panels/network/NetworkLogViewColumns.ts +3 -3
  84. package/front_end/panels/network/NetworkSearchScope.ts +6 -6
  85. package/front_end/panels/search/SearchView.ts +33 -32
  86. package/front_end/panels/settings/components/SyncSection.ts +6 -1
  87. package/front_end/panels/sources/SourcesSearchScope.ts +4 -4
  88. package/front_end/panels/sources/TabbedEditorContainer.ts +5 -5
  89. package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +10 -5
  90. package/front_end/panels/timeline/TimelineFlameChartView.ts +18 -15
  91. package/front_end/panels/timeline/TimelinePanel.ts +41 -22
  92. package/front_end/panels/timeline/TracingLayerTree.ts +4 -5
  93. package/front_end/panels/timeline/components/ExportTraceOptions.ts +37 -22
  94. package/front_end/panels/timeline/components/insights/BaseInsightComponent.ts +17 -7
  95. package/front_end/third_party/axe-core/README.chromium +1 -0
  96. package/front_end/third_party/codemirror/README.chromium +1 -0
  97. package/front_end/third_party/codemirror.next/README.chromium +1 -0
  98. package/front_end/third_party/csp_evaluator/README.chromium +1 -0
  99. package/front_end/third_party/diff/README.chromium +1 -0
  100. package/front_end/third_party/i18n/README.chromium +1 -0
  101. package/front_end/third_party/intl-messageformat/README.chromium +1 -0
  102. package/front_end/third_party/json5/README.chromium +1 -0
  103. package/front_end/third_party/legacy-javascript/README.chromium +1 -0
  104. package/front_end/third_party/lighthouse/README.chromium +1 -0
  105. package/front_end/third_party/lit/README.chromium +1 -0
  106. package/front_end/third_party/marked/README.chromium +1 -0
  107. package/front_end/third_party/puppeteer-replay/README.chromium +1 -0
  108. package/front_end/third_party/third-party-web/README.chromium +1 -0
  109. package/front_end/third_party/vscode.web-custom-data/README.chromium +1 -0
  110. package/front_end/third_party/wasmparser/README.chromium +1 -0
  111. package/front_end/third_party/web-vitals/README.chromium +1 -0
  112. package/front_end/ui/components/tooltips/Tooltip.ts +17 -1
  113. package/front_end/ui/legacy/ContextMenu.ts +2 -2
  114. package/front_end/ui/legacy/GlassPane.ts +7 -3
  115. package/front_end/ui/legacy/ProgressIndicator.ts +29 -16
  116. package/front_end/ui/legacy/TabbedPane.ts +2 -2
  117. package/front_end/ui/legacy/Treeoutline.ts +10 -5
  118. package/front_end/ui/legacy/UIUtils.ts +42 -10
  119. package/front_end/ui/legacy/components/color_picker/Spectrum.ts +14 -14
  120. package/front_end/ui/legacy/components/data_grid/DataGrid.ts +6 -6
  121. package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +3 -29
  122. package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +14 -14
  123. package/front_end/ui/visual_logging/KnownContextValues.ts +2 -0
  124. package/inspector_overlay/highlight_common.ts +1 -27
  125. package/inspector_overlay/highlight_grid_common.ts +1 -27
  126. package/inspector_overlay/tool_highlight.ts +1 -27
  127. package/inspector_overlay/tool_persistent.ts +1 -27
  128. package/inspector_overlay/tool_source_order.ts +1 -27
  129. package/package.json +1 -1
@@ -31,7 +31,7 @@ import type * as ProtocolClient from '../protocol_client/protocol_client.js';
31
31
 
32
32
  import * as EnhancedTraces from './EnhancedTracesParser.js';
33
33
  import type {
34
- ProtocolMessage, RehydratingExecutionContext, RehydratingScript, RehydratingTarget, ServerMessage, TraceFile} from
34
+ ProtocolMessage, RehydratingExecutionContext, RehydratingScript, RehydratingTarget, ServerMessage} from
35
35
  './RehydratingObject.js';
36
36
  import {TraceObject} from './TraceObject.js';
37
37
 
@@ -66,11 +66,11 @@ export class RehydratingConnection implements ProtocolClient.InspectorBackend.Co
66
66
  rehydratingConnectionState: RehydratingConnectionState = RehydratingConnectionState.UNINITIALIZED;
67
67
  onDisconnect: ((arg0: string) => void)|null = null;
68
68
  onMessage: ((arg0: Object) => void)|null = null;
69
- trace: TraceFile|null = null;
69
+ trace: TraceObject|null = null;
70
70
  sessions = new Map<number, RehydratingSessionBase>();
71
71
  #onConnectionLost: (message: Platform.UIString.LocalizedString) => void;
72
72
  #rehydratingWindow: Window&typeof globalThis;
73
- #onReceiveHostWindowPayloadBound = this.#onReceiveHostWindowPayload.bind(this);
73
+ #onReceiveHostWindowPayloadBound = this.onReceiveHostWindowPayload.bind(this);
74
74
 
75
75
  constructor(onConnectionLost: (message: Platform.UIString.LocalizedString) => void) {
76
76
  // If we're invoking this class, we're in the rehydrating pop-up window. Rename window for clarity.
@@ -92,12 +92,12 @@ export class RehydratingConnection implements ProtocolClient.InspectorBackend.Co
92
92
  * This is a callback for rehydrated session to receive payload from host window. Payload includes but not limited to
93
93
  * the trace event and all necessary data to power a rehydrated session.
94
94
  */
95
- #onReceiveHostWindowPayload(event: MessageEvent): void {
95
+ onReceiveHostWindowPayload(event: MessageEvent): void {
96
96
  if (event.data.type === 'REHYDRATING_TRACE_FILE') {
97
97
  const traceJson = event.data.traceJson as string;
98
98
  let trace;
99
99
  try {
100
- trace = JSON.parse(traceJson) as TraceFile;
100
+ trace = new TraceObject(JSON.parse(traceJson));
101
101
  } catch {
102
102
  this.#onConnectionLost(i18nString(UIStrings.errorLoadingLog));
103
103
  return;
@@ -107,7 +107,7 @@ export class RehydratingConnection implements ProtocolClient.InspectorBackend.Co
107
107
  this.#rehydratingWindow.removeEventListener('message', this.#onReceiveHostWindowPayloadBound);
108
108
  }
109
109
 
110
- async startHydration(trace: TraceFile): Promise<boolean> {
110
+ async startHydration(trace: TraceObject): Promise<boolean> {
111
111
  // OnMessage should've been set before hydration, and the connection should
112
112
  // be initialized and not hydrated already.
113
113
  if (!this.onMessage || this.rehydratingConnectionState !== RehydratingConnectionState.INITIALIZED) {
@@ -144,10 +144,10 @@ export class RehydratingConnection implements ProtocolClient.InspectorBackend.Co
144
144
  },
145
145
  });
146
146
 
147
- // Create new session associated to the target created and send
148
- // Target.attachedToTarget to frontend.
149
147
  sessionId += 1;
150
- this.sessions.set(sessionId, new RehydratingSession(sessionId, target, executionContexts, scripts, this));
148
+ const session = new RehydratingSession(sessionId, target, executionContexts, scripts, this);
149
+ this.sessions.set(sessionId, session);
150
+ session.declareSessionAttachedToTarget();
151
151
  }
152
152
  await this.#onRehydrated();
153
153
  return true;
@@ -160,8 +160,8 @@ export class RehydratingConnection implements ProtocolClient.InspectorBackend.Co
160
160
 
161
161
  this.rehydratingConnectionState = RehydratingConnectionState.REHYDRATED;
162
162
  // Use revealer to load trace into performance panel
163
- const trace = new TraceObject(this.trace.traceEvents as object[], this.trace.metadata);
164
- await Common.Revealer.reveal(trace);
163
+
164
+ await Common.Revealer.reveal(this.trace);
165
165
  }
166
166
 
167
167
  setOnMessage(onMessage: (arg0: Object|string) => void): void {
@@ -220,11 +220,7 @@ class RehydratingSessionBase {
220
220
  }
221
221
 
222
222
  sendMessageToFrontend(payload: ServerMessage): void {
223
- requestAnimationFrame(() => {
224
- if (this.connection) {
225
- this.connection.postToFrontend(payload);
226
- }
227
- });
223
+ this.connection?.postToFrontend(payload);
228
224
  }
229
225
 
230
226
  handleFrontendMessageAsFakeCDPAgent(data: ProtocolMessage): void {
@@ -250,7 +246,6 @@ export class RehydratingSession extends RehydratingSessionBase {
250
246
  this.target = target;
251
247
  this.executionContexts = executionContexts;
252
248
  this.scripts = scripts;
253
- this.sessionAttachToTarget();
254
249
  }
255
250
 
256
251
  override sendMessageToFrontend(payload: ServerMessage, attachSessionId = true): void {
@@ -284,7 +279,7 @@ export class RehydratingSession extends RehydratingSessionBase {
284
279
  }
285
280
  }
286
281
 
287
- private sessionAttachToTarget(): void {
282
+ declareSessionAttachedToTarget(): void {
288
283
  this.sendMessageToFrontend(
289
284
  {
290
285
  method: 'Target.attachedToTarget',
@@ -4,28 +4,14 @@
4
4
 
5
5
  import type * as Protocol from '../../generated/protocol.js';
6
6
 
7
- import type {SourceMapV3} from './SourceMap.js';
8
-
9
- export interface RehydratingScript {
10
- scriptId: Protocol.Runtime.ScriptId;
7
+ // This object is emitted to ScriptParsed and also used in the RehydratingConnection
8
+ export interface RehydratingScript extends Protocol.Debugger.ScriptParsedEvent {
9
+ sourceText?: string;
10
+ executionContextAuxData?: RehydratingExecutionContextAuxData;
11
11
  isolate: string;
12
- /** The script's `src` */
13
- url: string;
14
- executionContextId: Protocol.Runtime.ExecutionContextId;
15
- startLine: number;
16
- startColumn: number;
17
- endLine: number;
18
- endColumn: number;
19
- hash: string;
20
- isModule?: boolean;
21
- hasSourceURL?: boolean;
22
- sourceMapURL?: string;
23
- /** The manually provided string via the `//# sourceURL` directive */
12
+ /** The manually provided string via the `//# sourceURL` directive. Meanwhile the `url` is the script's `src` */
24
13
  sourceURL?: string;
25
- length?: number;
26
- sourceText?: string;
27
- auxData?: RehydratingExecutionContextAuxData;
28
- pid?: number;
14
+ pid: number;
29
15
  }
30
16
 
31
17
  export interface RehydratingExecutionContextAuxData {
@@ -34,11 +20,9 @@ export interface RehydratingExecutionContextAuxData {
34
20
  type?: string;
35
21
  }
36
22
 
37
- export interface RehydratingExecutionContext {
38
- id: Protocol.Runtime.ExecutionContextId;
39
- origin: string;
23
+ export interface RehydratingExecutionContext extends Protocol.Runtime.ExecutionContextDescription {
24
+ /** AKA V8ContextToken. https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/inspector/inspector_trace_events.cc;l=1229;drc=3c88f61e18b043e70c225d8d57c77832a85e7f58 */
40
25
  v8Context?: string;
41
- name?: string;
42
26
  auxData?: RehydratingExecutionContextAuxData;
43
27
  isolate: string;
44
28
  }
@@ -80,10 +64,3 @@ export interface Session {
80
64
  executionContexts: RehydratingExecutionContext[];
81
65
  scripts: RehydratingScript[];
82
66
  }
83
-
84
- // TODO: we need to resolve the inability to use Trace model types inside SDK. For
85
- // now, duplicate a minimal type here.
86
- export interface TraceFile {
87
- traceEvents: readonly object[];
88
- metadata: {sourceMaps?: Array<{sourceMapUrl: string, sourceMap: SourceMapV3}>};
89
- }
@@ -1,37 +1,7 @@
1
- // Copyright 2021 The Chromium Authors
1
+ // Copyright 2009 The Chromium Authors
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
- /*
6
- * Copyright (C) 2009 Google Inc. All rights reserved.
7
- *
8
- * Redistribution and use in source and binary forms, with or without
9
- * modification, are permitted provided that the following conditions are
10
- * met:
11
- *
12
- * * Redistributions of source code must retain the above copyright
13
- * notice, this list of conditions and the following disclaimer.
14
- * * Redistributions in binary form must reproduce the above
15
- * copyright notice, this list of conditions and the following disclaimer
16
- * in the documentation and/or other materials provided with the
17
- * distribution.
18
- * * Neither the #name of Google Inc. nor the names of its
19
- * contributors may be used to endorse or promote products derived from
20
- * this software without specific prior written permission.
21
- *
22
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33
- */
34
-
35
5
  import type * as ProtocolProxyApi from '../../generated/protocol-proxy-api.js';
36
6
  import * as Protocol from '../../generated/protocol.js';
37
7
  import type {DOMPinnedWebIDLProp, DOMPinnedWebIDLType} from '../common/JavaScriptMetaData.js';
@@ -1,37 +1,7 @@
1
- // Copyright 2021 The Chromium Authors
1
+ // Copyright 2011 The Chromium Authors
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
- /*
6
- * Copyright (C) 2011 Google Inc. All rights reserved.
7
- *
8
- * Redistribution and use in source and binary forms, with or without
9
- * modification, are permitted provided that the following conditions are
10
- * met:
11
- *
12
- * * Redistributions of source code must retain the above copyright
13
- * notice, this list of conditions and the following disclaimer.
14
- * * Redistributions in binary form must reproduce the above
15
- * copyright notice, this list of conditions and the following disclaimer
16
- * in the documentation and/or other materials provided with the
17
- * distribution.
18
- * * Neither the #name of Google Inc. nor the names of its
19
- * contributors may be used to endorse or promote products derived from
20
- * this software without specific prior written permission.
21
- *
22
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33
- */
34
-
35
5
  import type * as ProtocolProxyApi from '../../generated/protocol-proxy-api.js';
36
6
  import * as Protocol from '../../generated/protocol.js';
37
7
  import * as Common from '../common/common.js';
@@ -1,37 +1,7 @@
1
- // Copyright 2021 The Chromium Authors
1
+ // Copyright 2012 The Chromium Authors
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
- /*
6
- * Copyright (C) 2012 Google Inc. All rights reserved.
7
- *
8
- * Redistribution and use in source and binary forms, with or without
9
- * modification, are permitted provided that the following conditions are
10
- * met:
11
- *
12
- * * Redistributions of source code must retain the above copyright
13
- * notice, this list of conditions and the following disclaimer.
14
- * * Redistributions in binary form must reproduce the above
15
- * copyright notice, this list of conditions and the following disclaimer
16
- * in the documentation and/or other materials provided with the
17
- * distribution.
18
- * * Neither the #name of Google Inc. nor the names of its
19
- * contributors may be used to endorse or promote products derived from
20
- * this software without specific prior written permission.
21
- *
22
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33
- */
34
-
35
5
  import type * as ProtocolProxyApi from '../../generated/protocol-proxy-api.js';
36
6
  import type * as Protocol from '../../generated/protocol.js';
37
7
  import * as Common from '../common/common.js';
@@ -1,37 +1,7 @@
1
- // Copyright 2021 The Chromium Authors
1
+ // Copyright 2011 The Chromium Authors
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
- /*
6
- * Copyright (C) 2011 Google Inc. All rights reserved.
7
- *
8
- * Redistribution and use in source and binary forms, with or without
9
- * modification, are permitted provided that the following conditions are
10
- * met:
11
- *
12
- * * Redistributions of source code must retain the above copyright
13
- * notice, this list of conditions and the following disclaimer.
14
- * * Redistributions in binary form must reproduce the above
15
- * copyright notice, this list of conditions and the following disclaimer
16
- * in the documentation and/or other materials provided with the
17
- * distribution.
18
- * * Neither the #name of Google Inc. nor the names of its
19
- * contributors may be used to endorse or promote products derived from
20
- * this software without specific prior written permission.
21
- *
22
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33
- */
34
-
35
5
  import type * as ProtocolProxyApi from '../../generated/protocol-proxy-api.js';
36
6
  import * as Protocol from '../../generated/protocol.js';
37
7
  import * as Common from '../common/common.js';
@@ -1,37 +1,7 @@
1
- // Copyright 2021 The Chromium Authors
1
+ // Copyright 2012 The Chromium Authors
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
- /*
6
- * Copyright (C) 2012 Google Inc. All rights reserved.
7
- *
8
- * Redistribution and use in source and binary forms, with or without
9
- * modification, are permitted provided that the following conditions are
10
- * met:
11
- *
12
- * * Redistributions of source code must retain the above copyright
13
- * notice, this list of conditions and the following disclaimer.
14
- * * Redistributions in binary form must reproduce the above
15
- * copyright notice, this list of conditions and the following disclaimer
16
- * in the documentation and/or other materials provided with the
17
- * distribution.
18
- * * Neither the #name of Google Inc. nor the names of its
19
- * contributors may be used to endorse or promote products derived from
20
- * this software without specific prior written permission.
21
- *
22
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33
- */
34
-
35
5
  import * as TextUtils from '../../models/text_utils/text_utils.js';
36
6
  import * as ScopesCodec from '../../third_party/source-map-scopes-codec/source-map-scopes-codec.js';
37
7
  import * as Common from '../common/common.js';
@@ -8,13 +8,18 @@ import type * as Protocol from '../../generated/protocol.js';
8
8
 
9
9
  import type {NetworkRequest} from './NetworkRequest.js';
10
10
  import {ResourceTreeModel} from './ResourceTreeModel.js';
11
+ import type {SourceMapV3} from './SourceMap.js';
11
12
 
12
13
  // A thin wrapper class, mostly to enable instanceof-based revealing of traces to open in Timeline.
13
14
  export class TraceObject {
14
15
  readonly traceEvents: Protocol.Tracing.DataCollectedEvent['value'];
15
- readonly metadata: Object;
16
- constructor(traceEvents: Protocol.Tracing.DataCollectedEvent['value'], metadata: Object = {}) {
17
- this.traceEvents = traceEvents;
16
+ readonly metadata: {sourceMaps?: Array<{sourceMapUrl: string, sourceMap: SourceMapV3, url: string}>};
17
+ constructor(payload: Protocol.Tracing.DataCollectedEvent['value']|TraceObject, meta: Object = {}) {
18
+ // Handle the typical traceEvent array juggling here.
19
+ const events = Array.isArray(payload) ? payload : payload.traceEvents;
20
+ const metadata = meta ?? (!Array.isArray(payload) && payload.metadata) ?? {};
21
+
22
+ this.traceEvents = events;
18
23
  this.metadata = metadata;
19
24
  }
20
25
  }
@@ -356,8 +356,6 @@ export class MainImpl {
356
356
  Root.Runtime.ExperimentName.TIMELINE_SHOW_POST_MESSAGE_EVENTS,
357
357
  'Performance panel: show postMessage dispatch and handling flows',
358
358
  );
359
- Root.Runtime.experiments.register(
360
- Root.Runtime.ExperimentName.TIMELINE_SAVE_AS_GZ, 'Performance panel: enable saving traces as .gz');
361
359
 
362
360
  Root.Runtime.experiments.enableExperimentsByDefault([
363
361
  Root.Runtime.ExperimentName.FULL_ACCESSIBILITY_TREE,
@@ -13,9 +13,7 @@ export const enum ConversationType {
13
13
  STYLING = 'freestyler',
14
14
  FILE = 'drjones-file',
15
15
  NETWORK = 'drjones-network-request',
16
- PERFORMANCE_CALL_TREE = 'drjones-performance',
17
- PERFORMANCE_INSIGHT = 'performance-insight',
18
- PERFORMANCE_FULL = 'drjones-performance-full',
16
+ PERFORMANCE = 'drjones-performance-full',
19
17
  }
20
18
 
21
19
  export const NOT_FOUND_IMAGE_DATA = '';
@@ -50,7 +50,7 @@ export interface ExternalPerformanceAIConversationData {
50
50
  }
51
51
 
52
52
  export interface ExternalPerformanceRequestParameters {
53
- conversationType: ConversationType.PERFORMANCE_FULL;
53
+ conversationType: ConversationType.PERFORMANCE;
54
54
  prompt: string;
55
55
  data: ExternalPerformanceAIConversationData;
56
56
  }
@@ -201,7 +201,7 @@ export class ConversationHandler {
201
201
  case ConversationType.STYLING: {
202
202
  return await this.#handleExternalStylingConversation(parameters.prompt, parameters.selector);
203
203
  }
204
- case ConversationType.PERFORMANCE_FULL:
204
+ case ConversationType.PERFORMANCE:
205
205
  return await this.#handleExternalPerformanceConversation(parameters.prompt, parameters.data);
206
206
  case ConversationType.NETWORK:
207
207
  if (!parameters.requestUrl) {
@@ -348,10 +348,8 @@ export class ConversationHandler {
348
348
  agent = new FileAgent(options);
349
349
  break;
350
350
  }
351
- case ConversationType.PERFORMANCE_FULL:
352
- case ConversationType.PERFORMANCE_INSIGHT:
353
- case ConversationType.PERFORMANCE_CALL_TREE: {
354
- agent = new PerformanceAgent(options, conversationType);
351
+ case ConversationType.PERFORMANCE: {
352
+ agent = new PerformanceAgent(options);
355
353
  break;
356
354
  }
357
355
  }
@@ -148,6 +148,9 @@ export interface ConversationSuggestion {
148
148
  jslogContext?: string;
149
149
  }
150
150
 
151
+ /** At least one. */
152
+ export type ConversationSuggestions = [ConversationSuggestion, ...ConversationSuggestion[]];
153
+
151
154
  export const enum ExternalRequestResponseType {
152
155
  ANSWER = 'answer',
153
156
  NOTIFICATION = 'notification',
@@ -196,7 +199,7 @@ export abstract class ConversationContext<T> {
196
199
  return;
197
200
  }
198
201
 
199
- async getSuggestions(): Promise<[ConversationSuggestion, ...ConversationSuggestion[]]|undefined> {
202
+ async getSuggestions(): Promise<ConversationSuggestions|undefined> {
200
203
  return;
201
204
  }
202
205
  }