Bug 1446880: update WebRTC Peer Identity WebIDL. r=smaug draft
authorNils Ohlmeier [:drno] <drno@ohlmeier.org>
Mon, 19 Mar 2018 06:15:37 +0000
changeset 777650 76dbf6ae8903f4fe6bfe73eff930abec9c40fafd
parent 777562 071ee904485e21e19ca08456d32bce6825b77a26
child 777651 b597b7fe0daff9b6fead92b3cc9c2da3e45a671c
push id105260
push userdrno@ohlmeier.org
push dateThu, 05 Apr 2018 03:49:09 +0000
reviewerssmaug
bugs1446880
milestone61.0a1
Bug 1446880: update WebRTC Peer Identity WebIDL. r=smaug MozReview-Commit-ID: CkszudsSKzl
dom/webidl/RTCIdentityProvider.webidl
dom/webidl/RTCPeerConnection.webidl
--- a/dom/webidl/RTCIdentityProvider.webidl
+++ b/dom/webidl/RTCIdentityProvider.webidl
@@ -18,31 +18,32 @@ interface RTCIdentityProviderRegistrar {
    * JS-implemented WebIDL can't see these functions on `idp` above, chrome JS
    * gets an Xray onto the content code that suppresses functions, see
    * https://developer.mozilla.org/en-US/docs/Xray_vision#Xrays_for_JavaScript_objects
    */
   /* Forward to idp.generateAssertion() */
   [ChromeOnly, Throws]
   Promise<RTCIdentityAssertionResult>
   generateAssertion(DOMString contents, DOMString origin,
-                    optional DOMString usernameHint);
+                    optional RTCIdentityProviderOptions options);
   /* Forward to idp.validateAssertion() */
   [ChromeOnly, Throws]
   Promise<RTCIdentityValidationResult>
   validateAssertion(DOMString assertion, DOMString origin);
 };
 
 dictionary RTCIdentityProvider {
   required GenerateAssertionCallback generateAssertion;
   required ValidateAssertionCallback validateAssertion;
 };
 
 callback GenerateAssertionCallback =
   Promise<RTCIdentityAssertionResult>
-    (DOMString contents, DOMString origin, optional DOMString usernameHint);
+    (DOMString contents, DOMString origin,
+     RTCIdentityProviderOptions options);
 callback ValidateAssertionCallback =
   Promise<RTCIdentityValidationResult> (DOMString assertion, DOMString origin);
 
 dictionary RTCIdentityAssertionResult {
   required RTCIdentityProviderDetails idp;
   required DOMString assertion;
 };
 
@@ -50,8 +51,15 @@ dictionary RTCIdentityProviderDetails {
   required DOMString domain;
   DOMString protocol = "default";
 };
 
 dictionary RTCIdentityValidationResult {
   required DOMString identity;
   required DOMString contents;
 };
+
+dictionary RTCIdentityProviderOptions {
+  DOMString protocol = "default";
+  DOMString usernameHint;
+  DOMString peerIdentity;
+};
+
--- a/dom/webidl/RTCPeerConnection.webidl
+++ b/dom/webidl/RTCPeerConnection.webidl
@@ -78,18 +78,17 @@ dictionary RTCOfferOptions : RTCOfferAns
  Constructor (optional RTCConfiguration configuration,
               optional object? constraints)]
 interface RTCPeerConnection : EventTarget  {
   [Throws, StaticClassOverride="mozilla::dom::RTCCertificate"]
   static Promise<RTCCertificate> generateCertificate (AlgorithmIdentifier keygenAlgorithm);
 
   [Pref="media.peerconnection.identity.enabled"]
   void setIdentityProvider (DOMString provider,
-                            optional DOMString protocol,
-                            optional DOMString username);
+                            optional RTCIdentityProviderOptions options);
   [Pref="media.peerconnection.identity.enabled"]
   Promise<DOMString> getIdentityAssertion();
   Promise<RTCSessionDescriptionInit> createOffer (optional RTCOfferOptions options);
   Promise<RTCSessionDescriptionInit> createAnswer (optional RTCAnswerOptions options);
   Promise<void> setLocalDescription (RTCSessionDescriptionInit description);
   Promise<void> setRemoteDescription (RTCSessionDescriptionInit description);
   readonly attribute RTCSessionDescription? localDescription;
   readonly attribute RTCSessionDescription? currentLocalDescription;