Commit 25c8ab04 authored by John Delaney's avatar John Delaney Committed by Commit Bot

Add UseCounter for an ad being on a page

What:
New UseCounter to tracker % of page loads that have an ad.

Why:
This metric is useful for knowing how many pageloads are applicable
for ad interventions, such as the heavy ad intervention.

Bug: 1139434
Change-Id: I8e6e1b9b6aa60afcd4d58c331c00a3b9bcf6523e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2480967
Commit-Queue: John Delaney <johnidel@chromium.org>
Reviewed-by: default avatarNate Chapin <japhet@chromium.org>
Reviewed-by: default avatarAlex Turner <alexmt@chromium.org>
Cr-Commit-Position: refs/heads/master@{#825048}
parent dd29c6a1
......@@ -3053,6 +3053,7 @@ enum WebFeature {
kXRFrameGetLightEstimate = 3724,
kV8HTMLDialogElement_Show_Method = 3725,
kV8HTMLDialogElement_ShowModal_Method = 3726,
kAdFrameDetected = 3727,
// Add new features immediately above this line. Don't change assigned
// numbers of any item, and don't reuse removed slots.
......
......@@ -2050,6 +2050,8 @@ void LocalFrame::SetIsAdSubframe(blink::mojom::AdFrameType ad_frame_type) {
ad_frame_type_ = ad_frame_type;
UpdateAdHighlight();
frame_scheduler_->SetIsAdFrame();
UseCounter::Count(DomWindow(), WebFeature::kAdFrameDetected);
InstanceCounters::IncrementCounter(InstanceCounters::kAdSubframeCounter);
}
......
......@@ -30175,6 +30175,7 @@ Called by update_use_counter_feature_enum.py.-->
<int value="3724" label="XRFrameGetLightEstimate"/>
<int value="3725" label="V8HTMLDialogElement_Show_Method"/>
<int value="3726" label="V8HTMLDialogElement_ShowModal_Method"/>
<int value="3727" label="AdFrameDetected"/>
</enum>
<enum name="FeaturePolicyAllowlistType">
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