<!--
Copyright 2020 The Chromium Authors
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->

<!--
This file is used to generate a comprehensive list of SBClient histograms
along with a detailed description for each histogram.

For best practices on writing histogram descriptions, see
https://chromium.googlesource.com/chromium/src.git/+/HEAD/tools/metrics/histograms/README.md

Please follow the instructions in the OWNERS file in this directory to find a
reviewer. If no OWNERS file exists, please consider signing up at
go/reviewing-metrics (Googlers only), as all subdirectories are expected to
have an OWNERS file. As a last resort you can send the CL to
chromium-metrics-reviews@google.com.
-->

<histogram-configuration>

<histograms>

<!-- LINT.IfChange(ClassifierRequestType) -->

<variants name="ClassifierRequestType">
  <variant name="" summary="all request types"/>
  <variant name=".ClipboardCopyApi" summary="Clipboard copy API"/>
  <variant name=".CreditCardForm" summary="Credit Card Form"/>
  <variant name=".ForceRequest" summary="Force request"/>
  <variant name=".FullscreenApi" summary="Fullscreen API"/>
  <variant name=".ImageEmbeddingMatch" summary="Image embedding matched"/>
  <variant name=".KeyboardLockRequested" summary="Keyboard lock requested"/>
  <variant name=".NotificationPermissionPrompt"
      summary="Notification permission prompt"/>
  <variant name=".PasswordProtection" summary="Password protection requested"/>
  <variant name=".PointerLockRequested" summary="Pointer lock requested"/>
  <variant name=".TriggerModel" summary="Trigger model"/>
  <variant name=".UnfamiliarLoginPage" summary="Unfamiliar login page"/>
  <variant name=".UserReport" summary="User report"/>
  <variant name=".VibrationApi" summary="Vibration API"/>
</variants>

