Bug 1825233 - Cut SpeechSynthesis over to RFPTarget. r=tjr

Differential Revision: https://phabricator.services.mozilla.com/D173944
This commit is contained in:
Tom Schuster 2023-03-31 07:53:08 +00:00
Родитель 87bb7d04d6
Коммит 0c70ea0a2f
3 изменённых файлов: 8 добавлений и 3 удалений

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

@ -225,7 +225,8 @@ void SpeechSynthesis::GetVoices(
nsCOMPtr<nsPIDOMWindowInner> window = GetOwner();
nsCOMPtr<nsIDocShell> docShell = window ? window->GetDocShell() : nullptr;
if (nsContentUtils::ShouldResistFingerprinting(docShell)) {
if (nsContentUtils::ShouldResistFingerprinting(docShell,
RFPTarget::SpeechSynthesis)) {
return;
}
@ -298,7 +299,8 @@ SpeechSynthesis::Observe(nsISupports* aSubject, const char* aTopic,
nsCOMPtr<nsPIDOMWindowInner> window = GetOwner();
nsCOMPtr<nsIDocShell> docShell = window ? window->GetDocShell() : nullptr;
if (!nsContentUtils::ShouldResistFingerprinting(docShell)) {
if (!nsContentUtils::ShouldResistFingerprinting(
docShell, RFPTarget::SpeechSynthesis)) {
DispatchTrustedEvent(u"voiceschanged"_ns);
// If we have a pending item, and voices become available, speak it.
if (!mCurrentTask && !mHoldQueue && HasVoices()) {

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

@ -35,7 +35,8 @@ SpeechSynthesisUtterance::SpeechSynthesisUtterance(
mPitch(1),
mPaused(false),
mShouldResistFingerprinting(
aOwnerWindow->AsGlobal()->ShouldResistFingerprinting()) {}
aOwnerWindow->AsGlobal()->ShouldResistFingerprinting(
RFPTarget::SpeechSynthesis)) {}
SpeechSynthesisUtterance::~SpeechSynthesisUtterance() = default;

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

@ -8,6 +8,8 @@ ITEM_VALUE(TouchEvents, 0x0001)
ITEM_VALUE(ScreenOrientation, 0x0005)
// SpeechSynthesis part of the Web Speech API
ITEM_VALUE(SpeechSynthesis, 0x0006)
/*
* Certain classes (Document, at time of writing) have a cached value for