From ba0d878e47d8711e57cb425d6fc367b5abcf2810 Mon Sep 17 00:00:00 2001 From: alwu Date: Tue, 24 Sep 2019 06:55:29 +0000 Subject: [PATCH] Bug 1580659 - part1 : use AudioChannelAgent directly. r=chunmin `nsIAudioChannelAgent` was created a common interface for a usage of in both js and C++ before, now we have no any JS code would use `nsIAudioChannelAgent`, it's only used in C++ code. Therefore, in a coming refactoring (bug1580662), we will remove `nsIAudioChannelAgent` and use `AudioChannelAgent` as the only interface. Here we can make these classes start to reference `AudioChannelAgent`, instead of `nsIAudioChannelAgent`. Differential Revision: https://phabricator.services.mozilla.com/D45748 --HG-- extra : moz-landing-system : lando --- dom/media/webaudio/AudioDestinationNode.cpp | 1 - dom/media/webaudio/AudioDestinationNode.h | 4 ++-- dom/media/webspeech/synth/nsSpeechTask.cpp | 1 - dom/media/webspeech/synth/nsSpeechTask.h | 4 ++-- dom/plugins/base/nsNPAPIPluginInstance.cpp | 1 - dom/plugins/base/nsNPAPIPluginInstance.h | 4 ++-- 6 files changed, 6 insertions(+), 9 deletions(-) diff --git a/dom/media/webaudio/AudioDestinationNode.cpp b/dom/media/webaudio/AudioDestinationNode.cpp index 696f0f6f6b1a..eff864080988 100644 --- a/dom/media/webaudio/AudioDestinationNode.cpp +++ b/dom/media/webaudio/AudioDestinationNode.cpp @@ -13,7 +13,6 @@ #include "mozilla/dom/OfflineAudioCompletionEvent.h" #include "mozilla/dom/ScriptSettings.h" #include "mozilla/dom/BaseAudioContextBinding.h" -#include "AudioChannelAgent.h" #include "AudioChannelService.h" #include "AudioNodeEngine.h" #include "AudioNodeStream.h" diff --git a/dom/media/webaudio/AudioDestinationNode.h b/dom/media/webaudio/AudioDestinationNode.h index 096c11a3ba2f..c37e6533b524 100644 --- a/dom/media/webaudio/AudioDestinationNode.h +++ b/dom/media/webaudio/AudioDestinationNode.h @@ -9,7 +9,7 @@ #include "AudioChannelService.h" #include "AudioNode.h" -#include "nsIAudioChannelAgent.h" +#include "AudioChannelAgent.h" #include "mozilla/TimeStamp.h" namespace mozilla { @@ -80,7 +80,7 @@ class AudioDestinationNode final : public AudioNode, SelfReference mOfflineRenderingRef; uint32_t mFramesToProduce; - nsCOMPtr mAudioChannelAgent; + RefPtr mAudioChannelAgent; RefPtr mCaptureStreamPort; RefPtr mOfflineRenderingPromise; diff --git a/dom/media/webspeech/synth/nsSpeechTask.cpp b/dom/media/webspeech/synth/nsSpeechTask.cpp index 8afcaf3be774..9acecb3c5970 100644 --- a/dom/media/webspeech/synth/nsSpeechTask.cpp +++ b/dom/media/webspeech/synth/nsSpeechTask.cpp @@ -4,7 +4,6 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include "AudioChannelAgent.h" #include "AudioChannelService.h" #include "AudioSegment.h" #include "nsSpeechTask.h" diff --git a/dom/media/webspeech/synth/nsSpeechTask.h b/dom/media/webspeech/synth/nsSpeechTask.h index a1ceecce08d3..a1d46228f017 100644 --- a/dom/media/webspeech/synth/nsSpeechTask.h +++ b/dom/media/webspeech/synth/nsSpeechTask.h @@ -8,7 +8,7 @@ #define mozilla_dom_nsSpeechTask_h #include "SpeechSynthesisUtterance.h" -#include "nsIAudioChannelAgent.h" +#include "AudioChannelAgent.h" #include "nsISpeechService.h" namespace mozilla { @@ -109,7 +109,7 @@ class nsSpeechTask : public nsISpeechTask, nsCOMPtr mCallback; - nsCOMPtr mAudioChannelAgent; + RefPtr mAudioChannelAgent; RefPtr mSpeechSynthesis; diff --git a/dom/plugins/base/nsNPAPIPluginInstance.cpp b/dom/plugins/base/nsNPAPIPluginInstance.cpp index 9063ac74857b..e9ea6ef4e38a 100644 --- a/dom/plugins/base/nsNPAPIPluginInstance.cpp +++ b/dom/plugins/base/nsNPAPIPluginInstance.cpp @@ -34,7 +34,6 @@ #include "nsILoadContext.h" #include "mozilla/dom/Element.h" #include "mozilla/dom/HTMLObjectElementBinding.h" -#include "AudioChannelAgent.h" #include "AudioChannelService.h" using namespace mozilla; diff --git a/dom/plugins/base/nsNPAPIPluginInstance.h b/dom/plugins/base/nsNPAPIPluginInstance.h index f1a58cd59522..408ac97ea0d0 100644 --- a/dom/plugins/base/nsNPAPIPluginInstance.h +++ b/dom/plugins/base/nsNPAPIPluginInstance.h @@ -17,7 +17,7 @@ #include "nsHashKeys.h" #include #include "js/TypeDecls.h" -#include "nsIAudioChannelAgent.h" +#include "AudioChannelAgent.h" #include "mozilla/EventForwards.h" #include "mozilla/TimeStamp.h" @@ -297,7 +297,7 @@ class nsNPAPIPluginInstance final char** mCachedParamNames; char** mCachedParamValues; - nsCOMPtr mAudioChannelAgent; + RefPtr mAudioChannelAgent; bool mMuted; };