<!--
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 WebCore 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>

<variants name="IdbRequestType">
  <variant name="ObjectStoreAdd"/>
  <variant name="ObjectStoreGet"/>
  <variant name="ObjectStorePut"/>
  <variant name="Open"/>
</variants>

<variants name="IdbTransactionTypes">
  <variant name="ReadOnly"/>
  <variant name="ReadWrite"/>
  <variant name="VersionChange"/>
</variants>

<variants name="LevelDBBFEMethods">
  <variant name=".CreateDir" summary="ChromiumEnv::CreateDir"/>
  <variant name=".GetChildren" summary="ChromiumEnv::GetChildren"/>
  <variant name=".GetFileSize" summary="ChromiumEnv::GetFileSize"/>
  <variant name=".GetTestDirectory" summary="ChromiumEnv::GetTestDirectory"/>
  <variant name=".LockFile" summary="ChromiumEnv::LockFile"/>
  <variant name=".NewAppendableFile" summary="ChromiumEnv::NewAppendableFile"/>
  <variant name=".NewLogger" summary="ChromiumEnv::NewLogger"/>
  <variant name=".NewRandomAccessFile"
      summary="ChromiumEnv::NewRandomAccessFile"/>
  <variant name=".NewSequentialFile" summary="ChromiumEnv::NewSequentialFile"/>
  <variant name=".NewWritableFile" summary="ChromiumEnv::NewWritableFile"/>
  <variant name=".RandomAccessFileRead"
      summary="ChromiumRandomAccessFile::Read"/>
  <variant name=".RemoveDir" summary="ChromiumEnv::RemoveDir"/>
  <variant name=".RemoveFile" summary="ChromiumEnv::RemoveFile"/>
  <variant name=".RenameFile" summary="ChromiumEnv::RenameFile"/>
  <variant name=".SequentialFileRead" summary="ChromiumSequentialFile::Read"/>
  <variant name=".SequentialFileSkip" summary="ChromiumSequentialFile::Skip"/>
  <variant name=".SyncParent" summary="ChromiumWritableFile::SyncParent"/>
  <variant name=".UnlockFile" summary="ChromiumEnv::UnlockFile"/>
  <variant name=".WritableFileAppend" summary="ChromiumWritableFile::Append"/>
  <variant name=".WritableFileClose" summary="ChromiumWritableFile::Close"/>
  <variant name=".WritableFileFlush" summary="ChromiumWritableFile::Flush"/>
  <variant name=".WritableFileSync" summary="ChromiumWritableFile::Sync"/>
</variants>

<histogram name="WebCore.DistillabilityUs" units="microseconds"
    expires_after="2027-02-07">
  <owner>wychen@chromium.org</owner>
  <owner>gilmanmh@google.com</owner>
  <summary>
    The time spent on collecting the statistics of the document in the main
    frame. These statistics would be used as features to classify whether the
    page is suitable for DOM distiller.

    Warning: This metric may include reports from clients with low-resolution
    clocks (i.e. on Windows, ref. |TimeTicks::IsHighResolution()|). Such reports
    will cause this metric to have an abnormal distribution. When considering
    revising this histogram, see UMA_HISTOGRAM_CUSTOM_MICROSECONDS_TIMES for the
    solution.
  </summary>
</histogram>

<histogram name="WebCore.Document.execCommand" enum="MappedEditingCommands"
    expires_after="2027-01-17">
  <owner>kojii@chromium.org</owner>
  <owner>tkent@chromium.org</owner>
  <summary>
    Counts the number of times each document.execCommand is executed. This
    doesn't count commands not supported by Blink.
  </summary>
</histogram>

<histogram
    name="WebCore.Editing.SpellCheckUserActionLimitation.{Source}.{Action}"
    enum="Boolean" expires_after="2027-01-10">
  <owner>arichiv@chromium.org</owner>
  <owner>katabolism-finch@google.com</owner>
  <summary>
    Counts the number of invocations by the {Source}SpellChecker related to
    {Action} actions and whether they were allowed or denied. For more see:
    https://explainers-by-googlers.github.io/user-dictionary-leaks/
  </summary>
  <token key="Source">
    <variant name="Cold"/>
    <variant name="Hot"/>
  </token>
  <token key="Action">
    <variant name="Contents"/>
    <variant name="Enablement"/>
    <variant name="Selection"/>
  </token>
