Commit e92e2156 authored by Titouan Rigoudy's avatar Titouan Rigoudy Committed by Commit Bot

[CORS-RFC1918] Add WebFeatures to UKM allowlist.

These will be used to determine the path forward to an eventual removal
of the feature in the NonSecure case, and a rollout of CORS-RFC1918 in
the Secure case.

These features are not yet recorded, but we know that the event rate
will not exceed 1% of page loads. Indeed these features are
finer-grained replacements for the now-obsolete
LoopbackEmbeddedIn{Non,}SecureContext feature, which average less than
0.003% combined on Windows Stable.

Bug: chromium:1124358
Change-Id: Ie53327654907d4b3ee8d88b91cceb957a8640602
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2436823Reviewed-by: default avatarJohn Delaney <johnidel@chromium.org>
Reviewed-by: default avatarJesse Doherty <jwd@chromium.org>
Reviewed-by: default avatarMike West <mkwst@chromium.org>
Commit-Queue: Jesse Doherty <jwd@chromium.org>
Auto-Submit: Titouan Rigoudy <titouan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#812357}
parent 7f55aad9
......@@ -1642,7 +1642,7 @@ IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTest,
const auto& entries = test_ukm_recorder_->GetEntriesByName(
ukm::builders::Blink_UseCounter::kEntryName);
EXPECT_EQ(4u, entries.size());
EXPECT_EQ(5u, entries.size());
std::vector<int64_t> ukm_features;
for (const auto* entry : entries) {
test_ukm_recorder_->ExpectEntrySourceHasUrl(entry, url);
......@@ -1660,7 +1660,10 @@ IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTest,
static_cast<int64_t>(WebFeature::kFullscreenSecureOrigin),
static_cast<int64_t>(WebFeature::kNavigatorVibrate),
static_cast<int64_t>(
WebFeature::kApplicationCacheManifestSelectSecureOrigin)));
WebFeature::kApplicationCacheManifestSelectSecureOrigin),
static_cast<int64_t>(
WebFeature::
kAddressSpaceLocalEmbeddedInUnknownNonSecureContext)));
}
// Test UseCounter UKM mixed content features observed.
......@@ -1683,7 +1686,7 @@ IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTestWithAutoupgradesDisabled,
const auto& entries = test_ukm_recorder_->GetEntriesByName(
ukm::builders::Blink_UseCounter::kEntryName);
EXPECT_EQ(7u, entries.size());
EXPECT_EQ(8u, entries.size());
std::vector<int64_t> ukm_features;
for (const auto* entry : entries) {
test_ukm_recorder_->ExpectEntrySourceHasUrl(entry, url);
......@@ -1694,16 +1697,20 @@ IN_PROC_BROWSER_TEST_F(PageLoadMetricsBrowserTestWithAutoupgradesDisabled,
DCHECK(metric);
ukm_features.push_back(*metric);
}
EXPECT_THAT(ukm_features,
UnorderedElementsAre(
static_cast<int64_t>(WebFeature::kPageVisits),
static_cast<int64_t>(WebFeature::kFullscreenSecureOrigin),
static_cast<int64_t>(WebFeature::kNavigatorVibrate),
static_cast<int64_t>(
WebFeature::kApplicationCacheManifestSelectSecureOrigin),
static_cast<int64_t>(WebFeature::kMixedContentImage),
static_cast<int64_t>(WebFeature::kMixedContentAudio),
static_cast<int64_t>(WebFeature::kMixedContentVideo)));
EXPECT_THAT(
ukm_features,
UnorderedElementsAre(
static_cast<int64_t>(WebFeature::kPageVisits),
static_cast<int64_t>(WebFeature::kFullscreenSecureOrigin),
static_cast<int64_t>(WebFeature::kNavigatorVibrate),
static_cast<int64_t>(
WebFeature::kApplicationCacheManifestSelectSecureOrigin),
static_cast<int64_t>(WebFeature::kMixedContentImage),
static_cast<int64_t>(WebFeature::kMixedContentAudio),
static_cast<int64_t>(WebFeature::kMixedContentVideo),
static_cast<int64_t>(
WebFeature::
kAddressSpaceLocalEmbeddedInUnknownNonSecureContext)));
}
// Test UseCounter Features observed in a child frame are recorded, exactly
......
......@@ -169,6 +169,16 @@ UseCounterPageLoadMetricsObserver::GetAllowedUkmFeatures() {
WebFeature::kSchemelesslySameSitePostMessageSecureToInsecure,
WebFeature::kSchemelesslySameSitePostMessageInsecureToSecure,
WebFeature::kElementAttachInternalsBeforeConstructor,
WebFeature::kAddressSpaceLocalEmbeddedInPrivateSecureContext,
WebFeature::kAddressSpaceLocalEmbeddedInPrivateNonSecureContext,
WebFeature::kAddressSpaceLocalEmbeddedInPublicSecureContext,
WebFeature::kAddressSpaceLocalEmbeddedInPublicNonSecureContext,
WebFeature::kAddressSpaceLocalEmbeddedInUnknownSecureContext,
WebFeature::kAddressSpaceLocalEmbeddedInUnknownNonSecureContext,
WebFeature::kAddressSpacePrivateEmbeddedInPublicSecureContext,
WebFeature::kAddressSpacePrivateEmbeddedInPublicNonSecureContext,
WebFeature::kAddressSpacePrivateEmbeddedInUnknownSecureContext,
WebFeature::kAddressSpacePrivateEmbeddedInUnknownNonSecureContext,
}));
return *opt_in_features;
}
\ No newline at end of file
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment