Commit 37f4d491 authored by Dylan Cutler's avatar Dylan Cutler Committed by Commit Bot

Clean up implementation of Dactyloscoper::RecordDirectSurface.

The clean-up is based on the comments left by japhet@ on

https://chromium-review.googlesource.com/c/chromium/src/+/2276401

Bug: None
Change-Id: Ifa6744a4299383bad5089589a93b1c99cb40ddc0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2284400Reviewed-by: default avatarNate Chapin <japhet@chromium.org>
Commit-Queue: Dylan Cutler <dylancutler@google.com>
Cr-Commit-Position: refs/heads/master@{#786053}
parent 1bdb1557
......@@ -34,16 +34,13 @@ void Dactyloscoper::Record(ExecutionContext* context, WebFeature feature) {
void Dactyloscoper::RecordDirectSurface(ExecutionContext* context,
WebFeature feature,
unsigned value) {
if (!context)
return;
auto* window = DynamicTo<LocalDOMWindow>(context);
if (!window)
return;
if (Document* document = window->document()) {
IdentifiabilityMetricBuilder(document->UkmSourceID())
.SetWebfeature(feature, value)
.Record(document->UkmRecorder());
}
Document* document = window->document();
IdentifiabilityMetricBuilder(document->UkmSourceID())
.SetWebfeature(feature, value)
.Record(document->UkmRecorder());
}
void Dactyloscoper::RecordDirectSurface(ExecutionContext* context,
......
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