Bug 1473217 - Part 1: webspeech: Fix clang-tidy's misc-unused-raii warning. r?jesup
AutoNoJSAPI is an RAII class to put the JS engine in an unusable state and set the subject principal to System. Without a name, this AutoNoJSAPI is a temporary object that is destructed before GetUserMedia() is called, thus making the AutoNoJSAPI a no-op.
This AutoNoJSAPI was added in tab mirroring
bug 1088758, with comments from you in
bug 1088758 comment 5.
MozReview-Commit-ID: 9bY72LhSufn
--- a/dom/media/webspeech/recognition/SpeechRecognition.cpp
+++ b/dom/media/webspeech/recognition/SpeechRecognition.cpp
@@ -748,17 +748,17 @@ SpeechRecognition::Start(const Optional<
}
MediaStreamConstraints constraints;
constraints.mAudio.SetAsBoolean() = true;
if (aStream.WasPassed()) {
StartRecording(&aStream.Value());
} else {
- AutoNoJSAPI();
+ AutoNoJSAPI nojsapi;
MediaManager* manager = MediaManager::Get();
manager->GetUserMedia(GetOwner(),
constraints,
new GetUserMediaSuccessCallback(this),
new GetUserMediaErrorCallback(this),
aCallerType);
}