Bug 1570212 - Convert media.video_stats.enabled to a static pref. r=jya

Also remove HTMLVideoElement::InitStatics(), which is no longer needed.

Differential Revision: https://phabricator.services.mozilla.com/D40340

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Nicholas Nethercote 2019-08-02 12:35:01 +00:00
parent 581ca41a65
commit 98864cc3ec
5 changed files with 8 additions and 15 deletions

View File

@ -51,8 +51,6 @@ nsGenericHTMLElement* NS_NewHTMLVideoElement(
namespace mozilla {
namespace dom {
static bool sVideoStatsEnabled;
nsresult HTMLVideoElement::Clone(mozilla::dom::NodeInfo* aNodeInfo,
nsINode** aResult) const {
*aResult = nullptr;
@ -417,14 +415,10 @@ bool HTMLVideoElement::SetVisualCloneSource(
}
/* static */
void HTMLVideoElement::InitStatics() {
Preferences::AddBoolVarCache(&sVideoStatsEnabled,
"media.video_stats.enabled");
bool HTMLVideoElement::IsVideoStatsEnabled() {
return StaticPrefs::media_video_stats_enabled();
}
/* static */
bool HTMLVideoElement::IsVideoStatsEnabled() { return sVideoStatsEnabled; }
double HTMLVideoElement::TotalPlayTime() const {
double total = 0.0;

View File

@ -44,8 +44,6 @@ class HTMLVideoElement final : public HTMLMediaElement {
nsAttrValue& aResult) override;
NS_IMETHOD_(bool) IsAttributeMapped(const nsAtom* aAttribute) const override;
static void InitStatics();
virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction()
const override;

View File

@ -265,8 +265,6 @@ nsresult nsLayoutStatics::Initialize() {
nsCookieService::AppClearDataObserverInit();
nsApplicationCacheService::AppClearDataObserverInit();
HTMLVideoElement::InitStatics();
#ifdef MOZ_XUL
nsMenuBarListener::InitializeStatics();
#endif

View File

@ -5058,6 +5058,12 @@
#endif
mirror: always
# Are video stats enabled? (Disabling can help prevent fingerprinting.)
- name: media.video_stats.enabled
type: bool
value: true
mirror: always
# Opus
- name: media.opus.enabled
type: RelaxedAtomicBool

View File

@ -456,9 +456,6 @@ pref("media.video-queue.default-size", 10);
// By default, send all of them.
pref("media.video-queue.send-to-compositor-size", 9999);
// Whether to disable the video stats to prevent fingerprinting
pref("media.video_stats.enabled", true);
// Log level for cubeb, the audio input/output system. Valid values are
// "verbose", "normal" and "" (log disabled).
pref("media.cubeb.logging_level", "");