Bug 1322517 - Part 1 - Remove support for EME on insecure contexts. draft
authorChris Pearce <cpearce@mozilla.com>
Fri, 28 Apr 2017 13:46:15 +1200
changeset 698083 8fecf082c8922100c5e55ed3eb4c24cbc20ce52f
parent 697940 f0c0fb9182d695081edf170d8e3bcb8164f2c96a
child 698084 1f89bec71d0219ce60abc5e3229323d6c3175f53
push id89199
push userbmo:jacheng@mozilla.com
push dateWed, 15 Nov 2017 08:51:08 +0000
bugs1322517
milestone59.0a1
Bug 1322517 - Part 1 - Remove support for EME on insecure contexts. MozReview-Commit-ID: 1kIWXRS7BJu
dom/webidl/MediaKeyMessageEvent.webidl
dom/webidl/MediaKeySession.webidl
dom/webidl/MediaKeyStatusMap.webidl
dom/webidl/MediaKeySystemAccess.webidl
dom/webidl/MediaKeys.webidl
dom/webidl/Navigator.webidl
--- a/dom/webidl/MediaKeyMessageEvent.webidl
+++ b/dom/webidl/MediaKeyMessageEvent.webidl
@@ -12,17 +12,17 @@
 
 enum MediaKeyMessageType {
   "license-request",
   "license-renewal",
   "license-release",
   "individualization-request"
 };
 
-[Constructor(DOMString type, MediaKeyMessageEventInit eventInitDict)]
+[SecureContext, Constructor(DOMString type, MediaKeyMessageEventInit eventInitDict)]
 interface MediaKeyMessageEvent : Event {
   readonly attribute MediaKeyMessageType messageType;
   [Throws]
   readonly attribute ArrayBuffer message;
 };
 
 dictionary MediaKeyMessageEventInit : EventInit {
   required MediaKeyMessageType messageType;
--- a/dom/webidl/MediaKeySession.webidl
+++ b/dom/webidl/MediaKeySession.webidl
@@ -5,16 +5,17 @@
  *
  * The origin of this IDL file is
  * https://dvcs.w3.org/hg/html-media/raw-file/default/encrypted-media/encrypted-media.html
  *
  * Copyright © 2014 W3C® (MIT, ERCIM, Keio, Beihang), All Rights Reserved.
  * W3C liability, trademark and document use rules apply.
  */
 
+[SecureContext]
 interface MediaKeySession : EventTarget {
   // error state
   readonly attribute MediaKeyError? error;
 
   // session properties
   readonly attribute DOMString sessionId;
 
   readonly attribute unrestricted double expiration;
--- a/dom/webidl/MediaKeyStatusMap.webidl
+++ b/dom/webidl/MediaKeyStatusMap.webidl
@@ -15,15 +15,16 @@ enum MediaKeyStatus {
   "expired",
   "released",
   "output-restricted",
   "output-downscaled",
   "status-pending",
   "internal-error"
 };
 
+[SecureContext]
 interface MediaKeyStatusMap {
   iterable<ArrayBuffer,MediaKeyStatus>;
   readonly attribute unsigned long size;
   boolean has (BufferSource keyId);
   [Throws]
   any get (BufferSource keyId);
 };
--- a/dom/webidl/MediaKeySystemAccess.webidl
+++ b/dom/webidl/MediaKeySystemAccess.webidl
@@ -26,15 +26,16 @@ dictionary MediaKeySystemConfiguration {
   sequence<DOMString>                     initDataTypes = [];
   sequence<MediaKeySystemMediaCapability> audioCapabilities = [];
   sequence<MediaKeySystemMediaCapability> videoCapabilities = [];
   MediaKeysRequirement                    distinctiveIdentifier = "optional";
   MediaKeysRequirement                    persistentState = "optional";
   sequence<DOMString>                     sessionTypes;
 };
 
+[SecureContext]
 interface MediaKeySystemAccess {
   readonly    attribute DOMString keySystem;
   [NewObject]
   MediaKeySystemConfiguration getConfiguration();
   [NewObject]
   Promise<MediaKeys> createMediaKeys();
 };
--- a/dom/webidl/MediaKeys.webidl
+++ b/dom/webidl/MediaKeys.webidl
@@ -13,16 +13,17 @@
 // Note: "persistent-usage-record" session type is unsupported yet, as
 // it's marked as "at risk" in the spec, and Chrome doesn't support it. 
 enum MediaKeySessionType {
   "temporary",
   "persistent-license",
   // persistent-usage-record,
 };
 
+[SecureContext]
 interface MediaKeys {
   readonly attribute DOMString keySystem;
 
   [NewObject, Throws]
   MediaKeySession createSession(optional MediaKeySessionType sessionType = "temporary");
 
   [NewObject]
   Promise<void> setServerCertificate(BufferSource serverCertificate);
--- a/dom/webidl/Navigator.webidl
+++ b/dom/webidl/Navigator.webidl
@@ -344,17 +344,17 @@ partial interface Navigator {
 };
 
 partial interface Navigator {
   [NewObject, Func="mozilla::dom::TCPSocket::ShouldTCPSocketExist"]
   readonly attribute LegacyMozTCPSocket mozTCPSocket;
 };
 
 partial interface Navigator {
-  [NewObject]
+  [NewObject, SecureContext]
   Promise<MediaKeySystemAccess>
   requestMediaKeySystemAccess(DOMString keySystem,
                               sequence<MediaKeySystemConfiguration> supportedConfigurations);
 };
 
 [NoInterfaceObject, Exposed=(Window,Worker)]
 interface NavigatorConcurrentHardware {
   readonly attribute unsigned long long hardwareConcurrency;