0

Map WebDXFeature use counters for Fugu

This CL maps existing counters that are representative of the feature
usage:
- app-file-handlers: WebDXFeatures::kAppFileHandlers is recorded when
launch files are set in the web_launch_service_impl.cc

- app-protocol-handlers: WebDXFeatures::kAppProtocolHandlers is
recorded if the manifest's protocol handler is not empty. Found in the
manifest_manager.cc

- badging: WebDXFeatures::kBadging is recorded when installed web
applications display an application badge. This feature is used in
navigator_badge.cc when setAppBadge() is called.

- manifest: WebDXFeatures::kManifest is recorded when any manifest
metadata about a site is collected. Aside from the name, icon, and
descriptions, this also includes ways in which the app wishes to
integrate with the device.
More info:
https://github.com/web-platform-dx/web
features/blob/main/features/manifest.yml

- beforeInstallPrompt: WebDXFeatures::kBeforeInstallPrompt is
recorded when an event prompt shows up and is completed for a
site that is installable as a PWA.

Change-Id: I069ac1eb8abc2b71ddb800c44b05cc56f218cdae
Bug: 379953791
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6299834
Commit-Queue: May Siem <msiem@chromium.org>
Reviewed-by: Dibyajyoti Pal <dibyapal@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1424277}
This commit is contained in:
msiem
2025-02-24 18:34:53 -08:00
committed by Chromium LUCI CQ
parent fe19fbb00c
commit 004786a4bc
3 changed files with 37 additions and 0 deletions
components/page_load_metrics/browser/observers/use_counter
third_party/blink/public/mojom/use_counter/metrics
tools/metrics/histograms/metadata/blink

@ -348,6 +348,33 @@ UseCounterMetricsRecorder::GetWebFeatureToWebDXFeatureMap() {
{WebFeature::kScrollMarkerPseudoElement,
WebDXFeature::kScrollMarkers},
{WebFeature::kPopoverTypeHint, WebDXFeature::kDRAFT_PopoverHint},
{WebFeature::kFileHandlingLaunch, WebDXFeature::kAppFileHandlers},
{WebFeature::kWebAppManifestProtocolHandlers,
WebDXFeature::kAppProtocolHandlers},
{WebFeature::kBadgeSetWithoutNotificationPermissionInBrowserWindow,
WebDXFeature::kBadging},
{WebFeature::kBadgeSetWithoutNotificationPermissionInAppWindow,
WebDXFeature::kBadging},
{WebFeature::kBadgeSetWithoutNotificationPermissionInWorker,
WebDXFeature::kBadging},
{WebFeature::kWebAppManifestCaptureLinks, WebDXFeature::kManifest},
{WebFeature::kWebAppManifestHasComments, WebDXFeature::kManifest},
{WebFeature::kWebAppManifestLaunchHandler, WebDXFeature::kManifest},
{WebFeature::kWebAppManifestScopeExtensions, WebDXFeature::kManifest},
{WebFeature::kWebAppManifestIdField, WebDXFeature::kManifest},
{WebFeature::kWebAppWindowControlsOverlay, WebDXFeature::kManifest},
{WebFeature::kWebAppBorderless, WebDXFeature::kManifest},
{WebFeature::kWebAppTabbed, WebDXFeature::kManifest},
{WebFeature::kBeforeInstallPromptEvent,
WebDXFeature::kBeforeInstallPrompt},
{WebFeature::kBeforeInstallPromptEventUserChoice,
WebDXFeature::kBeforeInstallPrompt},
{WebFeature::kBeforeInstallPromptEventPreventDefault,
WebDXFeature::kBeforeInstallPrompt},
{WebFeature::kBeforeInstallPromptEventPrompt,
WebDXFeature::kBeforeInstallPrompt},
{WebFeature::kV8BeforeInstallPromptEvent_Platforms_AttributeGetter,
WebDXFeature::kBeforeInstallPrompt},
}};
return *kMap;

@ -354,6 +354,11 @@ enum WebDXFeature {
kDRAFT_PopoverHint = 296,
kDRAFT_RegExpEscape = 297,
kFloat16array = 298,
kAppFileHandlers = 299,
kAppProtocolHandlers = 300,
kBadging = 301,
kManifest = 302,
kBeforeInstallPrompt = 303,
// Add new features immediately above this line. Don't change assigned
// numbers of any item, and don't reuse removed slots.

@ -7853,6 +7853,11 @@ Called by update_use_counter_feature_enum.py.-->
<int value="296" label="DRAFT_PopoverHint"/>
<int value="297" label="DRAFT_RegExpEscape"/>
<int value="298" label="Float16array"/>
<int value="299" label="AppFileHandlers"/>
<int value="300" label="AppProtocolHandlers"/>
<int value="301" label="Badging"/>
<int value="302" label="Manifest"/>
<int value="303" label="BeforeInstallPrompt"/>
</enum>
<!-- LINT.ThenChange(//third_party/blink/public/mojom/use_counter/metrics/webdx_feature.mojom:WebDXFeature) -->