tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

Glean.webidl (1600B)


      1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
      2 /* This Source Code Form is subject to the terms of the Mozilla Public
      3 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
      4 * You can obtain one at http://mozilla.org/MPL/2.0/.
      5 */
      6 
      7 [Func="GleanWebidlEnabled", Exposed=Window]
      8 interface GleanCategory {
      9  /**
     10   * Get a metric by name.
     11   *
     12   * Returns an object of the corresponding metric type,
     13   * with only the allowed functions available.
     14   */
     15  getter GleanMetric (DOMString identifier);
     16 };
     17 
     18 [Func="GleanWebidlEnabled", Exposed=Window]
     19 interface GleanImpl {
     20  /**
     21   * Get a metric category by name.
     22   *
     23   * Returns an object for further metric lookup.
     24   */
     25  getter GleanCategory (DOMString identifier);
     26 };
     27 
     28 typedef (boolean or unsigned long long or UTF8String or GleanDistributionData) GleanLabeledTestValue;
     29 
     30 [Func="GleanWebidlEnabled", Exposed=Window]
     31 interface GleanLabeled {
     32  /**
     33   * Get a specific metric for a given label.
     34   *
     35   * If a set of acceptable labels were specified in the `metrics.yaml` file,
     36   * and the given label is not in the set, it will be recorded under the
     37   * special `OTHER_LABEL` label.
     38   *
     39   * If a set of acceptable labels was not specified in the `metrics.yaml` file,
     40   * only the first 16 unique labels will be used.
     41   * After that, any additional labels will be recorded under the special
     42   * `OTHER_LABEL` label.
     43   */
     44  getter GleanMetric (DOMString identifier);
     45 
     46  [Throws, ChromeOnly]
     47  record<UTF8String, GleanLabeledTestValue>? testGetValue(optional UTF8String aPingName = "");
     48 };