Bug 1596064 - Remove any access on the database when pref is off. r=jya

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Alex Chronopoulos 2019-11-15 10:59:50 +00:00
Родитель 017284eed7
Коммит dbabae6629
2 изменённых файлов: 8 добавлений и 0 удалений

Просмотреть файл

@ -906,6 +906,9 @@ void MediaFormatReader::ShutdownDecoder(TrackType aTrack) {
void MediaFormatReader::NotifyDecoderBenchmarkStore() {
MOZ_ASSERT(OnTaskQueue());
if (!StaticPrefs::media_mediacapabilities_from_database()) {
return;
}
auto& decoder = GetDecoderData(TrackInfo::kVideoTrack);
if (decoder.GetCurrentInfo() && decoder.GetCurrentInfo()->GetAsVideoInfo()) {
VideoInfo info = *(decoder.GetCurrentInfo()->GetAsVideoInfo());

Просмотреть файл

@ -7,6 +7,7 @@
#include "DecoderBenchmark.h"
#include "mozilla/BenchmarkStorageChild.h"
#include "mozilla/media/MediaUtils.h"
#include "mozilla/StaticPrefs_media.h"
namespace mozilla {
@ -214,6 +215,10 @@ void DecoderBenchmark::CheckVersion(const nsACString& aDecoderName) {
return;
}
if (!StaticPrefs::media_mediacapabilities_from_database()) {
return;
}
nsCString name(aDecoderName);
int32_t version;
if (!DecoderVersionTable().Get(name, &version)) {