Bug 879861 - Part 6: Adding dom.secureelement.enabled pref. r=smaug
authorKrzysztof Mioduszewski <kmioduszewski@gmail.com>
Wed, 11 Feb 2015 04:04:00 -0500
changeset 256104 2eda9bb510d85236e31bb893291c8be369f4c0d8
parent 256103 93f03475e1ad67535ba8daece719f1911687962a
child 256105 de43b958f3f410aabec11573b7fad18310dd930f
push id4610
push userjlund@mozilla.com
push dateMon, 30 Mar 2015 18:32:55 +0000
treeherdermozilla-beta@4df54044d9ef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs879861
milestone38.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 879861 - Part 6: Adding dom.secureelement.enabled pref. r=smaug
dom/webidl/SecureElement.webidl
dom/webidl/SecureElementManager.webidl
modules/libpref/init/all.js
--- a/dom/webidl/SecureElement.webidl
+++ b/dom/webidl/SecureElement.webidl
@@ -29,17 +29,18 @@ dictionary SECommand {
   required octet ins;            // Instruction Byte
   required octet p1;             // First Octet of Parameters Byte
   required octet p2;             // Second Octet of Parameters Byte
   sequence<octet>? data = null;  // Sequence of octets
   short le = -1;                 // The length of the expected
                                  // response data or -1 if none is expected
 };
 
-[CheckPermissions="secureelement-manage",
+[Pref="dom.secureelement.enabled",
+ CheckPermissions="secureelement-manage",
  AvailableIn="CertifiedApps",
  JSImplementation="@mozilla.org/secureelement/reader;1"]
 interface SEReader {
 
   // 'true' if a secure element is present
   readonly attribute boolean isSEPresent;
 
   // Type of SecureElement
@@ -57,17 +58,18 @@ interface SEReader {
   /**
    * Closes all sessions associated with this Reader and its associated channels.
    *
    */
   [Throws]
   Promise<void> closeAll();
 };
 
-[CheckPermissions="secureelement-manage",
+[Pref="dom.secureelement.enabled",
+ CheckPermissions="secureelement-manage",
  AvailableIn="CertifiedApps",
  JSImplementation="@mozilla.org/secureelement/session;1"]
 interface SESession {
 
   // 'reader' that provides this session
   readonly attribute SEReader reader;
 
   // Status of current session
@@ -92,17 +94,18 @@ interface SESession {
   /**
    * Close all active channels associated with this session.
    *
    */
   [Throws]
   Promise<void> closeAll();
 };
 
-[CheckPermissions="secureelement-manage",
+[Pref="dom.secureelement.enabled",
+ CheckPermissions="secureelement-manage",
  AvailableIn="CertifiedApps",
  JSImplementation="@mozilla.org/secureelement/channel;1"]
 interface SEChannel {
 
   // 'session' obj this channel is bound to
   readonly attribute SESession session;
 
   // response to openBasicChannel / openLogicalChannel operation
@@ -131,17 +134,18 @@ interface SEChannel {
   /**
    * Closes the active channel.
    *
    */
   [Throws]
   Promise<void> close();
 };
 
-[CheckPermissions="secureelement-manage",
+[Pref="dom.secureelement.enabled",
+ CheckPermissions="secureelement-manage",
  AvailableIn="CertifiedApps",
  JSImplementation="@mozilla.org/secureelement/response;1"]
 interface SEResponse {
   // Response received on this 'channel' object.
   [Constant] readonly attribute SEChannel channel;
 
   // First octet of response's status word
   [Constant] readonly attribute octet        sw1;
--- a/dom/webidl/SecureElementManager.webidl
+++ b/dom/webidl/SecureElementManager.webidl
@@ -1,15 +1,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
  /* Copyright © 2014 Deutsche Telekom, Inc. */
 
-[CheckPermissions="secureelement-manage",
+[Pref="dom.secureelement.enabled",
+ CheckPermissions="secureelement-manage",
  AvailableIn="CertifiedApps",
  JSImplementation="@mozilla.org/secureelement/manager;1",
  NavigatorProperty="seManager",
  NoInterfaceObject]
 interface SEManager {
 
   /**
    * Retrieves all the readers available on the device.
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -4549,8 +4549,13 @@ pref("reader.font_type", "sans-serif");
 pref("reader.has_used_toolbar", false);
 
 #if defined(XP_LINUX) && defined(MOZ_GMP_SANDBOX)
 // Whether to allow, on a Linux system that doesn't support the necessary sandboxing
 // features, loading Gecko Media Plugins unsandboxed.  However, EME CDMs will not be
 // loaded without sandboxing even if this pref is changed.
 pref("media.gmp.insecure.allow", false);
 #endif
+
+// Secure Element API
+#ifdef MOZ_SECUREELEMENT
+pref("dom.secureelement.enabled", false);
+#endif