Commit 68098faa authored by Martin Kreichgauer's avatar Martin Kreichgauer Committed by Commit Bot

blink: add a use counter for WebAuthn isUVPAA() invocations

This adds a use counter for calls to
PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable(). The
counter's name is prefixed with `kCredentialManager` for consistency
with other WebAuthn related metrics.

Fixed: 1018318
Change-Id: I2ba0e96a37405b7774259c09eb34c534ee43f640
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1880319
Commit-Queue: Martin Kreichgauer <martinkr@google.com>
Auto-Submit: Martin Kreichgauer <martinkr@google.com>
Reviewed-by: default avatarAdam Langley <agl@chromium.org>
Cr-Commit-Position: refs/heads/master@{#710056}
parent 8188acfc
...@@ -2455,6 +2455,7 @@ enum WebFeature { ...@@ -2455,6 +2455,7 @@ enum WebFeature {
kDOMWindowOpenPositioningFeatures = 3071, kDOMWindowOpenPositioningFeatures = 3071,
kMouseEventScreenX = 3072, kMouseEventScreenX = 3072,
kMouseEventScreenY = 3073, kMouseEventScreenY = 3073,
kCredentialManagerIsUserVerifyingPlatformAuthenticatorAvailable = 3074,
// Add new features immediately above this line. Don't change assigned // Add new features immediately above this line. Don't change assigned
// numbers of any item, and don't reuse removed slots. // numbers of any item, and don't reuse removed slots.
......
...@@ -7,9 +7,11 @@ ...@@ -7,9 +7,11 @@
#include "third_party/blink/renderer/bindings/core/v8/script_promise.h" #include "third_party/blink/renderer/bindings/core/v8/script_promise.h"
#include "third_party/blink/renderer/bindings/core/v8/script_promise_resolver.h" #include "third_party/blink/renderer/bindings/core/v8/script_promise_resolver.h"
#include "third_party/blink/renderer/core/dom/dom_exception.h" #include "third_party/blink/renderer/core/dom/dom_exception.h"
#include "third_party/blink/renderer/core/frame/web_feature.h"
#include "third_party/blink/renderer/modules/credentialmanager/credential_manager_proxy.h" #include "third_party/blink/renderer/modules/credentialmanager/credential_manager_proxy.h"
#include "third_party/blink/renderer/modules/credentialmanager/scoped_promise_resolver.h" #include "third_party/blink/renderer/modules/credentialmanager/scoped_promise_resolver.h"
#include "third_party/blink/renderer/platform/bindings/script_state.h" #include "third_party/blink/renderer/platform/bindings/script_state.h"
#include "third_party/blink/renderer/platform/instrumentation/use_counter.h"
#include "third_party/blink/renderer/platform/wtf/functional.h" #include "third_party/blink/renderer/platform/wtf/functional.h"
namespace blink { namespace blink {
...@@ -49,6 +51,11 @@ PublicKeyCredential::isUserVerifyingPlatformAuthenticatorAvailable( ...@@ -49,6 +51,11 @@ PublicKeyCredential::isUserVerifyingPlatformAuthenticatorAvailable(
return promise; return promise;
} }
UseCounter::Count(
resolver->GetExecutionContext(),
WebFeature::
kCredentialManagerIsUserVerifyingPlatformAuthenticatorAvailable);
auto* authenticator = auto* authenticator =
CredentialManagerProxy::From(script_state)->Authenticator(); CredentialManagerProxy::From(script_state)->Authenticator();
authenticator->IsUserVerifyingPlatformAuthenticatorAvailable(WTF::Bind( authenticator->IsUserVerifyingPlatformAuthenticatorAvailable(WTF::Bind(
......
...@@ -25196,6 +25196,8 @@ Called by update_net_error_codes.py.--> ...@@ -25196,6 +25196,8 @@ Called by update_net_error_codes.py.-->
<int value="3071" label="DOMWindowOpenPositioningFeatures"/> <int value="3071" label="DOMWindowOpenPositioningFeatures"/>
<int value="3072" label="MouseEventScreenX"/> <int value="3072" label="MouseEventScreenX"/>
<int value="3073" label="MouseEventScreenY"/> <int value="3073" label="MouseEventScreenY"/>
<int value="3074"
label="CredentialManagerIsUserVerifyingPlatformAuthenticatorAvailable"/>
</enum> </enum>
<enum name="FeaturePolicyAllowlistType"> <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