diff --git a/index.html b/index.html index 55d1d83..3078fd3 100644 --- a/index.html +++ b/index.html @@ -1802,6 +1802,310 @@
+ [
+ Exposed=Window
+ ] partial interface RTCPeerConnection {
+ static Promise<DOMString> startDiagnosticLogging(optional RTCStartDiagnosticLoggingOptions options = {});
+ static Promise<undefined> finishDiagnosticLogging(optional RTCFinishDiagnosticLoggingOptions options = {});
+ static Promise<undefined> cancelDiagnosticLogging();
+ };
+
+ dictionary RTCDiagnosticLoggingOptions {
+ record<DOMString, DOMString> metadata;
+ };
+
+ dictionary RTCStartDiagnosticLoggingOptions : RTCDiagnosticLoggingOptions {
+ boolean allowUpload = false;
+ };
+
+ dictionary RTCFinishDiagnosticLoggingOptions : RTCDiagnosticLoggingOptions {
+ };
+
+ null.
+ The {{startDiagnosticLogging}} method attempts to start a diagnostic + logging session.
+When this method is invoked, the [= user agent =] MUST run the following steps:
+Let |options| be the first argument of this method.
+Let |allowUpload| be |options|'s + {{RTCStartDiagnosticLoggingOptions/allowUpload}} member.
+Let |metadata| be |options|'s + {{RTCDiagnosticLoggingOptions/metadata}} member.
+If the size of |metadata| exceeds 5 entries, or if any key or + value in |metadata| exceeds 100 characters, return a promise + [=rejected=] with a {{TypeError}}.
+Let |p| be a new promise.
+[=In parallel=], perform the following steps:
+Let |uuid| be a randomly generated UUID [[rfc4122]], which + is 36 characters long in its canonical form. To avoid + fingerprinting, implementations SHOULD use the forms in + section 4.4 or 4.5 of RFC 4122 when generating UUIDs.
+Let |doc| be the [=relevant global object=]'s associated [=document=].
+If |doc|'s [=browsing context=] is not a [=top-level browsing context=], + [=resolve=] |p| with |uuid| and abort these steps.
+If the {{RTCPeerConnection/[[RTCDiagnosticLoggingSessionId]]}} internal slot
+ is not null, [=resolve=] |p| with |uuid| and abort these steps.
Store |uuid| in the {{RTCPeerConnection/[[RTCDiagnosticLoggingSessionId]]}} + internal slot.
+[=Resolve=] |p| with |uuid|.
+Start a logging session of internal WebRTC activity identified with |uuid|
+Return |p|.
+
+ Once a logging session starts, any WebRTC-related activity generated
+ by |doc| or its descendant documents that are of the [=same origin=]
+ as |doc| MAY be logged by the user agent after |p| resolves.
+ The log MAY include |metadata| or information derived from it.
+ If |allowUpload| is true, the logged data may be shared with the
+ user agent vendor via an [=implementation-defined=] mechanism, as long as the user
+ has authorized it and the logging session has not been cancelled with the
+ {{cancelDiagnosticLogging}} method. The logging session is identified with
+ |uuid|, which means that all logged data can be internally referenced using
+ |uuid|.
+
The {{finishDiagnosticLogging}} method ends an ongoing diagnostic logging session.
+When this method is invoked, the [= user agent =] MUST run the following steps:
+Let |options| be the first argument of this method.
+Let |metadata| be |options|'s {{RTCDiagnosticLoggingOptions/metadata}} member.
+If the size of |metadata| exceeds 5 entries, or if any key or value + in |metadata| exceeds 100 characters, return a promise [=rejected=] + with a {{TypeError}}.
+Let |p| be a new promise.
+[=In parallel=], perform the following steps:
+If the {{RTCPeerConnection/[[RTCDiagnosticLoggingSessionId]]}}
+ internal slot is null, [=resolve=] |p| with
+ undefined and abort these steps.
Stop the logging session identified with + {{RTCPeerConnection/[[RTCDiagnosticLoggingSessionId]]}}.
+Set {{RTCPeerConnection/[[RTCDiagnosticLoggingSessionId]]}}
+ to null.
[=Resolve=] |p| with undefined.
Return |p|.
+
+ The user agent MUST not log any WebRTC-related activity generated by |doc| or
+ its descendant documents after the |p| resolves. The log MAY
+ include |metadata| or information derived from it. The user agent MAY share the
+ logged data out of band with the user-agent vendor using an
+ [=implementation-defined=] mechanism, as long as the user has authorized it and the
+ logging session was initialized with
+ {{RTCStartDiagnosticLoggingOptions/allowUpload}} set to true.
+
The {{cancelDiagnosticLogging}} method cancels an ongoing diagnostic logging session.
+When this method is invoked, the [= user agent =] MUST run the following steps:
+Let |p| be a new promise.
+[=In parallel=], perform the following steps:
+Let |uuid| be the value of the {{RTCPeerConnection/[[RTCDiagnosticLoggingSessionId]]}}.
+Cancel the logging session identified with + {{RTCPeerConnection/[[RTCDiagnosticLoggingSessionId]]}}.
+Set {{RTCPeerConnection/[[RTCDiagnosticLoggingSessionId]]}}
+ to null.
[=Resolve=] |p| with undefined.
Return |p|.
++ After |p| resolves: +
[].
+ + A [=record=] containing key-value pairs that the application can + use to provide context that can be stored in the diagnostic logs. +
+false.
+
+ If true, the [=user agent=] MAY share the logs from
+ the logging session with the [=user agent=] vendor.
+ If false, the [=user agent=] MUST NOT share the logs
+ from the logging session with the [=user agent=] vendor.
+