chrome-devtools-frontend 1.0.1652307 → 1.0.1656291
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/skills/fixing-skipped-tests/SKILL.md +32 -0
- package/.agents/skills/migrate-chromium-test/SKILL.md +144 -0
- package/.agents/skills/ui-eng-vision-local-lit-renderer/SKILL.md +116 -0
- package/.agents/skills/ui-eng-vision-logic-consolidator/SKILL.md +82 -0
- package/.agents/skills/ui-eng-vision-orchestrator/SKILL.md +123 -0
- package/.agents/skills/ui-eng-vision-test-scaffolder/SKILL.md +125 -0
- package/.agents/skills/ui-eng-vision-widget-promoter/SKILL.md +75 -0
- package/AUTHORS +1 -0
- package/config/owner/COMMON_OWNERS +0 -4
- package/docs/get_the_code.md +1 -2
- package/docs/playbook.md +1 -1
- package/docs/ui_engineering.md +3 -1
- package/eslint.config.mjs +0 -5
- package/front_end/Tests.js +1 -0
- package/front_end/core/common/Settings.ts +47 -30
- package/front_end/core/sdk/CPUThrottlingManager.ts +23 -167
- package/front_end/core/sdk/CSSMetadata.ts +23 -0
- package/front_end/core/sdk/CompilerSourceMappingContentProvider.ts +8 -4
- package/front_end/core/sdk/ConsoleModel.ts +13 -11
- package/front_end/core/sdk/DOMDebuggerModel.ts +11 -5
- package/front_end/core/sdk/DOMModel.ts +4 -0
- package/front_end/core/sdk/EmulationModel.ts +4 -0
- package/front_end/core/sdk/EventBreakpointsModel.ts +9 -5
- package/front_end/core/sdk/IsolateManager.ts +6 -6
- package/front_end/core/sdk/ResourceTreeModel.ts +8 -5
- package/front_end/core/sdk/TargetManager.ts +17 -0
- package/front_end/entrypoints/devtools_app/devtools_app.ts +0 -1
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +459 -74
- package/front_end/entrypoints/main/MainImpl.ts +12 -42
- package/front_end/foundation/Universe.ts +116 -3
- package/front_end/generated/InspectorBackendCommands.ts +11 -6
- package/front_end/generated/SupportedCSSProperties.js +124 -34
- package/front_end/generated/protocol-mapping.d.ts +8 -0
- package/front_end/generated/protocol-proxy-api.d.ts +15 -0
- package/front_end/generated/protocol.ts +94 -1
- package/front_end/models/ai_assistance/AiConversation.ts +2 -7
- package/front_end/models/ai_assistance/README.md +4 -3
- package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +1 -1
- package/front_end/models/ai_assistance/agents/NetworkAgent.snapshot.txt +1 -1
- package/front_end/models/ai_assistance/agents/PerformanceAgent.snapshot.txt +2 -2
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +13 -320
- package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +0 -24
- package/front_end/models/ai_assistance/agents/StylingAgent.ts +2 -358
- package/front_end/models/ai_assistance/ai_assistance.ts +6 -8
- package/front_end/models/ai_assistance/contexts/PerformanceTraceContext.ts +295 -0
- package/front_end/models/ai_assistance/contexts/RequestContext.snapshot.txt +0 -1
- package/front_end/models/ai_assistance/data_formatters/NetworkRequestFormatter.ts +0 -2
- package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.snapshot.txt +10 -10
- package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.ts +12 -11
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +6 -6
- package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +1 -14
- package/front_end/models/ai_assistance/skills/accessibility.md +4 -2
- package/front_end/models/ai_assistance/tools/GetElementAccessibilityDetails.ts +142 -0
- package/front_end/models/ai_assistance/tools/GetStyles.ts +1 -1
- package/front_end/models/ai_assistance/tools/README.md +21 -1
- package/front_end/models/ai_assistance/tools/{ResolveLighthousePath.ts → ResolveDevtoolsNodePath.ts} +18 -17
- package/front_end/models/ai_assistance/tools/Tool.ts +6 -1
- package/front_end/models/ai_assistance/tools/ToolRegistry.ts +4 -2
- package/front_end/models/autofill_manager/AutofillManager.ts +6 -15
- package/front_end/models/bindings/NetworkProject.ts +4 -8
- package/front_end/models/breakpoints/BreakpointManager.ts +9 -9
- package/front_end/models/emulation/DeviceModeModel.ts +24 -0
- package/front_end/models/emulation/EmulatedDevices.ts +108 -0
- package/front_end/models/heap_snapshot/HeapSnapshotModel.ts +36 -0
- package/front_end/models/heap_snapshot/HeapSnapshotProxy.ts +8 -0
- package/front_end/models/issues_manager/IssuesManager.ts +10 -6
- package/front_end/models/javascript_metadata/JavaScriptMetadata.ts +4 -5
- package/front_end/models/javascript_metadata/NativeFunctions.js +1 -1
- package/front_end/models/live-metrics/LiveMetrics.ts +6 -6
- package/front_end/models/live-metrics/web-vitals-injected/spec/spec.ts +5 -5
- package/front_end/models/live-metrics/web-vitals-injected/web-vitals-injected.ts +3 -3
- package/front_end/models/logs/LogManager.ts +25 -10
- package/front_end/models/logs/NetworkLog.ts +24 -19
- package/front_end/models/persistence/AutomaticFileSystemManager.ts +14 -13
- package/front_end/models/persistence/AutomaticFileSystemWorkspaceBinding.ts +26 -14
- package/front_end/models/persistence/IsolatedFileSystem.ts +9 -11
- package/front_end/models/persistence/IsolatedFileSystemManager.ts +22 -11
- package/front_end/models/persistence/NetworkPersistenceManager.ts +73 -44
- package/front_end/models/persistence/PersistenceImpl.ts +4 -5
- package/front_end/models/project_settings/ProjectSettingsModel.ts +12 -11
- package/front_end/models/trace/EntityMapper.ts +1 -1
- package/front_end/models/trace/handlers/ScreenshotsHandler.ts +14 -59
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +12 -38
- package/front_end/panels/ai_assistance/ExportConversation.ts +4 -1
- package/front_end/panels/ai_assistance/components/ChatInput.ts +2 -2
- package/front_end/panels/application/DeviceBoundSessionsView.ts +15 -3
- package/front_end/panels/application/FrameDetailsView.ts +2 -1
- package/front_end/panels/application/IndexedDBViews.ts +38 -36
- package/front_end/panels/application/ServiceWorkersView.ts +23 -16
- package/front_end/panels/application/components/AdsView.ts +4 -0
- package/front_end/panels/autofill/AutofillView.ts +1 -1
- package/front_end/panels/autofill/autofill-meta.ts +3 -2
- package/front_end/panels/common/CPUThrottlingOption.ts +142 -0
- package/front_end/panels/common/ThrottlingUtils.ts +9 -4
- package/front_end/panels/common/common.ts +1 -1
- package/front_end/panels/console/ConsoleViewMessage.ts +45 -0
- package/front_end/panels/elements/AccessibilityTreeUtils.ts +26 -15
- package/front_end/panels/elements/AccessibilityTreeView.ts +12 -9
- package/front_end/panels/elements/ElementsPanel.ts +0 -74
- package/front_end/panels/elements/ElementsTreeOutline.ts +5 -4
- package/front_end/panels/emulation/DeviceModeToolbar.ts +46 -45
- package/front_end/panels/layer_viewer/LayerTreeOutline.ts +118 -68
- package/front_end/panels/layer_viewer/Layers3DView.ts +1 -1
- package/front_end/panels/layer_viewer/layerTreeOutline.css +20 -13
- package/front_end/panels/layers/LayersPanel.ts +1 -1
- package/front_end/panels/mobile_throttling/CalibrationController.ts +6 -5
- package/front_end/panels/mobile_throttling/MobileThrottlingSelector.ts +1 -1
- package/front_end/panels/mobile_throttling/ThrottlingManager.ts +40 -13
- package/front_end/panels/mobile_throttling/ThrottlingPresets.ts +13 -17
- package/front_end/panels/mobile_throttling/ThrottlingSettingsTab.ts +79 -30
- package/front_end/panels/mobile_throttling/throttlingSettingsTab.css +5 -0
- package/front_end/panels/network/LinkPreloadGenerator.ts +101 -0
- package/front_end/panels/network/NetworkLogView.ts +28 -9
- package/front_end/panels/network/NetworkPanel.ts +1 -63
- package/front_end/panels/network/RequestInitiatorView.ts +29 -4
- package/front_end/panels/network/components/HeaderSectionRow.css +9 -7
- package/front_end/panels/network/components/HeaderSectionRow.ts +20 -1
- package/front_end/panels/network/components/RequestHeaderSection.css +5 -3
- package/front_end/panels/network/components/RequestHeaderSection.ts +1 -2
- package/front_end/panels/network/components/RequestHeadersView.css +1 -1
- package/front_end/panels/network/network.ts +2 -0
- package/front_end/panels/profiler/HeapSnapshotView.ts +121 -33
- package/front_end/panels/profiler/ModuleUIStrings.ts +4 -0
- package/front_end/panels/security/SecurityPanel.ts +36 -23
- package/front_end/panels/settings/SettingsScreen.ts +18 -103
- package/front_end/panels/settings/settings-meta.ts +0 -24
- package/front_end/panels/timeline/TimelineController.ts +3 -2
- package/front_end/panels/timeline/TimelineHistoryManager.ts +38 -37
- package/front_end/panels/timeline/TimelinePanel.ts +52 -11
- package/front_end/panels/timeline/components/CPUThrottlingSelector.ts +20 -18
- package/front_end/panels/timeline/components/LiveMetricsView.ts +38 -38
- package/front_end/panels/timeline/components/MetricCard.ts +18 -18
- package/front_end/panels/timeline/components/liveMetricsView.css +6 -6
- package/front_end/panels/timeline/components/metricCard.css +4 -4
- package/front_end/panels/timeline/timelineFlamechartPopover.css +2 -0
- package/front_end/panels/utils/utils.ts +25 -24
- package/front_end/panels/whats_new/ReleaseNoteText.ts +3 -3
- package/front_end/panels/whats_new/resources/WNDT.md +1 -1
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/puppeteer/README.chromium +2 -2
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.d.ts +34 -55
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +96 -83
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Browser.d.ts +10 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/BrowserContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/BrowserContext.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/BrowserContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/CDPSession.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/CDPSession.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/HTTPResponse.d.ts +3 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/HTTPResponse.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/HTTPResponse.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Realm.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Realm.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Target.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Target.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/locators/locators.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/locators/locators.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/HTTPResponse.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/HTTPResponse.js +2 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/HTTPResponse.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/Realm.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/Realm.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Browser.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Browser.js +5 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Frame.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Frame.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/FrameManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/FrameManager.js +23 -13
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/FrameManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/HTTPResponse.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/HTTPResponse.js +4 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/HTTPResponse.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Input.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/LifecycleWatcher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/LifecycleWatcher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Target.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Target.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/WebMCP.d.ts +3 -41
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/WebMCP.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/WebMCP.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/ConnectOptions.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/BrowserLauncher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/BrowserLauncher.js +4 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/BrowserLauncher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/LaunchOptions.d.ts +5 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/LaunchOptions.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/revisions.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/revisions.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/util/httpUtils.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/util/httpUtils.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/util/httpUtils.js +5 -5
- package/front_end/third_party/puppeteer/package/lib/puppeteer/util/httpUtils.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/util/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/util/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/types.d.ts +34 -55
- package/front_end/third_party/puppeteer/package/package.json +4 -4
- package/front_end/third_party/puppeteer/package/src/api/Browser.ts +13 -1
- package/front_end/third_party/puppeteer/package/src/api/BrowserContext.ts +2 -3
- package/front_end/third_party/puppeteer/package/src/api/CDPSession.ts +3 -1
- package/front_end/third_party/puppeteer/package/src/api/HTTPResponse.ts +3 -2
- package/front_end/third_party/puppeteer/package/src/api/Realm.ts +1 -2
- package/front_end/third_party/puppeteer/package/src/api/Target.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/api/locators/locators.ts +1 -2
- package/front_end/third_party/puppeteer/package/src/bidi/HTTPResponse.ts +3 -1
- package/front_end/third_party/puppeteer/package/src/bidi/core/Realm.ts +1 -3
- package/front_end/third_party/puppeteer/package/src/cdp/Browser.ts +13 -3
- package/front_end/third_party/puppeteer/package/src/cdp/Frame.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/cdp/FrameManager.ts +24 -13
- package/front_end/third_party/puppeteer/package/src/cdp/HTTPResponse.ts +4 -1
- package/front_end/third_party/puppeteer/package/src/cdp/Input.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/cdp/LifecycleWatcher.ts +1 -4
- package/front_end/third_party/puppeteer/package/src/cdp/Target.ts +2 -4
- package/front_end/third_party/puppeteer/package/src/cdp/WebMCP.ts +7 -76
- package/front_end/third_party/puppeteer/package/src/common/ConnectOptions.ts +1 -4
- package/front_end/third_party/puppeteer/package/src/node/BrowserLauncher.ts +4 -1
- package/front_end/third_party/puppeteer/package/src/node/LaunchOptions.ts +5 -0
- package/front_end/third_party/puppeteer/package/src/revisions.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/util/httpUtils.ts +5 -5
- package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
- package/front_end/third_party/puppeteer/third_party/parsel/README.chromium +1 -1
- package/front_end/ui/components/dialogs/Dialog.ts +3 -0
- package/front_end/ui/components/markdown_view/MarkdownLinksMap.ts +0 -7
- package/front_end/ui/helpers/OpenInNewTab.ts +15 -7
- package/front_end/ui/legacy/InspectorDrawerView.ts +7 -5
- package/front_end/ui/legacy/ListWidget.ts +12 -0
- package/front_end/ui/legacy/SplitWidget.ts +12 -11
- package/front_end/ui/legacy/TabbedPane.ts +1 -108
- package/front_end/ui/legacy/components/data_grid/DataGrid.ts +9 -0
- package/front_end/ui/legacy/components/data_grid/DataGridElement.ts +192 -139
- package/front_end/ui/legacy/components/data_grid/DataGridExporter.ts +89 -0
- package/front_end/ui/legacy/components/data_grid/dataGrid.css +10 -0
- package/front_end/ui/legacy/components/data_grid/data_grid.ts +3 -1
- package/front_end/ui/legacy/components/object_ui/CustomPreviewComponent.ts +8 -1
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +110 -17
- package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +89 -40
- package/front_end/ui/legacy/treeoutline.css +1 -1
- package/front_end/ui/visual_logging/KnownContextValues.ts +3 -0
- package/package.json +4 -3
- package/front_end/Images/navigationControls.png +0 -0
- package/front_end/Images/navigationControls_2x.png +0 -0
- package/front_end/Images/popoverArrows.png +0 -0
- package/front_end/entrypoints/greendev_floaty/FloatyEntrypoint.ts +0 -746
- package/front_end/entrypoints/greendev_floaty/floaty.css +0 -301
- package/front_end/entrypoints/greendev_floaty/floaty.html +0 -38
- package/front_end/entrypoints/greendev_floaty/greendev_floaty.ts +0 -415
- package/front_end/models/ai_assistance/agents/GreenDevAgent.ts +0 -834
- package/front_end/models/ai_assistance/agents/GreenDevAgentAntigravityCliSocketClient.ts +0 -53
- package/front_end/models/ai_assistance/agents/GreenDevAgentGeminiCliSocketClient.ts +0 -117
- package/front_end/models/annotations/AnnotationRepository.ts +0 -238
- package/front_end/models/annotations/AnnotationType.ts +0 -10
- package/front_end/models/annotations/README.md +0 -7
- package/front_end/models/annotations/annotations.ts +0 -6
- package/front_end/models/greendev/Prototypes.ts +0 -68
- package/front_end/models/greendev/README.md +0 -5
- package/front_end/models/greendev/greendev.ts +0 -5
- package/front_end/panels/common/Annotation.ts +0 -184
- package/front_end/panels/common/AnnotationManager.ts +0 -208
- package/front_end/panels/common/annotation.css +0 -40
- package/front_end/panels/greendev/GreenDevPanel.css +0 -282
- package/front_end/panels/greendev/GreenDevPanel.ts +0 -364
- package/front_end/panels/greendev/GreenDevShared.ts +0 -13
- package/front_end/panels/greendev/greendev-meta.ts +0 -52
- package/front_end/panels/greendev/greendev.ts +0 -9
|
@@ -2,12 +2,11 @@
|
|
|
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
|
-
/* eslint-disable @devtools/no-imperative-dom-api */
|
|
6
|
-
|
|
7
5
|
import * as Common from '../../core/common/common.js';
|
|
8
6
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
9
7
|
import type * as SDK from '../../core/sdk/sdk.js';
|
|
10
8
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
9
|
+
import {html, render} from '../../ui/lit/lit.js';
|
|
11
10
|
|
|
12
11
|
import layerTreeOutlineStyles from './layerTreeOutline.css.js';
|
|
13
12
|
import {
|
|
@@ -41,21 +40,49 @@ const UIStrings = {
|
|
|
41
40
|
} as const;
|
|
42
41
|
const str_ = i18n.i18n.registerUIStrings('panels/layer_viewer/LayerTreeOutline.ts', UIStrings);
|
|
43
42
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
|
|
44
|
+
export interface ViewInput {
|
|
45
|
+
treeOutlineElement: HTMLElement;
|
|
46
|
+
layerCount: number;
|
|
47
|
+
totalLayerMemory: number;
|
|
48
|
+
}
|
|
49
|
+
export type View = (input: ViewInput, output: object, target: HTMLElement) => void;
|
|
50
|
+
|
|
51
|
+
const DEFAULT_VIEW: View = (input, _output, target) => {
|
|
52
|
+
render(html`
|
|
53
|
+
<style>${layerTreeOutlineStyles}</style>
|
|
54
|
+
<div class="vbox layer-tree-wrapper">
|
|
55
|
+
<div style="flex-grow: 1; overflow: auto; display: flex;">
|
|
56
|
+
${input.treeOutlineElement}
|
|
57
|
+
</div>
|
|
58
|
+
<div class="hbox layer-summary">
|
|
59
|
+
<span class="layer-count">${i18nString(UIStrings.layerCount, {
|
|
60
|
+
PH1: input.layerCount
|
|
61
|
+
})}</span>
|
|
62
|
+
<span>${i18n.ByteUtilities.bytesToString(input.totalLayerMemory)}</span>
|
|
63
|
+
</div>
|
|
64
|
+
</div>
|
|
65
|
+
`,
|
|
66
|
+
target);
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export class LayerTreeOutline extends Common.ObjectWrapper.eventMixin<EventTypes, typeof UI.Widget.Widget>(
|
|
70
|
+
UI.Widget.Widget) implements Common.EventTarget.EventTarget<EventTypes>, LayerView {
|
|
46
71
|
private layerViewHost: LayerViewHost;
|
|
47
72
|
private treeOutline: UI.TreeOutline.TreeOutlineInShadow;
|
|
48
73
|
private lastHoveredNode: LayerTreeElement|null;
|
|
49
|
-
private layerCountElement: HTMLSpanElement;
|
|
50
|
-
private layerMemoryElement: HTMLSpanElement;
|
|
51
|
-
override element: HTMLElement;
|
|
52
74
|
private layerTree?: SDK.LayerTreeBase.LayerTreeBase|null;
|
|
53
75
|
private layerSnapshotMap?: Map<SDK.LayerTreeBase.Layer, SnapshotSelection>;
|
|
54
76
|
|
|
55
|
-
|
|
77
|
+
#view: View;
|
|
78
|
+
#layerCount = 0;
|
|
79
|
+
#totalLayerMemory = 0;
|
|
80
|
+
|
|
81
|
+
constructor(layerViewHost: LayerViewHost, view: View = DEFAULT_VIEW) {
|
|
56
82
|
super();
|
|
57
83
|
this.layerViewHost = layerViewHost;
|
|
58
84
|
this.layerViewHost.registerView(this);
|
|
85
|
+
this.#view = view;
|
|
59
86
|
|
|
60
87
|
this.treeOutline = new UI.TreeOutline.TreeOutlineInShadow();
|
|
61
88
|
this.treeOutline.element.classList.add('layer-tree', 'overflow-auto');
|
|
@@ -66,24 +93,23 @@ export class LayerTreeOutline extends Common.ObjectWrapper.eventMixin<EventTypes
|
|
|
66
93
|
|
|
67
94
|
this.lastHoveredNode = null;
|
|
68
95
|
|
|
69
|
-
const summaryElement = document.createElement('div');
|
|
70
|
-
summaryElement.classList.add('hbox', 'layer-summary');
|
|
71
|
-
this.layerCountElement = document.createElement('span');
|
|
72
|
-
this.layerCountElement.classList.add('layer-count');
|
|
73
|
-
this.layerMemoryElement = document.createElement('span');
|
|
74
|
-
summaryElement.appendChild(this.layerCountElement);
|
|
75
|
-
summaryElement.appendChild(this.layerMemoryElement);
|
|
76
|
-
|
|
77
|
-
const wrapperElement = document.createElement('div');
|
|
78
|
-
wrapperElement.classList.add('vbox', 'layer-tree-wrapper');
|
|
79
|
-
wrapperElement.appendChild(this.treeOutline.element);
|
|
80
|
-
wrapperElement.appendChild(summaryElement);
|
|
81
|
-
this.element = wrapperElement;
|
|
82
|
-
UI.DOMUtilities.appendStyle(this.element, layerTreeOutlineStyles);
|
|
83
|
-
|
|
84
96
|
this.layerViewHost.showInternalLayersSetting().addChangeListener(this.update, this);
|
|
85
97
|
}
|
|
86
98
|
|
|
99
|
+
override wasShown(): void {
|
|
100
|
+
super.wasShown();
|
|
101
|
+
this.requestUpdate();
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
override performUpdate(): void {
|
|
105
|
+
this.#view({
|
|
106
|
+
treeOutlineElement: this.treeOutline.element,
|
|
107
|
+
layerCount: this.#layerCount,
|
|
108
|
+
totalLayerMemory: this.#totalLayerMemory,
|
|
109
|
+
},
|
|
110
|
+
{}, this.contentElement);
|
|
111
|
+
}
|
|
112
|
+
|
|
87
113
|
override focus(): void {
|
|
88
114
|
this.treeOutline.focus();
|
|
89
115
|
}
|
|
@@ -121,7 +147,7 @@ export class LayerTreeOutline extends Common.ObjectWrapper.eventMixin<EventTypes
|
|
|
121
147
|
|
|
122
148
|
private update(): void {
|
|
123
149
|
const showInternalLayers = this.layerViewHost.showInternalLayersSetting().get();
|
|
124
|
-
const seenLayers = new
|
|
150
|
+
const seenLayers = new Set<SDK.LayerTreeBase.Layer>();
|
|
125
151
|
let root: (SDK.LayerTreeBase.Layer|null)|null = null;
|
|
126
152
|
if (this.layerTree) {
|
|
127
153
|
if (!showInternalLayers) {
|
|
@@ -135,58 +161,81 @@ export class LayerTreeOutline extends Common.ObjectWrapper.eventMixin<EventTypes
|
|
|
135
161
|
let layerCount = 0;
|
|
136
162
|
let totalLayerMemory = 0;
|
|
137
163
|
|
|
138
|
-
|
|
139
|
-
if (!layer.drawsContent() && !showInternalLayers) {
|
|
140
|
-
return;
|
|
141
|
-
}
|
|
142
|
-
if (seenLayers.get(layer)) {
|
|
143
|
-
console.assert(false, 'Duplicate layer: ' + layer.id());
|
|
144
|
-
}
|
|
145
|
-
seenLayers.set(layer, true);
|
|
164
|
+
const childrenMap = new Map<SDK.LayerTreeBase.Layer, SDK.LayerTreeBase.Layer[]>();
|
|
146
165
|
|
|
147
|
-
|
|
148
|
-
|
|
166
|
+
if (this.layerTree && root) {
|
|
167
|
+
const buildTree = (layer: SDK.LayerTreeBase.Layer): void => {
|
|
168
|
+
if (!layer.drawsContent() && !showInternalLayers) {
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
149
171
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
}
|
|
156
|
-
const parent =
|
|
157
|
-
layer === root ? this.treeOutline.rootElement() : parentLayer && layerToTreeElement.get(parentLayer);
|
|
158
|
-
if (!parent) {
|
|
159
|
-
console.assert(false, 'Parent is not in the tree');
|
|
160
|
-
return;
|
|
161
|
-
}
|
|
162
|
-
if (!node) {
|
|
163
|
-
node = new LayerTreeElement(this, layer);
|
|
164
|
-
parent.appendChild(node);
|
|
165
|
-
// Expand all new non-content layers to expose content layers better.
|
|
166
|
-
if (!layer.drawsContent()) {
|
|
167
|
-
node.expand();
|
|
172
|
+
layerCount++;
|
|
173
|
+
totalLayerMemory += layer.gpuMemoryUsage();
|
|
174
|
+
|
|
175
|
+
if (layer === root) {
|
|
176
|
+
return;
|
|
168
177
|
}
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
+
|
|
179
|
+
let parentLayer = layer.parent();
|
|
180
|
+
// Skip till nearest visible ancestor.
|
|
181
|
+
while (parentLayer && parentLayer !== root && !parentLayer.drawsContent() && !showInternalLayers) {
|
|
182
|
+
parentLayer = parentLayer.parent();
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
if (parentLayer) {
|
|
186
|
+
let children = childrenMap.get(parentLayer);
|
|
187
|
+
if (!children) {
|
|
188
|
+
children = [];
|
|
189
|
+
childrenMap.set(parentLayer, children);
|
|
178
190
|
}
|
|
191
|
+
children.push(layer);
|
|
192
|
+
} else {
|
|
193
|
+
console.assert(false, 'Internal error: multiple root layers');
|
|
179
194
|
}
|
|
180
|
-
|
|
181
|
-
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
this.layerTree.forEachLayer(buildTree, root);
|
|
182
198
|
}
|
|
183
|
-
|
|
184
|
-
|
|
199
|
+
|
|
200
|
+
const syncNode =
|
|
201
|
+
(layer: SDK.LayerTreeBase.Layer, parent: UI.TreeOutline.TreeOutline|UI.TreeOutline.TreeElement): void => {
|
|
202
|
+
seenLayers.add(layer);
|
|
203
|
+
let node: LayerTreeElement|null = layerToTreeElement.get(layer) || null;
|
|
204
|
+
if (!node) {
|
|
205
|
+
node = new LayerTreeElement(this, layer);
|
|
206
|
+
parent.appendChild(node);
|
|
207
|
+
// Expand all new non-content layers to expose content layers better.
|
|
208
|
+
if (!layer.drawsContent()) {
|
|
209
|
+
node.expand();
|
|
210
|
+
}
|
|
211
|
+
} else {
|
|
212
|
+
if (node.parent !== parent) {
|
|
213
|
+
const oldSelection = this.treeOutline.selectedTreeElement;
|
|
214
|
+
if (node.parent) {
|
|
215
|
+
node.parent.removeChild(node);
|
|
216
|
+
}
|
|
217
|
+
parent.appendChild(node);
|
|
218
|
+
if (oldSelection && oldSelection !== this.treeOutline.selectedTreeElement) {
|
|
219
|
+
oldSelection.select();
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
node.update();
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
const children = childrenMap.get(layer) || [];
|
|
226
|
+
for (const child of children) {
|
|
227
|
+
syncNode(child, node);
|
|
228
|
+
}
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
if (root && (root.drawsContent() || showInternalLayers)) {
|
|
232
|
+
syncNode(root, this.treeOutline.rootElement());
|
|
185
233
|
}
|
|
234
|
+
|
|
186
235
|
// Clean up layers that don't exist anymore from tree.
|
|
187
236
|
const rootElement = this.treeOutline.rootElement();
|
|
188
237
|
for (let node = rootElement.firstChild(); node instanceof LayerTreeElement && !node.root;) {
|
|
189
|
-
if (seenLayers.
|
|
238
|
+
if (seenLayers.has(node.layer)) {
|
|
190
239
|
node = node.traverseNextTreeElement(false);
|
|
191
240
|
} else {
|
|
192
241
|
const nextNode = node.nextSibling || node.parent;
|
|
@@ -209,8 +258,9 @@ export class LayerTreeOutline extends Common.ObjectWrapper.eventMixin<EventTypes
|
|
|
209
258
|
}
|
|
210
259
|
}
|
|
211
260
|
|
|
212
|
-
this
|
|
213
|
-
this
|
|
261
|
+
this.#layerCount = layerCount;
|
|
262
|
+
this.#totalLayerMemory = totalLayerMemory;
|
|
263
|
+
this.requestUpdate();
|
|
214
264
|
}
|
|
215
265
|
|
|
216
266
|
private onMouseMove(event: MouseEvent): void {
|
|
@@ -120,7 +120,7 @@ export const DEFAULT_VIEW = (input: ViewInput, output: ViewOutput, target: HTMLE
|
|
|
120
120
|
uiI18n.getFormatLocalizedString(
|
|
121
121
|
str_, UIStrings.checkSForPossibleReasons,
|
|
122
122
|
{
|
|
123
|
-
PH1: Link.create('
|
|
123
|
+
PH1: Link.create('chrome://gpu', undefined, undefined, 'about-gpu', 0, true)
|
|
124
124
|
}
|
|
125
125
|
)
|
|
126
126
|
],
|
|
@@ -4,19 +4,26 @@
|
|
|
4
4
|
* found in the LICENSE file.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
@scope to (devtools-widget > *) {
|
|
8
|
+
.layer-summary {
|
|
9
|
+
border-top: 1px solid var(--sys-color-divider);
|
|
10
|
+
justify-content: space-between;
|
|
11
|
+
padding: 4px 10px;
|
|
12
|
+
flex-shrink: 0;
|
|
13
|
+
}
|
|
13
14
|
|
|
14
|
-
.layer-count {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
15
|
+
.layer-count {
|
|
16
|
+
white-space: nowrap;
|
|
17
|
+
overflow: hidden;
|
|
18
|
+
text-overflow: ellipsis;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.layer-tree-wrapper {
|
|
22
|
+
height: 100%;
|
|
23
|
+
flex-grow: 1;
|
|
24
|
+
}
|
|
19
25
|
|
|
20
|
-
.layer-tree
|
|
21
|
-
|
|
26
|
+
.layer-tree {
|
|
27
|
+
flex-grow: 1;
|
|
28
|
+
}
|
|
22
29
|
}
|
|
@@ -47,7 +47,7 @@ export class LayersPanel extends UI.Panel.PanelWithSidebar implements SDK.Target
|
|
|
47
47
|
this.layerTreeOutline = new LayerViewer.LayerTreeOutline.LayerTreeOutline(this.layerViewHost);
|
|
48
48
|
this.layerTreeOutline.addEventListener(
|
|
49
49
|
LayerViewer.LayerTreeOutline.Events.PAINT_PROFILER_REQUESTED, this.onPaintProfileRequested, this);
|
|
50
|
-
this.
|
|
50
|
+
this.layerTreeOutline.show(this.panelSidebarElement());
|
|
51
51
|
this.setDefaultFocusedElement(this.layerTreeOutline.element);
|
|
52
52
|
|
|
53
53
|
this.rightSplitWidget = new UI.SplitWidget.SplitWidget(false, true, 'layer-details-split-view-state');
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
6
6
|
import * as SDK from '../../core/sdk/sdk.js';
|
|
7
|
+
import * as PanelsCommon from '../common/common.js';
|
|
7
8
|
|
|
8
9
|
const UIStrings = {
|
|
9
10
|
/**
|
|
@@ -55,7 +56,7 @@ export class CalibrationController {
|
|
|
55
56
|
#runtimeModel!: SDK.RuntimeModel.RuntimeModel;
|
|
56
57
|
#emulationModel!: SDK.EmulationModel.EmulationModel;
|
|
57
58
|
#originalUrl!: string;
|
|
58
|
-
#result?:
|
|
59
|
+
#result?: PanelsCommon.CPUThrottlingOption.CalibratedCPUThrottling;
|
|
59
60
|
#state: 'idle'|'running'|'aborting' = 'idle';
|
|
60
61
|
|
|
61
62
|
/**
|
|
@@ -220,14 +221,14 @@ export class CalibrationController {
|
|
|
220
221
|
if (actualScore < midScore) {
|
|
221
222
|
if (actualScore < lowScore) {
|
|
222
223
|
this.#result = {
|
|
223
|
-
low:
|
|
224
|
-
mid:
|
|
224
|
+
low: PanelsCommon.CPUThrottlingOption.CalibrationError.DEVICE_TOO_WEAK,
|
|
225
|
+
mid: PanelsCommon.CPUThrottlingOption.CalibrationError.DEVICE_TOO_WEAK,
|
|
225
226
|
};
|
|
226
227
|
return;
|
|
227
228
|
}
|
|
228
229
|
|
|
229
230
|
// Can still emulate the low-end device.
|
|
230
|
-
this.#result = {mid:
|
|
231
|
+
this.#result = {mid: PanelsCommon.CPUThrottlingOption.CalibrationError.DEVICE_TOO_WEAK};
|
|
231
232
|
isHalfwayDone = true;
|
|
232
233
|
}
|
|
233
234
|
}
|
|
@@ -258,7 +259,7 @@ export class CalibrationController {
|
|
|
258
259
|
}
|
|
259
260
|
}
|
|
260
261
|
|
|
261
|
-
result():
|
|
262
|
+
result(): PanelsCommon.CPUThrottlingOption.CalibratedCPUThrottling|undefined {
|
|
262
263
|
return this.#result;
|
|
263
264
|
}
|
|
264
265
|
|
|
@@ -70,7 +70,7 @@ export class MobileThrottlingSelector {
|
|
|
70
70
|
this.populateOptions();
|
|
71
71
|
|
|
72
72
|
const networkConditions = SDK.NetworkManager.MultitargetNetworkManager.instance().networkConditions();
|
|
73
|
-
const cpuThrottlingOption =
|
|
73
|
+
const cpuThrottlingOption = throttlingManager().cpuThrottlingOption();
|
|
74
74
|
for (let index = 0; index < this.options.length; ++index) {
|
|
75
75
|
const option = this.options[index];
|
|
76
76
|
if (option && 'network' in option && option.network === networkConditions &&
|
|
@@ -11,6 +11,7 @@ import {Icon} from '../../ui/kit/kit.js';
|
|
|
11
11
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
12
12
|
import {html, render} from '../../ui/lit/lit.js';
|
|
13
13
|
import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
|
|
14
|
+
import * as PanelsCommon from '../common/common.js';
|
|
14
15
|
|
|
15
16
|
import {MobileThrottlingSelector} from './MobileThrottlingSelector.js';
|
|
16
17
|
import {
|
|
@@ -22,7 +23,7 @@ import {
|
|
|
22
23
|
|
|
23
24
|
export interface CPUThrottlingSelectorWrapper {
|
|
24
25
|
control: UI.Toolbar.ToolbarComboBox;
|
|
25
|
-
updateRecommendedOption(recommendedOption:
|
|
26
|
+
updateRecommendedOption(recommendedOption: PanelsCommon.CPUThrottlingOption.CPUThrottlingOption|null): void;
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
const UIStrings = {
|
|
@@ -109,15 +110,17 @@ class PromiseQueue<T> {
|
|
|
109
110
|
|
|
110
111
|
export class ThrottlingManager extends Common.ObjectWrapper.ObjectWrapper<ThrottlingManager.EventTypes> {
|
|
111
112
|
private readonly cpuThrottlingControls: Set<UI.Toolbar.ToolbarComboBox>;
|
|
112
|
-
private readonly cpuThrottlingOptions:
|
|
113
|
+
private readonly cpuThrottlingOptions: PanelsCommon.CPUThrottlingOption.CPUThrottlingOption[];
|
|
113
114
|
private readonly customNetworkConditionsSetting: Common.Settings.Setting<SDK.NetworkManager.Conditions[]>;
|
|
114
115
|
private readonly currentNetworkThrottlingConditionKeySetting:
|
|
115
116
|
Common.Settings.Setting<SDK.NetworkManager.ThrottlingConditionKey>;
|
|
116
117
|
private readonly calibratedCpuThrottlingSetting:
|
|
117
|
-
Common.Settings.Setting<
|
|
118
|
+
Common.Settings.Setting<PanelsCommon.CPUThrottlingOption.CalibratedCPUThrottling>;
|
|
118
119
|
private lastNetworkThrottlingConditions!: SDK.NetworkManager.Conditions;
|
|
119
120
|
private readonly cpuThrottlingManager: SDK.CPUThrottlingManager.CPUThrottlingManager;
|
|
120
121
|
#hardwareConcurrencyOverrideEnabled = false;
|
|
122
|
+
#currentCPUThrottlingOption: PanelsCommon.CPUThrottlingOption.CPUThrottlingOption =
|
|
123
|
+
PanelsCommon.CPUThrottlingOption.NoThrottlingOption;
|
|
121
124
|
readonly #emulationQueue = new PromiseQueue<void>();
|
|
122
125
|
get hardwareConcurrencyOverrideEnabled(): boolean {
|
|
123
126
|
return this.#hardwareConcurrencyOverrideEnabled;
|
|
@@ -136,8 +139,9 @@ export class ThrottlingManager extends Common.ObjectWrapper.ObjectWrapper<Thrott
|
|
|
136
139
|
this.currentNetworkThrottlingConditionKeySetting = SDK.NetworkManager.activeNetworkThrottlingKeySetting();
|
|
137
140
|
|
|
138
141
|
this.calibratedCpuThrottlingSetting =
|
|
139
|
-
Common.Settings.Settings.instance().createSetting<
|
|
142
|
+
Common.Settings.Settings.instance().createSetting<PanelsCommon.CPUThrottlingOption.CalibratedCPUThrottling>(
|
|
140
143
|
'calibrated-cpu-throttling', {}, Common.Settings.SettingStorageType.GLOBAL);
|
|
144
|
+
this.calibratedCpuThrottlingSetting.addChangeListener(this.onCalibratedSettingChanged, this);
|
|
141
145
|
|
|
142
146
|
SDK.NetworkManager.MultitargetNetworkManager.instance().addEventListener(
|
|
143
147
|
SDK.NetworkManager.MultitargetNetworkManager.Events.CONDITIONS_CHANGED, () => {
|
|
@@ -250,23 +254,46 @@ export class ThrottlingManager extends Common.ObjectWrapper.ObjectWrapper<Thrott
|
|
|
250
254
|
|
|
251
255
|
private updatePanelIcon(): void {
|
|
252
256
|
const warnings = [];
|
|
253
|
-
if (this.cpuThrottlingManager.cpuThrottlingRate() !==
|
|
257
|
+
if (this.cpuThrottlingManager.cpuThrottlingRate() !==
|
|
258
|
+
PanelsCommon.CPUThrottlingOption.CPUThrottlingRates.NO_THROTTLING) {
|
|
254
259
|
warnings.push(i18nString(UIStrings.cpuThrottlingIsEnabled));
|
|
255
260
|
}
|
|
256
261
|
UI.InspectorView.InspectorView.instance().setPanelWarnings('timeline', warnings);
|
|
257
262
|
}
|
|
258
263
|
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
264
|
+
cpuThrottlingOption(): PanelsCommon.CPUThrottlingOption.CPUThrottlingOption {
|
|
265
|
+
return this.#currentCPUThrottlingOption;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
setCPUThrottlingOption(option: PanelsCommon.CPUThrottlingOption.CPUThrottlingOption): void {
|
|
269
|
+
if (this.#currentCPUThrottlingOption === option) {
|
|
270
|
+
return;
|
|
271
|
+
}
|
|
272
|
+
this.#currentCPUThrottlingOption = option;
|
|
273
|
+
this.cpuThrottlingManager.setCPUThrottlingRate(option.rate());
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
private onCalibratedSettingChanged(): void {
|
|
277
|
+
if (!this.#currentCPUThrottlingOption.calibratedDeviceType) {
|
|
278
|
+
return;
|
|
279
|
+
}
|
|
280
|
+
const rate = this.#currentCPUThrottlingOption.rate();
|
|
281
|
+
if (rate === 0) {
|
|
282
|
+
this.setCPUThrottlingOption(PanelsCommon.CPUThrottlingOption.NoThrottlingOption);
|
|
283
|
+
return;
|
|
284
|
+
}
|
|
285
|
+
this.cpuThrottlingManager.setCPUThrottlingRate(rate);
|
|
262
286
|
}
|
|
263
287
|
|
|
264
288
|
onCPUThrottlingRateChangedOnSDK(rate: number): void {
|
|
265
|
-
if (rate !==
|
|
289
|
+
if (rate !== PanelsCommon.CPUThrottlingOption.CPUThrottlingRates.NO_THROTTLING) {
|
|
266
290
|
Host.userMetrics.actionTaken(Host.UserMetrics.Action.CpuThrottlingEnabled);
|
|
267
291
|
}
|
|
268
292
|
|
|
269
|
-
const
|
|
293
|
+
const option = PanelsCommon.CPUThrottlingOption.determineOptionFromRate(rate, this.#currentCPUThrottlingOption);
|
|
294
|
+
this.#currentCPUThrottlingOption = option;
|
|
295
|
+
|
|
296
|
+
const index = this.cpuThrottlingOptions.indexOf(option);
|
|
270
297
|
for (const control of this.cpuThrottlingControls) {
|
|
271
298
|
control.setSelectedIndex(index);
|
|
272
299
|
}
|
|
@@ -282,7 +309,7 @@ export class ThrottlingManager extends Common.ObjectWrapper.ObjectWrapper<Thrott
|
|
|
282
309
|
|
|
283
310
|
const optionSelected = (): void => {
|
|
284
311
|
if (control.selectedIndex() === control.options().length - 1) {
|
|
285
|
-
const index = this.cpuThrottlingOptions.indexOf(this
|
|
312
|
+
const index = this.cpuThrottlingOptions.indexOf(this.#currentCPUThrottlingOption);
|
|
286
313
|
control.setSelectedIndex(index);
|
|
287
314
|
void Common.Revealer.reveal(this.calibratedCpuThrottlingSetting);
|
|
288
315
|
} else {
|
|
@@ -293,7 +320,7 @@ export class ThrottlingManager extends Common.ObjectWrapper.ObjectWrapper<Thrott
|
|
|
293
320
|
const control =
|
|
294
321
|
new UI.Toolbar.ToolbarComboBox(optionSelected, i18nString(UIStrings.cpuThrottling), '', 'cpu-throttling');
|
|
295
322
|
this.cpuThrottlingControls.add(control);
|
|
296
|
-
const currentOption = this
|
|
323
|
+
const currentOption = this.#currentCPUThrottlingOption;
|
|
297
324
|
|
|
298
325
|
const optionEls: HTMLOptionElement[] = [];
|
|
299
326
|
const options = this.cpuThrottlingOptions;
|
|
@@ -317,7 +344,7 @@ export class ThrottlingManager extends Common.ObjectWrapper.ObjectWrapper<Thrott
|
|
|
317
344
|
|
|
318
345
|
return {
|
|
319
346
|
control,
|
|
320
|
-
updateRecommendedOption(recommendedOption:
|
|
347
|
+
updateRecommendedOption(recommendedOption: PanelsCommon.CPUThrottlingOption.CPUThrottlingOption|null) {
|
|
321
348
|
for (let i = 0; i < optionEls.length - 1; i++) {
|
|
322
349
|
const option = options[i];
|
|
323
350
|
optionEls[i].text = option === recommendedOption ?
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
6
6
|
import * as SDK from '../../core/sdk/sdk.js';
|
|
7
|
+
import * as PanelsCommon from '../common/common.js';
|
|
7
8
|
|
|
8
9
|
const UIStrings = {
|
|
9
10
|
/**
|
|
@@ -61,7 +62,7 @@ export class ThrottlingPresets {
|
|
|
61
62
|
title,
|
|
62
63
|
description: i18nString(UIStrings.noThrottling),
|
|
63
64
|
network: SDK.NetworkManager.NoThrottlingConditions,
|
|
64
|
-
cpuThrottlingOption:
|
|
65
|
+
cpuThrottlingOption: PanelsCommon.CPUThrottlingOption.NoThrottlingOption,
|
|
65
66
|
jslogContext: 'no-throttling',
|
|
66
67
|
};
|
|
67
68
|
}
|
|
@@ -74,15 +75,16 @@ export class ThrottlingPresets {
|
|
|
74
75
|
title,
|
|
75
76
|
description: i18nString(UIStrings.noInternetConnectivity),
|
|
76
77
|
network: SDK.NetworkManager.OfflineConditions,
|
|
77
|
-
cpuThrottlingOption:
|
|
78
|
+
cpuThrottlingOption: PanelsCommon.CPUThrottlingOption.NoThrottlingOption,
|
|
78
79
|
jslogContext: 'offline',
|
|
79
80
|
};
|
|
80
81
|
}
|
|
81
82
|
|
|
82
83
|
static getLowEndMobileConditions(): Conditions {
|
|
83
|
-
const useCalibrated =
|
|
84
|
-
const cpuThrottlingOption = useCalibrated ?
|
|
85
|
-
|
|
84
|
+
const useCalibrated = PanelsCommon.CPUThrottlingOption.CalibratedLowTierMobileThrottlingOption.rate() !== 0;
|
|
85
|
+
const cpuThrottlingOption = useCalibrated ?
|
|
86
|
+
PanelsCommon.CPUThrottlingOption.CalibratedLowTierMobileThrottlingOption :
|
|
87
|
+
PanelsCommon.CPUThrottlingOption.LowTierThrottlingOption;
|
|
86
88
|
const description = useCalibrated ?
|
|
87
89
|
i18nString(UIStrings.slowGXCpuSlowdownCalibrated, {PH1: cpuThrottlingOption.rate()}) :
|
|
88
90
|
i18nString(UIStrings.slowGXCpuSlowdown);
|
|
@@ -97,9 +99,10 @@ export class ThrottlingPresets {
|
|
|
97
99
|
}
|
|
98
100
|
|
|
99
101
|
static getMidTierMobileConditions(): Conditions {
|
|
100
|
-
const useCalibrated =
|
|
101
|
-
const cpuThrottlingOption = useCalibrated ?
|
|
102
|
-
|
|
102
|
+
const useCalibrated = PanelsCommon.CPUThrottlingOption.CalibratedMidTierMobileThrottlingOption.rate() !== 0;
|
|
103
|
+
const cpuThrottlingOption = useCalibrated ?
|
|
104
|
+
PanelsCommon.CPUThrottlingOption.CalibratedMidTierMobileThrottlingOption :
|
|
105
|
+
PanelsCommon.CPUThrottlingOption.MidTierThrottlingOption;
|
|
103
106
|
const description = useCalibrated ?
|
|
104
107
|
i18nString(UIStrings.fastGXCpuSlowdownCalibrated, {PH1: cpuThrottlingOption.rate()}) :
|
|
105
108
|
i18nString(UIStrings.fastGXCpuSlowdown);
|
|
@@ -142,14 +145,7 @@ export class ThrottlingPresets {
|
|
|
142
145
|
SDK.NetworkManager.OfflineConditions,
|
|
143
146
|
];
|
|
144
147
|
|
|
145
|
-
static cpuThrottlingPresets
|
|
146
|
-
SDK.CPUThrottlingManager.NoThrottlingOption,
|
|
147
|
-
SDK.CPUThrottlingManager.MidTierThrottlingOption,
|
|
148
|
-
SDK.CPUThrottlingManager.LowTierThrottlingOption,
|
|
149
|
-
SDK.CPUThrottlingManager.ExtraSlowThrottlingOption,
|
|
150
|
-
SDK.CPUThrottlingManager.CalibratedLowTierMobileThrottlingOption,
|
|
151
|
-
SDK.CPUThrottlingManager.CalibratedMidTierMobileThrottlingOption,
|
|
152
|
-
];
|
|
148
|
+
static cpuThrottlingPresets = PanelsCommon.CPUThrottlingOption.cpuThrottlingPresets;
|
|
153
149
|
}
|
|
154
150
|
|
|
155
151
|
// @ts-expect-error exported for Tests.js
|
|
@@ -161,7 +157,7 @@ export interface Conditions {
|
|
|
161
157
|
title: string;
|
|
162
158
|
description: string;
|
|
163
159
|
network: SDK.NetworkManager.Conditions;
|
|
164
|
-
cpuThrottlingOption:
|
|
160
|
+
cpuThrottlingOption: PanelsCommon.CPUThrottlingOption.CPUThrottlingOption;
|
|
165
161
|
jslogContext?: string;
|
|
166
162
|
}
|
|
167
163
|
|