</histogram>

<histogram name="WebCore.FindInPage.TaskDuration" units="ms"
    expires_after="2023-05-07">
  <owner>rakina@chromium.org</owner>
  <summary>
    Records how long one find-in-page task took from invocation start to end.
    Emitted when a find-in-page task finished running.
  </summary>
</histogram>

<histogram name="WebCore.Framebust.ClickThroughPosition"
    enum="ListItemPosition" expires_after="M110">
  <owner>csharrison@chromium.org</owner>
  <owner>japhet@chromium.org</owner>
  <summary>
    The position of the URL in the framebust UI list (desktop only) when it is
    clicked. Note that this UI surface is shared with the tab-under
    intervention, so elements in the list could come from either features. This
    metric will only be logged when a URL from the framebust (3p redirect)
    intervention is clicked.
  </summary>
</histogram>

<histogram name="WebCore.Framebust.InterventionOutcome"
    enum="FramebustInterventionOutcome" expires_after="M110">
  <owner>csharrison@chromium.org</owner>
  <owner>japhet@chromium.org</owner>
  <summary>
    The (android only) outcome of a particular framebust infobar. Recorded when
    the user either closes the infobar or declines the intervention by clicking
    the link.
  </summary>
</histogram>

<histogram name="WebCore.IndexedDB.BackingStore.Action" enum="IDBAction"
    expires_after="never">
<!-- expires-never: indexeddb heartbeat metric; used for chirp alerts (go/chrome-indexeddb-heartbeat) -->

  <owner>estade@chromium.org</owner>
  <owner>chrome-owp-storage@google.com</owner>
  <summary>
    Records actions that take place in IndexedDB. These stats are used for
    normalization in formulas. See go/chrome-indexeddb-heartbeat
  </summary>
</histogram>

<histogram name="WebCore.IndexedDB.BackingStore.DeleteDatabaseStatus"
    enum="LevelDBStatus" expires_after="never">
<!-- expires-never: indexeddb heartbeat metric; used for chirp alerts (go/chrome-indexeddb-heartbeat) -->

  <owner>estade@chromium.org</owner>
  <owner>chrome-owp-storage@google.com</owner>
  <summary>
    Records the result of trying to delete an IndexedDB database, per the user
    using the IDBFactory::DeleteDatabase API.
  </summary>
</histogram>

<histogram name="WebCore.IndexedDB.BackingStore.OpenFirstTryResult"
    enum="LevelDBStatus" expires_after="never">