<!-- LINT.ThenChange(//components/safe_browsing/content/common/safe_browsing.mojom:ClientSideDetectionType) -->

<variants name="ClientSideDetectionIntelligentScanRequestType">
  <variant name="" summary="all request types"/>
  <variant name=".ForceRequest" summary="Force request"/>
  <variant name=".ImageEmbeddingMatch" summary="Image embedding matched"/>
  <variant name=".KeyboardLockRequested" summary="Keyboard lock requested"/>
</variants>

<!-- LINT.IfChange(ClientSideDetectionRequestType) -->

<variants name="ClientSideDetectionRequestType">
  <variant name="" summary="all request types"/>
  <variant name=".ClipboardCopyApi" summary="Clipboard copy API"/>
  <variant name=".CreditCardForm" summary="Credit Card Form"/>
  <variant name=".ForceRequest" summary="Force request"/>
  <variant name=".FullscreenApi" summary="Fullscreen API"/>
  <variant name=".ImageEmbeddingMatch" summary="Image embedding matched"/>
  <variant name=".KeyboardLockRequested" summary="Keyboard lock requested"/>
  <variant name=".NotificationPermissionPrompt"
      summary="Notification permission prompt"/>
  <variant name=".PointerLockRequested" summary="Pointer lock requested"/>
  <variant name=".TriggerModel" summary="Trigger model"/>
  <variant name=".UnfamiliarLoginPage" summary="Unfamiliar login page"/>
  <variant name=".Unknown" summary="Unknown"/>
  <variant name=".UserReport" summary="User report"/>
  <variant name=".VibrationApi" summary="Vibration API"/>
</variants>

<!-- LINT.ThenChange(//components/safe_browsing/core/common/proto/csd.proto:ClientSideDetectionType) -->

<variants name="DownloadDangerTypeForBypassMetrics">
  <variant name="DangerousFileType" summary="dangerous file type"/>
  <variant name="Malicious" summary="malicious content"/>
  <variant name="Others" summary="other danger types"/>
  <variant name="Safe" summary="content is safe"/>
  <variant name="Uncommon" summary="uncommon content"/>
</variants>

<variants name="DownloadWarningAction">
  <variant name="Bypassed" summary="bypassed"/>
  <variant name="Shown" summary="shown"/>
</variants>

<histogram name="SBClientDownload.Android.DownloadProtectionOutcome"
    enum="SBClientDownloadAndroidDownloadProtectionOutcome"
    expires_after="2027-01-17">
  <owner>yawfrempong@google.com</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records the outcome of a download on Android, with respect to Safe Browsing
    download protection, up until the point of sending a ClientDownloadRequest.
    This is logged exactly once per download for any download on Android,
    regardless of Safe Browsing state. This does not record the outcome of the
    ClientDownloadRequest itself, or the actual verdict if a
    ClientDownloadResponse was received.
  </summary>
</histogram>

<histogram name="SBClientDownload.Android.GetReferringAppInfo.Result"
    enum="SafeBrowsingAndroidGetReferringAppInfoResult"
    expires_after="2027-02-07">
  <owner>yawfrempong@google.com</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records the result of getting the referring app info for a download
    protection ClientDownloadRequest sent on Android. This is recorded after the
    request is finalized but before it is sent.
  </summary>
</histogram>

<histogram name="SBClientDownload.AutoOpen{State}FileType"
    enum="SBClientDownloadExtensions" expires_after="2026-11-03">
  <owner>drubery@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records the extension of files downloaded with auto-open {State}. This can
    be used to decide the impact of changing the `auto_open_hint` in the file
    type policy. It is logged on every successful download.
  </summary>
  <token key="State">
    <variant name="Disabled" summary="disabled"/>
    <variant name="Enabled" summary="enabled"/>
  </token>
</histogram>

<histogram name="SBClientDownload.CancelEphemeralWarning"
    enum="CancelEphemeralWarningEvent" expires_after="2027-02-07">
  <owner>yawfrempong@google.com</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records the events related to ephemeral warning cancellation. Compare the
    bucket count between CancellationScheduled and CancellationTriggered to see
    how often the delayed task actually got triggered after one hour. The volume
    of the rest of the buckets should sum up to the CancellationTriggered
    bucket.
  </summary>
</histogram>

<histogram name="SBClientDownload.CheckDownloadStats"
    enum="SBClientDownloadCheckDownloadStats" expires_after="2027-01-17">
<!-- Note to owner: This histogram can be renewed 1 full year if it is still
useful for Chirp alerts (go/crca-alerts). -->

  <owner>vakh@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <owner>mattm@chromium.org</owner>
  <summary>
    Records the reason why downloads are marked as being malicious or clean by
    the improved SafeBrowsing binary download protection. Note that
    UNSUPPORTED_URL_SCHEME was split out of the INVALID_URL bucket in M41. The
    NOT_BINARY_FILE check was moved before the UNSUPPORTED_URL_SCHEME check in
    M42. The ALLOWLISTED_URL check was moved to before NOT_BINARY_FILE in M62.
    This is logged after download scanned by Safe Browsing.

    This metric is used to populate a dashboard on go/crsb-site.
  </summary>
</histogram>

<histogram name="SBClientDownload.DeepScanTrigger" enum="SBDeepScanTriggers"
    expires_after="2026-12-30">
  <owner>yawfrempong@google.com</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records the reason each file was uploaded to Safe Browsing for deep
    scanning. This is logged on every deep scan.
  </summary>
</histogram>

<histogram name="SBClientDownload.DeepScanType" enum="SBDeepScanType"
    expires_after="2023-03-19">
  <owner>domfc@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records the type of scan each time a download item starts a deep scan. This
    is logged on every deep scan.
  </summary>
</histogram>

<histogram name="SBClientDownload.DownloadExtensions"
    enum="SBClientDownloadExtensions" expires_after="2027-01-17">
  <owner>vakh@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <owner>mattm@chromium.org</owner>
  <summary>
    Records a histogram of how often users download a file with a file extension
    that is possibly dangerous (e.g., exe, class).
  </summary>
</histogram>

<histogram name="SBClientDownload.DownloadRequestDuration{Analysis}" units="ms"
    expires_after="2027-01-03">
  <owner>yawfrempong@google.com</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records the total time it takes for the SafeBrowsing download service to
    check whether the content of a download which underwent {Analysis} analysis
    is malicious or not, including file feature extraction, allowlist checking,
    and server ping. This histogram only includes checks that sent a ping to the
    SafeBrowsing server. It does not include requests that were cancelled, but
    does include requests that received a bad response.
  </summary>
  <token key="Analysis">
    <variant name="" summary="any"/>
    <variant name=".Dmg" summary="DMG archive"/>
    <variant name=".None" summary="executable"/>
    <variant name=".Rar" summary="RAR archive"/>
    <variant name=".SevenZip" summary="7Z archive"/>
    <variant name=".Zip" summary="ZIP archive"/>
  </token>
</histogram>

<histogram name="SBClientDownload.DownloadRequestNetworkDuration" units="ms"
    expires_after="2027-01-03">
  <owner>drubery@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records the time it takes for the SafeBrowsing download service ping. It is
    not recorded for requests that were cancelled.

    Warning: this histogram was expired from 2021-05-06 to 2021-12-02; data may
    be missing.
  </summary>
</histogram>

<histogram name="SBClientDownload.DownloadRequestNetworkResult"
    enum="CombinedHttpResponseAndNetErrorCode" expires_after="2027-01-31">
<!-- Note to owner: This histogram can be renewed 1 full year if it is still
useful for Chirp alerts (go/crca-alerts). -->

  <owner>yawfrempong@google.com</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records the net error or HTTP response code after sending a
    CheckClientDownloadRequest.
  </summary>
</histogram>

<histogram name="SBClientDownload.FileAnalysisDuration{Analysis}" units="ms"
    expires_after="2026-10-13">
  <owner>yawfrempong@google.com</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records the time it takes for the SafeBrowsing download service to check the
    safety of the contents of a download which underwent analysis for
    {Analysis}. This only includes file feature extraction. Also see
    SBClientDownload.DownloadRequestDuration.
  </summary>
  <token key="Analysis">
    <variant name="" summary="any file type, aggregated"/>
    <variant name=".Dmg"/>
    <variant name=".Executable" summary="executables"/>
    <variant name=".Rar"/>
    <variant name=".SevenZip"/>
    <variant name=".Zip"/>
  </token>
</histogram>

<histogram name="SBClientDownload.LocalDecryptionEvent" enum="SBDeepScanEvent"
    expires_after="2027-07-27">
  <owner>yawfrempong@google.com</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records events related to user interaction with local decryption prompts.
    This includes when the prompt is shown, when it is accepted or rejected, and
    when the provided password is incorrect.
  </summary>
</histogram>

<histogram name="SBClientDownload.SavePackageFileCount" units="files"
    expires_after="2023-03-19">
  <owner>domfc@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records the number of files corresponding to a single save package being
    scanned. This is logged on every save package deep scan.
  </summary>
</histogram>

<histogram name="SBClientDownload.ServerRequestsDeepScanningPrompt{Encryption}"
    enum="BooleanRequested" expires_after="2026-11-16">
  <owner>liu@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records how often users in a population consented to deep scanning are
    actually prompted for deep scanning of {Encryption}. This is logged once per
    download by an eligible user.
  </summary>
  <token key="Encryption">
    <variant name="" summary="any file"/>
    <variant name="PasswordProtected" summary="encrypted archives"/>
  </token>
</histogram>

<histogram name="SBClientDownload.ServerRequestsImmediateDeepScan2"
    enum="BooleanRequested" expires_after="2026-11-16">
  <owner>liu@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records how often users in a population consented to immediate deep scans
    are actually prompted for this feature. This is logged once per download by
    an eligible user.
  </summary>
</histogram>

<histogram name="SBClientDownload.ServerRequestsLocalDecryptionPrompt"
    enum="BooleanRequested" expires_after="2026-11-16">
  <owner>liu@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records how often users in a population consented to local decryption are
    actually prompted for this feature. This is logged once per download by an
    eligible user.
  </summary>
</histogram>

<histogram name="SBClientDownload.TailoredWarningType"
    enum="TailoredWarningType" expires_after="2027-02-02">
  <owner>xinghuilu@chromium.org</owner>
  <owner>yawfrempong@google.com</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records the tailored warning type that is shown. Logged when a download
    warning was shown in the shelf/bubble.
  </summary>
</histogram>

<histogram name="SBClientDownload.UserGestureFileType.Attributes"
    enum="SBClientDownloadUserGestureFileTypeAttributes"
    expires_after="2026-12-22">
  <owner>xinghuilu@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records the attributes of a download that is allowed on user gesture. Logged
    each time a download happens and the danger level is ALLOW_ON_USER_GESTURE.
    To get the percentage of a specific attribute, divide the number of record
    of that attribute by the number of record of TOTAL_TYPE_CHECKED.
  </summary>
</histogram>

<histogram
    name="SBClientDownload.Warning.DownloadHasUserGesture.{DangerType}.{Action}"
    enum="BooleanHasUserGesture" expires_after="2026-10-15">
  <owner>xinghuilu@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records whether the download was triggered by user gesture when a download
    warning for {DangerType} is {Action}. The bypassed metrics are recorded when
    the warning is either bypassed from the download shelf or from the downloads
    page. By combining the shown and bypassed metrics for a specific danger
    type, we can calculate whether the bypass rate is different between
    user-initiated and automatically triggered downloads.

    This metric is used to populate a dashboard on go/crca-site.
  </summary>
  <token key="DangerType" variants="DownloadDangerTypeForBypassMetrics"/>
  <token key="Action" variants="DownloadWarningAction"/>
</histogram>

<histogram
    name="SBClientDownload.Warning.DownloadIsHttps.{DangerType}.{Action}"
    enum="BooleanHttps" expires_after="2027-01-03">
  <owner>xinghuilu@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records whether the download URL is HTTPS when a download warning for
    {DangerType} is {Action}. The bypassed metrics are recorded when the warning
    is either bypassed from the download shelf or from the downloads page. By
    combining the shown and bypassed metrics for a specific danger type, we can
    calculate whether the bypass rate is different between HTTPS downloads and
    non-HTTPS downloads.

    This metric is used to populate a dashboard on go/crca-site.
  </summary>
  <token key="DangerType" variants="DownloadDangerTypeForBypassMetrics"/>
  <token key="Action" variants="DownloadWarningAction"/>
</histogram>

<histogram name="SBClientDownload.Warning.FileType.{DangerType}.{Action}"
    enum="SBClientDownloadExtensions" expires_after="2027-02-07">
  <owner>xinghuilu@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records the type of the file when a download warning for {DangerType} is
    {Action}. The bypassed metrics are recorded when the warning is either
    bypassed from the download shelf or from the downloads page. By combining
    the shown and bypassed metrics for a specific danger type, we can calculate
    the bypass rate of different file types.

    This metric is used to populate a dashboard on go/crca-site.
  </summary>
  <token key="DangerType" variants="DownloadDangerTypeForBypassMetrics"/>
  <token key="Action" variants="DownloadWarningAction"/>
</histogram>

<histogram name="SBClientDownload.{ArchiveType}ArchiveAnalysisResult"
    enum="ArchiveAnalysisResult" expires_after="2027-02-14">
  <owner>drubery@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records a more granular reason why we failed to unpack a {ArchiveType} file.
    This is recorded on every download of an {ArchiveType} file.
  </summary>
  <token key="ArchiveType">
    <variant name="Dmg"/>
    <variant name="Rar"/>
    <variant name="SevenZip"/>
    <variant name="Zip"/>
  </token>
</histogram>

<histogram name="SBClientDownload.{Encryption}DeepScanEvent3"
    enum="SBDeepScanEvent" expires_after="2027-02-07">
  <owner>drubery@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records events related to user interaction with deep scanning prompts. This
    is recorded a few times during the process of each prompt for deep scanning:
    - Once when the prompt is shown. - Once when the prompt is
    accepted/bypassed. - Once when the scan is completed, either through
    cancelation or completion. This is logged for consumer scans of
    {Encryption}.

    Note: Logging of PromptAccepted was lost in M118. &quot;Scan canceled&quot;
    and &quot;Scan deleted&quot; were added in M121. &quot;Prompt accepted&quot;
    was split into &quot;Prompt accepted&quot; and &quot;Prompt accepted from
    chrome://downloads&quot; in M121.
  </summary>
  <token key="Encryption">
    <variant name="" summary="a file"/>
    <variant name="PasswordProtected" summary="an encrypted archive"/>
  </token>
</histogram>

<histogram name="SBClientDownload.{Encryption}MalwareDeepScanResult2.{trigger}"
    enum="SBClientDownloadCheckResult" expires_after="2027-05-24">
  <owner>yawfrempong@google.com</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records the result of deep scanning {Encryption}, split by the reason the
    file was uploaded for scanning. This is logged after every deep scan of a
    download.
  </summary>
  <token key="Encryption">
    <variant name="" summary="a file"/>
    <variant name="PasswordProtected" summary="an encrypted archive"/>
  </token>
  <token key="trigger">
    <variant name="ConsumerPrompt"
        summary="Advanced Protection or Enhanced Protection user selected
                 'Scan'"/>
    <variant name="EncryptedConsumerPrompt"
        summary="Enhanced Protection user selected 'Scan' on an encrypted
                 archive"/>
    <variant name="ImmediateDeepScan"
        summary="Enhanced Protection user began deep scanning automatically"/>
    <variant name="Policy" summary="Triggered by enterprise policy"/>
    <variant name="Unknown" summary="Unknown trigger"/>
  </token>
</histogram>

<histogram name="SBClientPhishing.AddPhishingReportSuccessful"
    enum="BooleanSuccess" expires_after="2027-04-15">
  <owner>nwokedi@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records whether adding phishing report times to profile preferences list
    before sending ClientPhishingRequest is successful or not.
  </summary>
</histogram>

<histogram name="SBClientPhishing.ApplyTfliteTime.Classify" units="ms"
    expires_after="2027-01-03">
  <owner>nwokedi@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records the duration of running the TfLite classification, which is one step
    in applying the TfLite model for phishing detection. This model is applied
    roughly once per navigation.
  </summary>
</histogram>

<histogram name="SBClientPhishing.BlockingRequestType{RequestType}"
    enum="ClientSideDetectionType" expires_after="2027-02-07">
  <owner>nwokedi@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records the ongoing request type that blocked a new request of type
    {RequestType} due to the new request having a lower or same priority tier.
    Logged in ClientSideDetectionHost::MaybeStartPreClassification when a new
    trigger occurs while another classification is already in progress, whether
    in preclassification check or renderer classification.
  </summary>
  <token key="RequestType" variants="ClientSideDetectionRequestType"/>
</histogram>

<histogram name="SBClientPhishing.BrowserReadyOnClassifierNotReady"
    enum="BooleanReady" expires_after="2027-01-31">
  <owner>nwokedi@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    When a renderer-side classification returns the error
    &quot;CLASSIFIER_NOT_READY&quot;, this histogram is logged with whether or
    not the browser process had a valid model. This can help to identify
    problems distributing the model from browser process to the renderers.
  </summary>
</histogram>

<histogram name="SBClientPhishing.CancelClassificationReason{RequestType}"
    enum="SBClientPhishingCancelClassificationReason"
    expires_after="2027-02-14">
  <owner>nwokedi@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    The counts for various reasons why an in-progress phishing classification
    was canceled.
  </summary>
  <token key="RequestType" variants="ClassifierRequestType"/>
</histogram>

<histogram name="SBClientPhishing.CancelImageEmbeddingReason"
    enum="SBClientPhishingCancelImageEmbeddingReason"
    expires_after="2027-01-17">
  <owner>nwokedi@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    The counts for various reasons why an in-progress phishing image embedding
    was canceled.
  </summary>
</histogram>

<histogram name="SBClientPhishing.Classifier.Event{RequestType}"
    enum="SBPhishingClassifierEvent" expires_after="2027-02-07">
  <owner>nwokedi@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records events in the phishing classifier including reasons that prevents
    phishing detection to complete on the renderer side.
  </summary>
  <token key="RequestType" variants="ClassifierRequestType"/>
</histogram>

<histogram name="SBClientPhishing.Classifier.ReadyAfterRetryTimeout"
    units="bool" expires_after="2027-04-15">
  <owner>nwokedi@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records the success rate of renderer-side phishing classification after
    retries when the model is not available.
  </summary>
</histogram>

<histogram name="SBClientPhishing.ClassifyThresholdsResult"
    enum="SBClientDetectionClassifyThresholdsResult" expires_after="2026-10-11">
  <owner>nwokedi@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records the result of classification in visual TfLite model thresholds
    comparison on the browser side
  </summary>
</histogram>

<histogram
    name="SBClientPhishing.ClientSideDetection.AsyncCheckTriggerForceRequestResult"
    enum="AsyncCheckTriggerForceRequestResult" expires_after="2027-02-07">
  <owner>xinghuilu@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records the result of async check triggering CSD-Phishing classification
    forced by the request from real-time URL lookup. Recorded each time async
    Safe Browsing check is completed (note: this only happens when the check
    goes through async check tracker, which only happens if the Safe Browsing
    check is slow).
  </summary>
</histogram>

<histogram name="SBClientPhishing.ClientSideDetection.InterruptedByNavigation"
    enum="ClientSideDetectionType" expires_after="2027-03-12">
  <owner>nwokedi@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records the request type of an in-progress client-side detection process
    that was interrupted by a new page navigation. The process is considered
    in-progress from the completion of pre-classification until just prior to
    sending a network request or the process is otherwise completed/cancelled.
  </summary>
</histogram>

<histogram name="SBClientPhishing.ClientSideDetectionEvent{RequestType}"
    enum="ClientSideDetectionEvent" expires_after="2027-03-12">
  <owner>nwokedi@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records the event in Client Side Detection Host class. Record each time the
    flow hits the event listed in ClientSideDetectionEvent.
  </summary>
  <token key="RequestType" variants="ClientSideDetectionRequestType"/>
</histogram>

<histogram name="SBClientPhishing.ClientSideDetectionTypeRequest"
    enum="ClientSideDetectionType" expires_after="2027-01-03">
  <owner>nwokedi@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records client_side_detection_type in the verdict which denotes which
    process is responsible for sending the ping to the server. This histogram is
    logged once on every successful classification.
  </summary>
</histogram>

<histogram
    name="SBClientPhishing.ClipboardCopyApi.PayloadExtraction.IsOverallSuspicious"
    enum="Boolean" expires_after="2027-02-02">
  <owner>liu@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records the volume of analyzed clipboard payloads and whether they're deemed
    likely to be malicious.
  </summary>
</histogram>

<histogram
    name="SBClientPhishing.ClipboardCopyApi.PayloadExtraction.ProcessingDuration"
    units="ms" expires_after="2027-02-02">
  <owner>liu@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records the duration it took to process the clipboard payload and analyze
    its suspicion levels. This is recorded each time the clipboard payload is
    processed for client-side detection.
  </summary>
</histogram>

<histogram
    name="SBClientPhishing.ClipboardCopyApi.PayloadExtraction.SplitStringDuration"
    units="ms" expires_after="2026-10-23">
  <owner>liu@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records the duration it took to split the clipboard payload string into
    tokens. This is recorded each time the clipboard payload is processed for
    client-side detection.
  </summary>
</histogram>

<histogram
    name="SBClientPhishing.ClipboardCopyApi.PayloadExtraction.SuspiciousTokenCount"
    units="tokens" expires_after="2026-12-27">
  <owner>liu@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records the number of suspicious tokens discovered in the clipboard payload.
    This is recorded each time the clipboard payload is processed for
    client-side detection.
  </summary>
</histogram>

<histogram
    name="SBClientPhishing.ClipboardCopyApi.PayloadExtraction.TokenCount"
    units="tokens" expires_after="2026-12-27">
  <owner>liu@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records the number of tokens created when splitting the clipboard payload.
    This is recorded each time the clipboard payload is processed for
    client-side detection.
  </summary>
</histogram>

<histogram name="SBClientPhishing.ClipboardCopyApi.PayloadExtraction.UrlCount"
    units="urls" expires_after="2027-02-02">
  <owner>liu@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records the number of URLs extracted from a suspicious clipboard payload.
    This is recorded each time the clipboard payload is processed for
    client-side detection.
  </summary>
</histogram>

<histogram name="SBClientPhishing.ClipboardCopyApi.PayloadLength"
    units="characters" expires_after="2026-12-27">
  <owner>liu@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records the length of the clipboard payload in characters when a clipboard
    copy API is triggered on the page.
  </summary>
</histogram>

<histogram name="SBClientPhishing.CreditCardFormDedupedEvent{EventName}"
    enum="CreditCardFormEvent" expires_after="2027-02-14">
  <owner>nwokedi@chromium.org</owner>
  <owner>bcb@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records a credit card form event that may trigger a CSD ping, with an enum
    that represents the permutation of details for that event. This is recorded
    on every event that may trigger a CREDIT_CARD_FORM classification attempt,
    after checking for ESB, and after filtering to only the first event of a URL
    visit. {EventName}
  </summary>
  <token key="EventName">
    <variant name="" summary="Base histogram."/>
    <variant name=".OnAfterFocusOnFormField"
        summary="Triggered when the user focuses on a form field."/>
    <variant name=".OnFieldTypesDetermined"
        summary="Triggered when the form field types are determined."/>
  </token>
</histogram>

<histogram name="SBClientPhishing.CreditCardFormEvent3{EventName}"
    enum="CreditCardFormEvent" expires_after="2027-02-14">
  <owner>nwokedi@chromium.org</owner>
  <owner>bcb@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records a credit card form event that may trigger a CSD ping, with an enum
    that represents the permutation of details for that event. This is recorded
    on every event that may trigger a CREDIT_CARD_FORM classification attempt,
    after checking for ESB. {EventName}
  </summary>
  <token key="EventName">
    <variant name="" summary="Base histogram."/>
    <variant name=".OnAfterFocusOnFormField"
        summary="Triggered when the user focuses on a form field."/>
    <variant name=".OnFieldTypesDetermined"
        summary="Triggered when the form field types are determined."/>
  </token>
</histogram>

<histogram name="SBClientPhishing.CSDPhishingCachedDataAvailable"
    enum="BooleanAvailable" expires_after="2027-02-07">
  <owner>nwokedi@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records the times we could have used the CSD images cache to reuse the
    images for CSD-Phishing classification.
  </summary>
</histogram>

<histogram name="SBClientPhishing.FlatBufferMappedRegionValid"
    enum="BooleanSuccess" expires_after="2022-12-11">
  <owner>drubery@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records whether the shared memory region created to hold the flatbuffer was
    created successfully on not. This is logged on dynamic model update (which
    is rare), or on each startup.
  </summary>
</histogram>

<histogram name="SBClientPhishing.FlatBufferScorer.CreationStatus"
    enum="SBClientPhishingScorerCreationStatus" expires_after="2027-04-15">
  <owner>nwokedi@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records the status when we create a FlatBuffer scorer object for the
    client-side phishing detection classifier.
  </summary>
</histogram>

<histogram name="SBClientPhishing.HasVisualFeaturesImage2" enum="BooleanExists"
    expires_after="2027-01-13">
  <owner>xinghuilu@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Log whether CSD-Phishing pings contain the visual features image. This is
    only logged when the ping should contain the image (i.e. when
    SBClientPhishing.VisualFeaturesClearReason is kCanExtractVisualFeatures) and
    after it's determined that the ping is eligible to be sent.
  </summary>
</histogram>

<histogram name="SBClientPhishing.HighConfidenceAllowlistCheckDuration"
    units="ms" expires_after="2027-04-20">
  <owner>nwokedi@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records the duration it takes for high confidence allowlist check to
    complete. This occurs in the client side detection PreClassificationCheck.
  </summary>
</histogram>

<histogram
    name="SBClientPhishing.HighConfidenceAllowlistMatchOnServerVerdictPhishy{RequestType}"
    enum="BooleanMatched" expires_after="2027-02-07">
  <owner>nwokedi@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Logs whether the URL was on the high-confidence allowlist. Logged when the
    post classification server model verdict comes back to be phishy.
  </summary>
  <token key="RequestType" variants="ClientSideDetectionRequestType"/>
</histogram>

<histogram
    name="SBClientPhishing.HistoryServiceDuration.GetDailyVisitsToOrigin"
    units="ms" expires_after="2026-12-20">
  <owner>nwokedi@chromium.org</owner>
  <owner>bcb@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records the duration it takes for calling
    HistoryService.GetDailyVisitsToOrigin. This occurs for some ping types when
    determining whether to proceed to preclassification.
  </summary>
</histogram>

<histogram name="SBClientPhishing.ImageEmbedder.Event2"
    enum="SBImageEmbedderEvent" expires_after="2027-03-03">
  <owner>nwokedi@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records events in the phishing image embedder including reasons that
    prevents image embedding process to complete on the renderer side.
  </summary>
</histogram>

<histogram
    name="SBClientPhishing.ImageEmbedding.CapturedWithPhishingClassification"
    enum="BooleanSuccess" expires_after="2027-02-07">
  <owner>nwokedi@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records whether the loaded page's image embedding was captured. This is
    logged after any trigger models have finished classification and the client
    side detection type is `IMAGE_EMBEDDING_MATCH`.
  </summary>
</histogram>

<histogram name="SBClientPhishing.ImageEmbeddingList.Size" units="entries"
    expires_after="2027-01-24">
  <owner>nwokedi@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records the size of the image embedding list but displays the bucket the
    size entered which may be different than the size. This is logged when a new
    image embedding model is fetched, or on each startup.
  </summary>
</histogram>

<histogram name="SBClientPhishing.ImageEmbeddingList.Version" units="YYMMDDRR"
    expires_after="2027-01-24">
  <owner>nwokedi@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records the version of the image embedding list. This is logged when a new
    image embedding model is fetched, or on each startup.
  </summary>
</histogram>

<histogram name="SBClientPhishing.ImageEmbeddingModelLoadTime.FlatbufferScorer"
    units="ms" expires_after="2026-08-31">
  <owner>nwokedi@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records how long it takes the Flatbuffer scorer to load the TfLite model
    file from the memory mapped file into a string. This blocks the main thread,
    so we need to ensure it is small.
  </summary>
</histogram>

<histogram name="SBClientPhishing.ImageEmbeddingModelVersionMatch"
    enum="BooleanMatched" expires_after="2027-07-27">
  <owner>nwokedi@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Logs whether the image embedding model version is matched or not so that the
    correctly paired trigger and image embedding model are sent together to the
    renderer process.
  </summary>
</histogram>

<histogram
    name="SBClientPhishing.IntelligentScanHasSuccessfulResponse{IntelligentScanRequestType}"
    enum="BooleanSuccess" expires_after="2027-02-07">
  <owner>nwokedi@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records whether the intelligent scan has a successful response. This is
    logged in the callback after the intelligent scan call in the host class
    that was requested by {IntelligentScanRequestType}.
  </summary>
  <token key="IntelligentScanRequestType"
      variants="ClientSideDetectionIntelligentScanRequestType"/>
</histogram>

<histogram
    name="SBClientPhishing.IntelligentScanInnerTextSize{IntelligentScanRequestType}"
    units="bytes" expires_after="2027-04-10">
  <owner>xinghuilu@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Logs the size (in bytes) of the inner text extracted from the page during
    the intelligent scan. We can use this histogram to inform the size of the
    context window we need. Note that to convert bytes to tokens, we need to
    estimate the number of letters in a word and the number of tokens in a word.
    This is logged when the intelligent scan is inquired and requested by
    {IntelligentScanRequestType}.
  </summary>
  <token key="IntelligentScanRequestType"
      variants="ClientSideDetectionIntelligentScanRequestType"/>
</histogram>

<histogram
    name="SBClientPhishing.IntelligentScanOngoingOnNewPreclassification{RequestType}"
    enum="BooleanExists" expires_after="2027-01-20">
  <owner>nwokedi@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records whether or not the intelligent scan is ongoing when a new
    preclassification happens. This is logged when a new request happens through
    a new preclassification check and the current existing scan will be
    destroyed. The {RequestType} will be the triggering preclassification check
    to destroy the existing scan.
  </summary>
  <token key="RequestType" variants="ClientSideDetectionRequestType"/>
</histogram>

<histogram name="SBClientPhishing.IntelligentScanVerdict"
    enum="IntelligentScanVerdict" expires_after="2027-01-03">
  <owner>nwokedi@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@Google.com</owner>
  <summary>
    Logs what the IntelligentScanVerdict from ClientPhishingResponse was. This
    is only logged in Client Side Phishing Protection after the server response
    comes back and the field IntelligentScanVerdict is populated.
  </summary>
</histogram>

<histogram name="SBClientPhishing.iOS.VisualClassificationEarlyReturnReason"
    enum="SBClientPhishingVisualClassificationEarlyReturnReason"
    expires_after="2027-03-12">
  <owner>jdh@chromium.org</owner>
  <owner>nwokedi@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records the reason why visual phishing classification returned early on iOS
    before ML scoring could complete, such as a missing scorer or snapshot
    generation failure.
  </summary>
</histogram>

<histogram name="SBClientPhishing.IsErrorDocumentOnSupportedMimeType"
    enum="Boolean" expires_after="2027-01-02">
  <owner>nwokedi@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records whether or not the page of supported mime type is an error document.
    This is recorded on every supported mime type pages in the
    PreClassificationCheck.
  </summary>
</histogram>

<histogram
    name="SBClientPhishing.IsIntelligentScanAvailableAtInquiryTime{IntelligentScanRequestType}"
    enum="BooleanSuccess" expires_after="2027-02-07">
  <owner>nwokedi@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records whether the intelligent scan is available at the time of inquiry.
    This is logged in the service class at the start of the inquiry function
    call requested by {IntelligentScanRequestType}.
  </summary>
  <token key="IntelligentScanRequestType"
      variants="ClientSideDetectionIntelligentScanRequestType"/>
</histogram>

<histogram name="SBClientPhishing.IsOnDeviceModelAvailableOnSessionCreation"
    enum="BooleanSuccess" expires_after="2026-12-16">
  <owner>xinghuilu@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records whether the on device model is available at the time of session
    creation.
  </summary>
</histogram>

<histogram name="SBClientPhishing.LlamaForcedTriggerInfo.IntelligentScan"
    enum="BooleanEnabled" expires_after="2027-01-17">
  <owner>nwokedi@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records whether the intelligent_scan field under LlamaForcedTriggerInfo is
    set to true or false. This is recorded when the verdict contains the
    LlamaForcedTriggerInfo.
  </summary>
</histogram>

<histogram name="SBClientPhishing.LlamaForcedTriggerInfo.LlamaTriggerRuleId"
    units="rule_id" expires_after="2027-03-23">
  <owner>nwokedi@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records the field llama_trigger_rule_id under LlamaTriggerRuleInfo. This is
    recorded for every LlamaTriggerRuleInfo under LlamaForcedTriggerInfo.
  </summary>
</histogram>

<histogram
    name="SBClientPhishing.LlamaForcedTriggerInfo.LlamaTriggerRuleInfosSize"
    units="count" expires_after="2027-01-17">
  <owner>nwokedi@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records the size of the LlamaTriggerRuleInfo repeated fields. This is
    recorded when the verdict contains the LlamaForcedTriggerInfo.
  </summary>
</histogram>

<histogram name="SBClientPhishing.LocalModelDetectsPhishing{RequestType}"
    enum="BooleanIsPhishing" expires_after="2027-01-31">
  <owner>nwokedi@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records whether the local phishing detection model detects phishing for a
    specific {RequestType}. This histogram is logged each time the model is run
    (roughly on every navigation to a non-allowlisted site)

    This metric is used to populate a dashboard on go/crsb-site.
  </summary>
  <token key="RequestType" variants="ClientSideDetectionRequestType"/>
</histogram>

<histogram name="SBClientPhishing.MatchCSDAllowlistOn{RequestType}"
    enum="BooleanMatched" expires_after="2027-01-31">
  <owner>nwokedi@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records the CSD allowlist match result for a specific {RequestType}.
  </summary>
  <token key="RequestType">
    <variant name="ClipboardCopyApi" summary="Clipboard copy API"/>
    <variant name="CreditCardForm" summary="Credit Card Form"/>
  </token>
</histogram>

<histogram name="SBClientPhishing.MatchHighConfidenceAllowlist{RequestType}"
    enum="ClientSideAllowlistMatchResult" expires_after="2027-01-10">
  <owner>nwokedi@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Record the match result of allowlists for specific {RequestType}. This is
    logged during the client side detection host PreClassificationCheck.
  </summary>
  <token key="RequestType" variants="ClientSideDetectionRequestType"/>
</histogram>

<histogram name="SBClientPhishing.ModelDynamicUpdateSuccess"
    enum="BooleanSuccess" expires_after="2027-01-17">
<!-- Note to owner: This histogram can be renewed 1 full year if it is still
useful for Chirp alerts (go/crca-alerts). -->

  <owner>nwokedi@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records whether a dynamic update is successful or not. This is logged when a
    new model is pushed (rare), or on each startup.
  </summary>
</histogram>

<histogram name="SBClientPhishing.ModelDynamicUpdateSuccess.ImageEmbedding"
    enum="BooleanSuccess" expires_after="2026-09-29">
  <owner>nwokedi@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records whether a dynamic update of the image embedding model is successful
    or not. This is logged when a new image embedding model is fetched, or on
    each startup.
  </summary>
</histogram>

<histogram name="SBClientPhishing.NetworkRequestDuration" units="ms"
    expires_after="2027-02-14">
  <owner>nwokedi@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records the the duration of a network request due to a client side phishing
    ping.
  </summary>
</histogram>

<histogram name="SBClientPhishing.NetworkResult2"
    enum="CombinedHttpResponseAndNetErrorCode" expires_after="2027-01-31">
<!-- Note to owner: This histogram can be renewed 1 full year if it is still
useful for Chirp alerts (go/crca-alerts). -->

  <owner>nwokedi@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records the net error or HTTP response code after sending a network request
    due to a client side phishing ping.
  </summary>
</histogram>

<histogram name="SBClientPhishing.OnDeviceModelDownloadSuccess"
    enum="BooleanSuccess" expires_after="2027-02-07">
  <owner>nwokedi@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records whether the on-device model update is successful or not. This
    happens for Enhanced Safe Browsing enabled users.
  </summary>
</histogram>

<histogram
    name="SBClientPhishing.OnDeviceModelEligibilityReasonAtDownloadFailure"
    enum="OptimizationGuideOnDeviceModelEligibilityReason"
    expires_after="2027-03-18">
  <owner>nwokedi@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records the OptimizationGuideOnDeviceModelEligibilityReason when the model
    is not available at the time of download failure. This happens in the
    intelligent scan delegate class when the model eligibility reason does not
    match what we're looking for, thus the download fails.
  </summary>
</histogram>

<histogram
    name="SBClientPhishing.OnDeviceModelEligibilityReasonAtInquiryFailure"
    enum="OptimizationGuideOnDeviceModelEligibilityReason"
    expires_after="2027-02-07">
  <owner>nwokedi@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records the OptimizationGuideOnDeviceModelEligibilityReason when the model
    is not available at the time of inquiry. This happens in the client side
    detection service class when we inquire the model, but the model is not
    available.
  </summary>
</histogram>

<histogram name="SBClientPhishing.OnDeviceModelExecutionDuration" units="ms"
    expires_after="2027-02-14">
  <owner>nwokedi@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records the duration it took to execute the on-device model. This happens
    for Enhanced Safe Browsing enabled users when a keyboard lock occurs on the
    page they are on and the on-device model session creation is available.
  </summary>
</histogram>

<histogram name="SBClientPhishing.OnDeviceModelExecutionSuccess"
    enum="BooleanSuccess" expires_after="2027-02-14">
  <owner>nwokedi@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records whether the on-device model execution is successful or not. This
    happens for Enhanced Safe Browsing enabled users who called to execute the
    on-device model when inquiring for scam detection.
  </summary>
</histogram>

<histogram name="SBClientPhishing.OnDeviceModelFetchTime" units="ms"
    expires_after="2027-02-07">
  <owner>nwokedi@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records the duration it took to fetch the on-device model after
    subscription. This is only logged if the update is successful.
  </summary>
</histogram>

<histogram name="SBClientPhishing.OnDeviceModelResponseParseSuccess"
    enum="BooleanSuccess" expires_after="2027-02-14">
  <owner>nwokedi@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records whether the on-device model execution result's response parsing is
    successful or not. This is only logged when the model execution is
    successful.
  </summary>
</histogram>

<histogram name="SBClientPhishing.OnDeviceModelSessionAliveOnDelegateShutdown"
    enum="BooleanExists" expires_after="2027-01-03">
  <owner>nwokedi@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records whether or not the on-device model session was alive when the
    delegate is shutting down.
  </summary>
</histogram>

<histogram name="SBClientPhishing.OnDeviceModelSessionCreationSuccess"
    enum="BooleanSuccess" expires_after="2027-02-21">
  <owner>nwokedi@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records whether the on-device model session creation is successful. This is
    logged when the host class calls the inquire on device model function in the
    service class and the on device model is available. This is expected to be
    overwhelmingly &quot;success&quot; since we have passed the on device model
    availability check by the time this is logged.
  </summary>
</histogram>

<histogram name="SBClientPhishing.OnDeviceModelSessionCreationTime" units="ms"
    expires_after="2027-02-14">
  <owner>nwokedi@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records the duration it took to create an on-device model session. This
    happens for Enhanced Safe Browsing enabled users when a keyboard lock occurs
    on the page they are on and the on-device model session creation is
    available.
  </summary>
</histogram>

<histogram
    name="SBClientPhishing.OnDeviceModelStartModelDownloadFunctionRunTime.Android"
    units="ms" expires_after="2026-11-15">
  <owner>xinghuilu@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records the duration it took to run the StartModelDownload function in the
    intelligent scan delegate. Note that this measures the function running
    time, not the actual model download time (which is measured by
    SBClientPhishing.OnDeviceModelFetchTime).
  </summary>
</histogram>

<histogram name="SBClientPhishing.OnDeviceModelSuccessfulResponseCallbackAlive"
    enum="BooleanExists" expires_after="2027-01-03">
  <owner>nwokedi@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records the state of the client side detection host callback object when we
    respond after the on device model inquiry execution callback completed and
    the parsing was successful.
  </summary>
</histogram>

<histogram
    name="SBClientPhishing.OnDeviceModelUnavailableReasonAtInquiry.Android"
    enum="OptimizationGuideOnDeviceModelUnavailableReason"
    expires_after="2026-08-30">
  <owner>xinghuilu@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records the reason why the on-device model is unavailable at the time of
    inquiry on Android. This is logged when IsIntelligentScanAvailable is called
    with log_failed_eligibility_reason=true and the model is not available.
  </summary>
</histogram>

<histogram name="SBClientPhishing.OptimizationGuide.ModelFetchTime" units="ms"
    expires_after="2027-03-01">
  <owner>nwokedi@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records the duration of model fetch time after the OptimizationGuide Model
    Observer for CSD-Phishing is registered on user session start.
  </summary>
</histogram>

<histogram
    name="SBClientPhishing.PhishingClassifierMatchOnStrippedEmptyPath{RequestType}"
    enum="BooleanMatched" expires_after="2027-01-03">
  <owner>nwokedi@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records whether the stripped GURLs with empty path on browser and renderer
    loaded URL would have matched when the reference stripped URLs have not.
  </summary>
  <token key="RequestType" variants="ClassifierRequestType"/>
</histogram>

<histogram name="SBClientPhishing.PhishingDetectionDuration{RequestType}"
    units="ms" expires_after="2027-02-07">
  <owner>nwokedi@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records the duration it takes for client side phishing detection requested
    by {RequestType} to finish. This occurs at the client side detection
    PreClassificationCheck.
  </summary>
  <token key="RequestType" variants="ClientSideDetectionRequestType"/>
</histogram>

<histogram name="SBClientPhishing.PhishingDetectorResult{RequestType}"
    enum="ClientSidePhishingResult" expires_after="2027-01-31">
<!-- Note to owner: This histogram can be renewed 1 full year if it is still
useful for Chirp alerts (go/crca-alerts). -->

  <owner>nwokedi@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    The result enum received from the renderer-side classifier. This is recorded
    after every renderer classification (roughly every page load not on the
    allowlist). {RequestType} indicates which process requested the
    renderer-side classification.

    This metric is used to populate a dashboard on go/crsb-site.
  </summary>
  <token key="RequestType" variants="ClientSideDetectionRequestType"/>
</histogram>

<histogram name="SBClientPhishing.PhishingImageEmbeddingDuration{RequestType}"
    units="ms" expires_after="2027-02-07">
  <owner>nwokedi@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records the duration it takes for image embedding requested by {RequestType}
    to finish. This occurs for ESB enabled users only after the image embedding
    request has been made.
  </summary>
  <token key="RequestType" variants="ClientSideDetectionRequestType"/>
</histogram>

<histogram name="SBClientPhishing.PhishingImageEmbeddingResult{RequestType}"
    enum="ClientSidePhishingImageEmbeddingResult" expires_after="2027-01-10">
  <owner>nwokedi@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    The result enum received from renderer-side image embedder when requested by
    {RequestType}. This is recorded after every renderer image embedding which
    is expected to happen when the user is subscribed to ESB, has an image
    embedding model loaded, and the page is deemed phishy by the phishing
    classification process.
  </summary>
  <token key="RequestType" variants="ClientSideDetectionRequestType"/>
</histogram>

<histogram
    name="SBClientPhishing.PreClassificationCheckCancelActor{RequestType}"
    enum="ClientSideDetectionType" expires_after="2027-02-07">
  <owner>nwokedi@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records the cancelling actor of type ClientSideDetectionType when there is a
    current preclassification check being done by {RequestType}. This is logged
    whenever an active preclassification check is cancelled.
  </summary>
  <token key="RequestType" variants="ClientSideDetectionRequestType"/>
</histogram>

<histogram name="SBClientPhishing.PreClassificationCheckResult{RequestType}"
    enum="SBClientDetectionPreClassificationCheckResult"
    expires_after="2027-02-14">
  <owner>nwokedi@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records the result of phishing pre-classification checks for a given
    {RequestType}. This is recorded on every classification attempt for roughly
    every {RequestType} that comes in.

    Starting in M95, the PRIVATE_IP bucket was split to include LOCAL_RESOURCE
    and CHROME_UI_PAGE. Starting in M137, the children histograms start to log
    the CLASSIFY bucket.
  </summary>
  <token key="RequestType" variants="ClientSideDetectionRequestType"/>
</histogram>

<histogram name="SBClientPhishing.RedirectChainContainsForcedTriggerInfo"
    enum="BooleanExists" expires_after="2026-12-27">
  <owner>nwokedi@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Logs whether the redirect chain from the classification URL contains URLs
    that has a ForcedTriggerInfo from RTLookupResponse. This is only logged when
    the URL that the user is on does not have a ForcedTriggerInfo and the URL
    contains a redirect chain other than itself. This is only for ESB users.
  </summary>
</histogram>

<histogram name="SBClientPhishing.RedirectChainContainsForceRequest"
    enum="BooleanExists" expires_after="2026-12-27">
  <owner>nwokedi@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Logs whether the redirect chain from the classification URL contains URLs
    that has a force request from RTLookupResponse. This is only logged when the
    URL that the user is on does not have a force request and the URL contains a
    redirect chain other than itself. This is only for ESB users.
  </summary>
</histogram>

<histogram name="SBClientPhishing.RequestTypeAtReportLimit"
    enum="ClientSideDetectionType" expires_after="2026-11-05">
  <owner>nwokedi@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records the request type that would have passed preclassification if not
    blocked by the report limit. This is logged whenever too many reports
    preclassification check value is logged.
  </summary>
</histogram>

<histogram name="SBClientPhishing.RTLookupForceRequest"
    enum="BooleanForceRequest" expires_after="2027-01-17">
  <owner>nwokedi@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records if the RTUrlLookupResponse contains FORCE_REQUEST in
    client_side_detection_type, which forces the Client Side Detection -
    Phishing ping to be sent to the server if the user also has Enhanced Safe
    Browsing or Safe Browsing Extended Reporting opt-in. This histogram is
    logged once on every successful classification.
  </summary>
</histogram>

<histogram
    name="SBClientPhishing.RTLookupForceRequest.HasLlamaForcedTriggerInfo"
    enum="BooleanForceRequest" expires_after="2027-02-07">
  <owner>nwokedi@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records if the RTUrlLookupResponse that contained FORCE_REQUEST in
    client_side_detection_type contains the ForcedLlamaTriggerInfo. This
    histogram is logged if the RTUrlLookupResponse contains FORCE_REQUEST in
    client_side_detection_type and in the client side detection host class when
    the FORCE_REQUEST is fetched from the verdict cache manager.
  </summary>
</histogram>

<histogram name="SBClientPhishing.SameURLAtPrimaryPageChanged" enum="Boolean"
    expires_after="2027-04-21">
  <owner>nwokedi@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records whether the URL at the primary main frame remained the same when
    PrimaryPageChanged occurred on a non-refresh navigation.
  </summary>
</histogram>

<histogram name="SBClientPhishing.ServerModelDetectsPhishing{RequestType}"
    enum="BooleanIsPhishing" expires_after="2027-01-31">
<!-- Note to owner: This histogram can be renewed 1 full year if it is still
useful for Chirp alerts (go/crca-alerts). -->

  <owner>nwokedi@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records whether the server-side phishing detection model detects phishing
    for a specific {RequestType}. This histogram is logged each time we contact
    Safe Browsing to evaluate whether a site is phishing.
  </summary>
  <token key="RequestType" variants="ClientSideDetectionRequestType"/>
</histogram>

<histogram name="SBClientPhishing.ServerSideModelExecutionDuration" units="ms"
    expires_after="2027-01-03">
  <owner>xinghuilu@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records the duration it took to execute the server-side model. This happens
    for Enhanced Safe Browsing enabled users who called to execute the
    server-side model when inquiring for intelligent scan.
  </summary>
</histogram>

<histogram name="SBClientPhishing.ServerSideModelExecutionError"
    enum="OptimizationGuideModelExecutionError" expires_after="2027-01-03">
  <owner>xinghuilu@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records the error returned in the server-side model execution response for
    intelligent scan. Recorded every time an error is encountered during
    server-side model execution.
  </summary>
</histogram>

<histogram name="SBClientPhishing.ServerSideModelExecutionSuccess"
    enum="BooleanSuccess" expires_after="2027-01-03">
  <owner>xinghuilu@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records whether the server-side model execution is successful or not. This
    happens for Enhanced Safe Browsing enabled users who called to execute the
    server-side model when inquiring for intelligent scan.
  </summary>
</histogram>

<histogram name="SBClientPhishing.ServerSideModelHitQuotaAtInquiryTime"
    enum="BooleanHit" expires_after="2027-01-03">
  <owner>xinghuilu@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records whether the user has hit the quota for intelligent scan when they
    try to start an intelligent scan. This is logged if the server-side model is
    available.
  </summary>
</histogram>

<histogram name="SBClientPhishing.ServerSideModelPrefEmptyWhenRemovingQuota"
    enum="BooleanEmpty" expires_after="2027-02-07">
  <owner>xinghuilu@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records whether the pref list for intelligent scan timestamps is empty when
    we try to remove a timestamp from it. This is logged when a scam warning is
    shown to the user, which refunds the quota. This should never happen if the
    pref is intact.
  </summary>
</histogram>

<histogram name="SBClientPhishing.ServerSideModelQuotaCountOnLookup"
    units="queries" expires_after="2027-08-24">
  <owner>bcl@google.com</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records the number of server-side model queries made in the current 24-hour
    window for the user at the time a new server-side model lookup is initiated.
    The count includes the current lookup. It does not include refunded quota
    (i.e. from lookups which showed a warning). This is not recorded if the
    lookup is rejected due to hitting the quota limit.
  </summary>
</histogram>

<histogram name="SBClientPhishing.ServerSideModelQuotaCountOnScamWarningShown"
    units="queries" expires_after="2027-08-24">
  <owner>xinghuilu@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records the number of server-side model queries made before a scam warning
    is shown to the user. This is logged when a scam warning is shown to the
    user, before the quota is refunded. This number can help inform how
    adjusting the quota size affects protection (i.e. how many warning we will
    lose if we reduce the quota).
  </summary>
</histogram>

<histogram name="SBClientPhishing.SingleObserverCalledOnNewPage"
    enum="CSDObserverCalled" expires_after="2027-03-02">
  <owner>nwokedi@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records the single observer that was fired when there is a new page loading
    and the other observer CSD listens to has not been called. This is only
    called when one of the observers is fired and not the other.
  </summary>
</histogram>

<histogram name="SBClientPhishing.TimeSinceLastReportAtLimit" units="ms"
    expires_after="2027-02-22">
  <owner>nwokedi@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    When CSD service hits the ping limit and we are adding another entry, record
    the time since last record.
  </summary>
</histogram>

<histogram
    name="SBClientPhishing.TriggerModelsConvertedToForceRequest{LogTime}"
    units="bool" expires_after="2027-04-08">
  <owner>nwokedi@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records when a page load trigger CSD ping request is converted to a force
    request trigger. This is logged {LogTime}.
  </summary>
  <token key="LogTime">
    <variant name="AtLoad" summary="at page load observer call"/>
    <variant name="AtRequest" summary="at CSD request"/>
  </token>
</histogram>

<histogram name="SBClientPhishing.VerdictParseSuccessful" enum="BooleanSuccess"
    expires_after="2027-02-14">
  <owner>nwokedi@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records the success of parsing the verdict string received from renderer
    classification.

    This metric is used to validate that the verdict can always be successfully
    parsed when the phishing detector result is SUCCESS
  </summary>
</histogram>

<histogram name="SBClientPhishing.Viewport.EncodedResolution" units="encoded"
    expires_after="2026-12-19">
  <owner>nwokedi@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    The width x height of the viewport encoded as an integer. The upper 16 bits
    is the width and the lower 16 bits is the height. Decode using bitwise
    operations in queries. It is recorded whenever CSD checks if visual features
    can be extracted.
  </summary>
</histogram>

<histogram name="SBClientPhishing.Viewport.Height" units="pixels"
    expires_after="2026-12-19">
  <owner>nwokedi@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    The height of the viewport. It is recorded whenever CSD checks if visual
    features can be extracted.
  </summary>
</histogram>

<histogram name="SBClientPhishing.Viewport.PixelsPerInch" units="ppi"
    expires_after="2027-05-27">
  <owner>nwokedi@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    The pixels per inch (PPI) of the display where the viewport is located. It
    is recorded whenever CSD checks if visual features can be extracted.
  </summary>
</histogram>

<histogram name="SBClientPhishing.Viewport.Width" units="pixels"
    expires_after="2026-12-19">
  <owner>nwokedi@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    The width of the viewport. It is recorded whenever CSD checks if visual
    features can be extracted.
  </summary>
</histogram>

<histogram name="SBClientPhishing.VisualFeaturesClearReason2"
    enum="CanExtractVisualFeaturesResult" expires_after="2027-01-13">
  <owner>nwokedi@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Log the reason why CSD-Phishing pings do not contain visual features images.
    This is logged after deciding that the ping is eligible to be sent and the
    visual features extraction capability has been determined.
  </summary>
</histogram>

<histogram name="SBClientPhishing.VisualFeaturesExistAfterImageEmbedding"
    enum="BooleanExists" expires_after="2027-01-20">
  <owner>nwokedi@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records whether visual features exist after image embedding. This is
    recorded after every image embedding.
  </summary>
</histogram>

<histogram name="SBClientPhishing.VisualFeatureTime" units="ms"
    expires_after="2027-03-02">
  <owner>nwokedi@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records how long it took to extract visual features on the main thread. Work
    performed off-thread is not recorded in this histogram. This is recorded on
    every phishing classification or image embedding.
  </summary>
</histogram>

<histogram
    name="SBClientPhishing.VisualFeatureTime.BackgroundPlayback.Duration"
    units="microseconds" expires_after="2027-02-07">
  <owner>nwokedi@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Logs the duration in PlaybackOnBackgroundThread when extracting visual
    features. This is recorded on every phishing classification or image
    embedding. This logs wall time while
    SBClientPhishing.VisualFeatureTime.BackgroundPlayback.ThreadDuration logs
    thread time. This metric is logged even for clients that do not support
    ThreadTicks or have high resolution clocks.
  </summary>
</histogram>

<histogram
    name="SBClientPhishing.VisualFeatureTime.BackgroundPlayback.ThreadDuration"
    units="microseconds" expires_after="2027-02-07">
  <owner>nwokedi@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Logs the thread duration in PlaybackOnBackgroundThread when extracting
    visual features. This is recorded on every phishing classification or image
    embedding. This logs thread time while
    SBClientPhishing.VisualFeatureTime.BackgroundPlayback.Duration logs wall
    time. This metric is only recorded for clients with ThreadTicks support.
    Only recorded for clients with high resolution clocks.
  </summary>
</histogram>

<histogram name="SBClientPhishing.VisualFeatureTime.TotalDuration" units="ms"
    expires_after="2027-02-14">
  <owner>nwokedi@chromium.org</owner>
  <owner>chrome-counter-abuse-alerts@google.com</owner>
  <summary>
    Records how long it took to extract visual features. This logs the total
    duration, including the main thread time that is logged separately in
    SBClientPhishing.VisualFeatureTime, as well as the time taken on the
    background thread, up to but not including the execution of the done
    callback. This also includes queueing time for the posted task. This is
    recorded on every phishing classification or image embedding.
  </summary>
</histogram>

</histograms>

</histogram-configuration>
