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
This commit is contained in:
Nicholas Nethercote
2019-08-02 12:35:01 +00:00
parent bb0967e3a1
commit e4021016ce
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;