<!-- expires-never: indexeddb heartbeat metric; used for chirp alerts (go/chrome-indexeddb-heartbeat) -->

  <owner>estade@chromium.org</owner>
  <owner>chrome-owp-storage@google.com</owner>
  <summary>
    Records the result of the FIRST attempt at opening the backing store for
    IndexedDB (i.e. retries are ignored). This is recorded when an API call
    needs to open the backing store (if it isn't already opened). API calls that
    can open the backing store are: IDBFactory::Open, GetDatabaseNames,
    GetDatabaseInfo, and DeleteDatabase.
  </summary>
</histogram>

<histogram name="WebCore.IndexedDB.BackingStore.OpenStatus"
    enum="IDBLevelDBBackingStoreOpenResult" expires_after="never">
<!-- expires-never: core storage metric; consumed in separate dashboard (go/chrome-storage-dashboard) -->

<!-- expires-never: indexeddb heartbeat metric; used for chirp alerts (go/chrome-indexeddb-heartbeat) -->

  <owner>estade@chromium.org</owner>
  <owner>chrome-owp-storage@google.com</owner>
  <summary>
    Count of the different success and failure modes when opening an IndexedDB
    backing store - clean open, successful open with recovery, failed recovery,
    etc. Includes all hosts.
  </summary>
</histogram>

<histogram name="WebCore.IndexedDB.BackingStore.OpenStatus.Docs"
    enum="IDBLevelDBBackingStoreOpenResult" expires_after="never">
<!-- expires-never: core storage metric; consumed in separate dashboard (go/chrome-storage-dashboard) -->

  <owner>estade@chromium.org</owner>
  <owner>chrome-owp-storage@google.com</owner>
  <summary>
    Count of the different success and failure modes when opening an IndexedDB
    backing store - clean open, successful open with recovery, failed recovery,
    etc. Only for docs.google.com.
  </summary>
</histogram>

<histogram name="WebCore.IndexedDB.LevelDBOpenErrors" enum="LevelDBErrorTypes"
    expires_after="2026-05-01">
  <owner>leimy@chromium.org</owner>
  <owner>evanstade@microsoft.com</owner>
  <owner>chrome-owp-storage@google.com</owner>
  <summary>
    Error classes returned by LevelDB when it failed to open a database.

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

<histogram name="WebCore.IndexedDB.LevelDBOpenErrors.BFE{LevelDBBFEMethods}"
    enum="PlatformFileError" expires_after="2026-05-01">
  <owner>leimy@chromium.org</owner>
  <owner>evanstade@microsoft.com</owner>
  <owner>chrome-owp-storage@google.com</owner>
  <summary>
    Errors (base::File::Error) encountered by a single LevelDBEnv method when
    opening an IndexedDB instance. {LevelDBBFEMethods}

    Warning: this histogram was expired from 2025-04-13 to 2025-12-01; data may
    be missing.
  </summary>
  <token key="LevelDBBFEMethods" variants="LevelDBBFEMethods">
    <variant name=""/>
  </token>
</histogram>

<histogram name="WebCore.IndexedDB.LevelDBOpenErrors.Corruption"
    enum="LevelDBCorruptionTypes" expires_after="2026-05-01">
  <owner>leimy@chromium.org</owner>
  <owner>evanstade@microsoft.com</owner>
  <owner>chrome-owp-storage@google.com</owner>
  <summary>
    Types of corruption that LevelDB encounters when opening a database.

    Warning: this histogram was expired from 2025-06-22 to 2025-12-01; data may
    be missing.
  </summary>
</histogram>

<histogram name="WebCore.IndexedDB.LevelDBOpenErrors.EnvMethod"
    enum="LevelDBIOErrorMethods" expires_after="2026-05-01">
  <owner>leimy@chromium.org</owner>
  <owner>evanstade@microsoft.com</owner>
  <owner>chrome-owp-storage@google.com</owner>
  <summary>
    LevelDBEnv methods that generated IO errors when opening a database.

    Warning: this histogram was expired from 2025-03-23 to 2025-12-01; data may
    be missing.
  </summary>
</histogram>

<histogram name="WebCore.IndexedDB.RequestDuration2.{RequestType}" units="ms"
    expires_after="2026-09-20">
  <owner>estade@chromium.org</owner>
  <owner>chrome-owp-storage@google.com</owner>
  <summary>
    Records end to end duration of an IndexedDB operation. Unlike
    RequestDuration before it, this only records when an event is successfully
    dispatched to the page (whether the result is a success or error).

    Note this is only recorded for the first result dispatch for a given
    request, e.g. &quot;upgradedneeded&quot; but not &quot;success&quot; for an
    open request.
  </summary>
  <token key="RequestType" variants="IdbRequestType"/>
</histogram>

<histogram name="WebCore.IndexedDB.Transaction.{TransactionType}.TimeActive2"
    units="ms" expires_after="2026-11-02">
  <owner>leimy@chromium.org</owner>
  <owner>evanstade@microsoft.com</owner>
  <owner>chrome-owp-storage@google.com</owner>
  <summary>
    The time it takes for an IndexedDB transaction to commit, starting from when
    it starts executing tasks (when it reaches the front of the scheduling
    queue). Recorded after transaction commit fully completes.
  </summary>
  <token key="TransactionType" variants="IdbTransactionTypes"/>
</histogram>

<histogram name="WebCore.IndexedDB.Transaction.{TransactionType}.TimeQueued"
    units="ms" expires_after="2026-09-20">
  <owner>estade@chromium.org</owner>
  <owner>chrome-owp-storage@google.com</owner>
  <summary>
    The time it takes for an IndexedDB transaction to start after it's created.
    This is measured from the browser process. It represents the amount of time
    spent queued behind other tranactions (i.e. waiting for locks) and any other
    delays before the transaction can begin operations.
  </summary>
  <token key="TransactionType" variants="IdbTransactionTypes"/>
</histogram>

<histogram name="WebCore.IndexedDB.TransactionAbortReason" enum="IDBException"
    expires_after="2026-07-19">
  <owner>estade@chromium.org</owner>
  <owner>chrome-owp-storage@google.com</owner>
  <summary>
    Recorded on the browser side (back end) when an IndexedDB transaction is
    aborted, specifically recording the reason for the abort. This can be
    triggered by javascript code on the renderer, errors or force closes on the
    backend, or by the transaction timeout timer.
  </summary>
</histogram>

<histogram name="WebCore.Scripts.Async.NotStreamingReason"
    enum="NotStreamingReason" expires_after="2024-09-18">
  <owner>leszeks@chromium.org</owner>
  <owner>v8-runtime@google.com</owner>
  <summary>
    Reason for not streaming an async script.

    Warning: This histogram was expired from 2023-12-10 to 2024-03-19. Data may
    be missing.
  </summary>
</histogram>

<histogram name="WebCore.Scripts.Async.StartedStreaming" enum="BooleanStreamed"
    expires_after="2023-08-08">
  <owner>leszeks@chromium.org</owner>
  <owner>v8-runtime@google.com</owner>
  <summary>Whether an async script was streamed or not.</summary>
</histogram>

<histogram name="WebCore.Scripts.Deferred.NotStreamingReason"
    enum="NotStreamingReason" expires_after="2024-09-18">
  <owner>leszeks@chromium.org</owner>
  <owner>v8-runtime@google.com</owner>
  <summary>
    Reason for not streaming a deferred script.

    Warning: This histogram was expired from 2023-12-10 to 2024-03-19. Data may
    be missing.
  </summary>
</histogram>

<histogram name="WebCore.Scripts.Deferred.StartedStreaming"
    enum="BooleanStreamed" expires_after="2023-06-01">
  <owner>leszeks@chromium.org</owner>
  <owner>v8-runtime@google.com</owner>
  <summary>Whether a deferred script was streamed or not.</summary>
</histogram>

<histogram name="WebCore.Scripts.InlineStreamerTimedOut" enum="BooleanTimedOut"
    expires_after="2025-02-10">
  <owner>cduvall@chromium.org</owner>
  <owner>leszeks@chromium.org</owner>
  <summary>
    Whether waiting for the background compile for an inline script timed out on
    the main thread. This is recorded each time an inline script streamer is
    available when executing an inline script.

    Warning: This histogram was expired from 2023-11-12 to 2024-06-11. Data may
    be missing.
  </summary>
</histogram>

<histogram name="WebCore.Scripts.InlineStreamerWaitTime" units="microseconds"
    expires_after="2025-02-10">
  <owner>cduvall@chromium.org</owner>
  <owner>leszeks@chromium.org</owner>
  <summary>
    Records the time the main thread is blocked while waiting for an inline
    script to finish compiling on a background thread. Recorded for each inline
    script that is compiled on a background thread.

    This histogram only records metrics on machines with high-resolution clocks.

    Warning: This histogram was expired from 2023-11-12 to 2024-06-11. Data may
    be missing.
  </summary>
</histogram>

<histogram name="WebCore.Scripts.Other.NotStreamingReason"
    enum="NotStreamingReason" expires_after="2024-09-18">
  <owner>leszeks@chromium.org</owner>
  <owner>v8-runtime@google.com</owner>
  <summary>
    Reason for not streaming an other (not async, deferred or parser blocking)
    script.

    Warning: This histogram was expired from 2023-12-10 to 2024-03-19. Data may
    be missing.
  </summary>
</histogram>

<histogram name="WebCore.Scripts.Other.StartedStreaming" enum="BooleanStreamed"
    expires_after="2023-06-01">
  <owner>leszeks@chromium.org</owner>
  <owner>v8-runtime@google.com</owner>
  <summary>
    Whether an other (not async, deferred or parser blocking) script was
    streamed or not.
  </summary>
</histogram>

<histogram name="WebCore.Scripts.ParsingBlocking.NotStreamingReason"
    enum="NotStreamingReason" expires_after="2024-09-18">
  <owner>leszeks@chromium.org</owner>
  <owner>v8-runtime@google.com</owner>
  <summary>
    Reason for not streaming a parsing blocking script.

    Warning: This histogram was expired from 2023-10-08 to 2024-03-19. Data may
    be missing.
  </summary>
</histogram>

<histogram name="WebCore.Scripts.ParsingBlocking.StartedStreaming"
    enum="BooleanStreamed" expires_after="2023-06-01">
  <owner>leszeks@chromium.org</owner>
  <owner>v8-runtime@google.com</owner>
  <summary>Whether a parsing blocking script was streamed or not.</summary>
</histogram>

<histogram name="WebCore.Scripts.V8CodeCacheMetadata.Get"
    enum="V8CodeCacheGetMetadataType" expires_after="2025-10-12">
  <owner>marja@chromium.org</owner>
  <owner>v8-runtime@google.com</owner>
  <summary>
    What type of cache metadata we retrieved for a script. Recorded when we are
    about to compile a script.
  </summary>
</histogram>

<histogram name="WebCore.Scripts.V8CodeCacheMetadata.Set"
    enum="V8CodeCacheSetMetadataType" expires_after="2025-03-30">
  <owner>marja@chromium.org</owner>
  <owner>v8-runtime@google.com</owner>
  <summary>
    What type of cache metadata we set for a script. If we set multiple metadata
    types for the same script, multiple samples are recorded. Recorded when we
    set the metadata.
  </summary>
</histogram>

<histogram name="WebCore.Scripts.V8CompileHintsStatus"
    enum="V8CompileHintsStatus" expires_after="2027-03-06">
  <owner>marja@chromium.org</owner>
  <owner>v8-loading@google.com</owner>
  <owner>chrome-intelligence-core@google.com</owner>
  <summary>
    Whether we produced / consumed compile hints (either local or crowdsourced)
    for a script. Recorded when a script is compiled (either via streaming or
    otherwise).
  </summary>
</histogram>

<histogram name="WebCore.Scripts.V8CrowdsourcedCompileHints.ModelQuality"
    enum="V8CompileHintsModelQuality" expires_after="2027-03-06">
  <owner>marja@chromium.org</owner>
  <owner>v8-loading@google.com</owner>
  <owner>chrome-intelligence-core@google.com</owner>
  <summary>
    Whether we got a V8CompileHints model and whether it was good quality.
  </summary>
</histogram>

<histogram name="WebCore.Scripts.V8LocalCompileHintsGenerated"
    enum="V8LocalCompileHintsGenerated" expires_after="2027-03-06">
  <owner>marja@chromium.org</owner>
  <owner>v8-runtime@google.com</owner>
  <summary>
    Whether we produced the non-final or the final version of local compile
    hints. This can be used for approximating how often we end up not generating
    compile hints if we wait too long for the final compile hints generation.
  </summary>
</histogram>

<histogram name="WebCore.Scripts.V8LocalCompileHintsObsoletedByCodeCache"
    enum="BooleanYesNo" expires_after="2027-03-06">
  <owner>marja@chromium.org</owner>
  <owner>v8-runtime@google.com</owner>
  <summary>
    Whether there already was a code cache when we tried to set local compile
    hints. Recorded when we set compile hints.
  </summary>
</histogram>

</histograms>

</histogram-configuration>
