Bug 1286530 - Turn ResourceStats API to ChromeOnly
MozReview-Commit-ID: JOnHviptd2p
--- a/dom/webidl/ResourceStats.webidl
+++ b/dom/webidl/ResourceStats.webidl
@@ -1,38 +1,35 @@
/* -*- 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/.
*/
-[CheckAnyPermissions="resourcestats-manage",
+[ChromeOnly,
Pref="dom.resource_stats.enabled",
- AvailableIn="CertifiedApps",
JSImplementation="@mozilla.org/networkStatsData;1"]
interface NetworkStatsData
{
readonly attribute unsigned long long receivedBytes;
readonly attribute unsigned long long sentBytes;
readonly attribute DOMTimeStamp timestamp; // timestamp of the record
};
-[CheckAnyPermissions="resourcestats-manage",
+[ChromeOnly,
Pref="dom.resource_stats.enabled",
- AvailableIn="CertifiedApps",
JSImplementation="@mozilla.org/powerStatsData;1"]
interface PowerStatsData
{
readonly attribute unsigned long long consumedPower; // unit: mW
readonly attribute DOMTimeStamp timestamp; // timestamp of the record
};
-[CheckAnyPermissions="resourcestats-manage",
+[ChromeOnly,
Pref="dom.resource_stats.enabled",
- AvailableIn="CertifiedApps",
JSImplementation="@mozilla.org/resourceStats;1"]
interface ResourceStats
{
/**
* Type of statistics/
*/
readonly attribute ResourceType type;
--- a/dom/webidl/ResourceStatsManager.webidl
+++ b/dom/webidl/ResourceStatsManager.webidl
@@ -65,19 +65,18 @@ dictionary ResourceStatsAlarmOptions
*
* |data| is used to reflect in the alarm object when the alarm is triggered.
* |data| should be copied using the structured clone algorithm.
*/
[EnforceRange] DOMTimeStamp startTime; // time in milliseconds since Epoch
any data;
};
-[CheckAnyPermissions="resourcestats-manage",
+[ChromeOnly,
Pref="dom.resource_stats.enabled",
- AvailableIn="CertifiedApps",
JSImplementation="@mozilla.org/resourceStatsAlarm;1"]
interface ResourceStatsAlarm
{
/**
* ID of the alarm
*/
readonly attribute unsigned long alarmId;
@@ -107,20 +106,19 @@ interface ResourceStatsAlarm
readonly attribute unsigned long long threshold;
/**
* |data| is used to reflect in the alarm object when the alarm is triggered.
*/
readonly attribute any data;
};
-[CheckAnyPermissions="resourcestats-manage",
+[ChromeOnly,
Pref="dom.resource_stats.enabled",
Constructor(ResourceType type),
- AvailableIn="CertifiedApps",
JSImplementation="@mozilla.org/resourceStatsManager;1"]
interface ResourceStatsManager
{
/**
* Query resource statistics.
*
* |statsOptions| specifies the detail of statistics of interest.
*