Bug 1446880: update WebRTC Peer Identity WebIDL. r=smaug
authorNils Ohlmeier [:drno] <drno@ohlmeier.org>
Mon, 19 Mar 2018 06:15:37 +0000
changeset 777805 41ddd2c3d501172dcda6548a68651dc708ec2026
parent 777804 682e5bf710fc0c36c2b9a122dc45be7179aaddb0
child 777806 64c883d5d65f8769bc385d75f2ea4152c5e38525
push id105296
push userpaolo.mozmail@amadzone.org
push dateThu, 05 Apr 2018 10:49:16 +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;