Bug 1256414 - Hide MozSettingsEvent from the Web; r=khuey
authorEhsan Akhgari <ehsan@mozilla.com>
Sun, 13 Mar 2016 15:24:59 -0400
changeset 288630 d29d4a17954b86f4e390c847887f5b24b5d28fdc
parent 288629 2171cf918a533436f924f4818d31e8f514a63043
child 288631 cc8b02b24319e086ddbf5ca4035818423ff0c8d5
push id18174
push usercbook@mozilla.com
push dateTue, 15 Mar 2016 09:44:58 +0000
treeherderfx-team@dd0baa33759d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskhuey
bugs1256414
milestone48.0a1
Bug 1256414 - Hide MozSettingsEvent from the Web; r=khuey MozSettingsTransactionEvent is already hidden behind this permission, so it makes sense to require the same permissions for this event too.
dom/tests/mochitest/general/test_interfaces.html
dom/webidl/MozSettingsEvent.webidl
--- a/dom/tests/mochitest/general/test_interfaces.html
+++ b/dom/tests/mochitest/general/test_interfaces.html
@@ -829,17 +829,17 @@ var interfaceNamesInGlobalScope =
     {name: "MozPowerManager", b2g: true, permission: "power"},
 // IMPORTANT: Do not change this list without review from a DOM peer!
     "mozRTCIceCandidate",
 // IMPORTANT: Do not change this list without review from a DOM peer!
     "mozRTCPeerConnection",
 // IMPORTANT: Do not change this list without review from a DOM peer!
     "mozRTCSessionDescription",
 // IMPORTANT: Do not change this list without review from a DOM peer!
-    "MozSettingsEvent",
+    {name: "MozSettingsEvent", permission: ["settings-api-read"]},
 // IMPORTANT: Do not change this list without review from a DOM peer!
     {name: "MozSettingsTransactionEvent", permission: ["settings-api-read"]},
 // IMPORTANT: Do not change this list without review from a DOM peer!
     {name: "MozSpeakerManager", b2g: true},
 // IMPORTANT: Do not change this list without review from a DOM peer!
     {name: "MozTimeManager", b2g: true},
 // IMPORTANT: Do not change this list without review from a DOM peer!
     {name: "MozWakeLock", b2g: true},
--- a/dom/webidl/MozSettingsEvent.webidl
+++ b/dom/webidl/MozSettingsEvent.webidl
@@ -1,15 +1,16 @@
 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* 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/.
  */
 
-[Constructor(DOMString type, optional MozSettingsEventInit eventInitDict)]
+[Constructor(DOMString type, optional MozSettingsEventInit eventInitDict),
+ CheckAnyPermissions="settings-api-read settings-api-write"]
 interface MozSettingsEvent : Event
 {
   readonly attribute DOMString? settingName;
   readonly attribute any settingValue;
 };
 
 dictionary MozSettingsEventInit : EventInit
 {