Bug 1541298 - Fix SpeechRecognition static-analysis warnings. r=jib
authorAndreas Pehrson <apehrson@mozilla.com>
Fri, 12 Apr 2019 11:34:46 +0000
changeset 469263 85272d58ac1a65a2e03c78c0ffb6ba8134f38b8f
parent 469262 3119da540c3170ee981b575fef593c3bcf8b6eaa
child 469264 4b8cb5cb5d7a841bf3761868a96313a2fa1ce71e
push id112776
push usershindli@mozilla.com
push dateFri, 12 Apr 2019 16:20:17 +0000
treeherdermozilla-inbound@b4501ced5619 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjib
bugs1541298
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1541298 - Fix SpeechRecognition static-analysis warnings. r=jib This ignores warnings in endpointer.cc/h and energy_endpointer.cc/h as they appear to be from Chromium. Differential Revision: https://phabricator.services.mozilla.com/D26725
dom/media/webspeech/recognition/SpeechGrammar.cpp
dom/media/webspeech/recognition/SpeechGrammarList.cpp
dom/media/webspeech/recognition/SpeechRecognition.h
dom/media/webspeech/recognition/SpeechRecognitionAlternative.cpp
dom/media/webspeech/recognition/SpeechRecognitionResult.cpp
dom/media/webspeech/recognition/SpeechRecognitionResultList.cpp
dom/media/webspeech/recognition/test/FakeSpeechRecognitionService.cpp
--- a/dom/media/webspeech/recognition/SpeechGrammar.cpp
+++ b/dom/media/webspeech/recognition/SpeechGrammar.cpp
@@ -16,17 +16,17 @@ NS_IMPL_CYCLE_COLLECTING_ADDREF(SpeechGr
 NS_IMPL_CYCLE_COLLECTING_RELEASE(SpeechGrammar)
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(SpeechGrammar)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
   NS_INTERFACE_MAP_ENTRY(nsISupports)
 NS_INTERFACE_MAP_END
 
 SpeechGrammar::SpeechGrammar(nsISupports* aParent) : mParent(aParent) {}
 
-SpeechGrammar::~SpeechGrammar() {}
+SpeechGrammar::~SpeechGrammar() = default;
 
 already_AddRefed<SpeechGrammar> SpeechGrammar::Constructor(
     const GlobalObject& aGlobal, ErrorResult& aRv) {
   RefPtr<SpeechGrammar> speechGrammar =
       new SpeechGrammar(aGlobal.GetAsSupports());
   return speechGrammar.forget();
 }
 
--- a/dom/media/webspeech/recognition/SpeechGrammarList.cpp
+++ b/dom/media/webspeech/recognition/SpeechGrammarList.cpp
@@ -19,17 +19,17 @@ NS_IMPL_CYCLE_COLLECTING_ADDREF(SpeechGr
 NS_IMPL_CYCLE_COLLECTING_RELEASE(SpeechGrammarList)
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(SpeechGrammarList)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
   NS_INTERFACE_MAP_ENTRY(nsISupports)
 NS_INTERFACE_MAP_END
 
 SpeechGrammarList::SpeechGrammarList(nsISupports* aParent) : mParent(aParent) {}
 
-SpeechGrammarList::~SpeechGrammarList() {}
+SpeechGrammarList::~SpeechGrammarList() = default;
 
 already_AddRefed<SpeechGrammarList> SpeechGrammarList::Constructor(
     const GlobalObject& aGlobal, ErrorResult& aRv) {
   RefPtr<SpeechGrammarList> speechGrammarList =
       new SpeechGrammarList(aGlobal.GetAsSupports());
   return speechGrammarList.forget();
 }
 
--- a/dom/media/webspeech/recognition/SpeechRecognition.h
+++ b/dom/media/webspeech/recognition/SpeechRecognition.h
@@ -232,17 +232,17 @@ class SpeechRecognition final : public D
   // while for a 0 value returning no SpeechRecognitionAlternative per result is
   // a conforming implementation.
   uint32_t mMaxAlternatives;
 
   void ProcessTestEventRequest(nsISupports* aSubject,
                                const nsAString& aEventName);
 
   const char* GetName(FSMState aId);
-  const char* GetName(SpeechEvent* aId);
+  const char* GetName(SpeechEvent* aEvent);
 };
 
 class SpeechEvent : public Runnable {
  public:
   SpeechEvent(SpeechRecognition* aRecognition,
               SpeechRecognition::EventType aType);
 
   ~SpeechEvent();
--- a/dom/media/webspeech/recognition/SpeechRecognitionAlternative.cpp
+++ b/dom/media/webspeech/recognition/SpeechRecognitionAlternative.cpp
@@ -20,17 +20,17 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
   NS_INTERFACE_MAP_ENTRY(nsISupports)
 NS_INTERFACE_MAP_END
 
 SpeechRecognitionAlternative::SpeechRecognitionAlternative(
     SpeechRecognition* aParent)
     : mConfidence(0), mParent(aParent) {}
 
-SpeechRecognitionAlternative::~SpeechRecognitionAlternative() {}
+SpeechRecognitionAlternative::~SpeechRecognitionAlternative() = default;
 
 JSObject* SpeechRecognitionAlternative::WrapObject(
     JSContext* aCx, JS::Handle<JSObject*> aGivenProto) {
   return SpeechRecognitionAlternative_Binding::Wrap(aCx, this, aGivenProto);
 }
 
 nsISupports* SpeechRecognitionAlternative::GetParentObject() const {
   return static_cast<DOMEventTargetHelper*>(mParent.get());
--- a/dom/media/webspeech/recognition/SpeechRecognitionResult.cpp
+++ b/dom/media/webspeech/recognition/SpeechRecognitionResult.cpp
@@ -18,17 +18,17 @@ NS_IMPL_CYCLE_COLLECTING_RELEASE(SpeechR
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(SpeechRecognitionResult)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
   NS_INTERFACE_MAP_ENTRY(nsISupports)
 NS_INTERFACE_MAP_END
 
 SpeechRecognitionResult::SpeechRecognitionResult(SpeechRecognition* aParent)
     : mParent(aParent) {}
 
-SpeechRecognitionResult::~SpeechRecognitionResult() {}
+SpeechRecognitionResult::~SpeechRecognitionResult() = default;
 
 JSObject* SpeechRecognitionResult::WrapObject(
     JSContext* aCx, JS::Handle<JSObject*> aGivenProto) {
   return SpeechRecognitionResult_Binding::Wrap(aCx, this, aGivenProto);
 }
 
 nsISupports* SpeechRecognitionResult::GetParentObject() const {
   return static_cast<DOMEventTargetHelper*>(mParent.get());
--- a/dom/media/webspeech/recognition/SpeechRecognitionResultList.cpp
+++ b/dom/media/webspeech/recognition/SpeechRecognitionResultList.cpp
@@ -21,17 +21,17 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
   NS_INTERFACE_MAP_ENTRY(nsISupports)
 NS_INTERFACE_MAP_END
 
 SpeechRecognitionResultList::SpeechRecognitionResultList(
     SpeechRecognition* aParent)
     : mParent(aParent) {}
 
-SpeechRecognitionResultList::~SpeechRecognitionResultList() {}
+SpeechRecognitionResultList::~SpeechRecognitionResultList() = default;
 
 nsISupports* SpeechRecognitionResultList::GetParentObject() const {
   return static_cast<DOMEventTargetHelper*>(mParent.get());
 }
 
 JSObject* SpeechRecognitionResultList::WrapObject(
     JSContext* aCx, JS::Handle<JSObject*> aGivenProto) {
   return SpeechRecognitionResultList_Binding::Wrap(aCx, this, aGivenProto);
--- a/dom/media/webspeech/recognition/test/FakeSpeechRecognitionService.cpp
+++ b/dom/media/webspeech/recognition/test/FakeSpeechRecognitionService.cpp
@@ -18,19 +18,19 @@
 
 namespace mozilla {
 
 using namespace dom;
 
 NS_IMPL_ISUPPORTS(FakeSpeechRecognitionService, nsISpeechRecognitionService,
                   nsIObserver)
 
-FakeSpeechRecognitionService::FakeSpeechRecognitionService() {}
+FakeSpeechRecognitionService::FakeSpeechRecognitionService() = default;
 
-FakeSpeechRecognitionService::~FakeSpeechRecognitionService() {}
+FakeSpeechRecognitionService::~FakeSpeechRecognitionService() = default;
 
 NS_IMETHODIMP
 FakeSpeechRecognitionService::Initialize(
     WeakPtr<SpeechRecognition> aSpeechRecognition) {
   mRecognition = aSpeechRecognition;
   nsCOMPtr<nsIObserverService> obs = services::GetObserverService();
   obs->AddObserver(this, SPEECH_RECOGNITION_TEST_EVENT_REQUEST_TOPIC, false);
   obs->AddObserver(this, SPEECH_RECOGNITION_TEST_END_TOPIC, false);