Backed out changeset 06f41c22f3a6 (bug 1888460) for causing linux xpcshell failures...
[gecko.git] / dom / webidl / Reporting.webidl
blobdb0582411c41de97a81f69026f41400b84d5caa2
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  * The origin of this IDL file is
7  * https://w3c.github.io/reporting/#interface-reporting-observer
8  */
10 [Pref="dom.reporting.enabled",
11  Exposed=(Window,Worker)]
12 interface ReportBody {
13   [Default] object toJSON
14 ();
17 [Pref="dom.reporting.enabled",
18  Exposed=(Window,Worker)]
19 interface Report {
20   [Default] object toJSON
21 ();
22   readonly attribute DOMString type;
23   readonly attribute DOMString url;
24   readonly attribute ReportBody? body;
27 [Pref="dom.reporting.enabled",
28  Exposed=(Window,Worker)]
29 interface ReportingObserver {
30   [Throws]
31   constructor(ReportingObserverCallback callback, optional ReportingObserverOptions options = {});
32   undefined observe();
33   undefined disconnect();
34   ReportList takeRecords();
37 callback ReportingObserverCallback = undefined (sequence<Report> reports, ReportingObserver observer);
39 dictionary ReportingObserverOptions {
40   sequence<DOMString> types;
41   boolean buffered = false;
44 typedef sequence<Report> ReportList;
46 [Pref="dom.reporting.enabled",
47  Exposed=Window]
48 interface DeprecationReportBody : ReportBody {
49   readonly attribute DOMString id;
50   // The spec currently has Date, but that's not a type that exists in Web IDL.
51   // In any case, we always return null, so we just need _some_ nullable type
52   // here.
53   readonly attribute DOMTimeStamp? anticipatedRemoval;
54   readonly attribute DOMString message;
55   readonly attribute DOMString? sourceFile;
56   readonly attribute unsigned long? lineNumber;
57   readonly attribute unsigned long? columnNumber;
60 [Deprecated="DeprecatedTestingInterface",
61  Pref="dom.reporting.testing.enabled",
62  Exposed=(Window,DedicatedWorker)]
63 interface TestingDeprecatedInterface {
64   constructor();
66   [Deprecated="DeprecatedTestingMethod"]
67   undefined deprecatedMethod();
69   [Deprecated="DeprecatedTestingAttribute"]
70   readonly attribute boolean deprecatedAttribute;
73 // Used internally to process the JSON
74 [GenerateInit]
75 dictionary ReportingHeaderValue {
76   sequence<ReportingItem> items;
79 // Used internally to process the JSON
80 dictionary ReportingItem {
81   // This is a long.
82   any max_age;
83   // This is a sequence of ReportingEndpoint.
84   any endpoints;
85   // This is a string. If missing, the value is 'default'.
86   any group;
87   boolean include_subdomains = false;
90 // Used internally to process the JSON
91 [GenerateInit]
92 dictionary ReportingEndpoint {
93   // This is a string.
94   any url;
95   // This is an unsigned long.
96   any priority;
97   // This is an unsigned long.
98   any weight;