Bug 1390748 - Remove unnecessary includes in *Decoders. r=jwwang draft
authorChris Pearce <cpearce@mozilla.com>
Wed, 16 Aug 2017 17:19:39 +1200
changeset 648397 c9b0a0991d731b38d3f077f90cd4f79b6470fe38
parent 648396 b2e3f66a20f431b8a2b0dc88b65dd5da9433da2f
child 648398 4659a73a3f86121689ae71a6e9d25335d63fcd74
push id74750
push userbmo:cpearce@mozilla.com
push dateThu, 17 Aug 2017 18:50:24 +0000
reviewersjwwang
bugs1390748
milestone57.0a1
Bug 1390748 - Remove unnecessary includes in *Decoders. r=jwwang MozReview-Commit-ID: 3bfAdpopOfp
dom/media/ADTSDecoder.cpp
dom/media/ADTSDecoder.h
dom/media/flac/FlacDecoder.cpp
dom/media/flac/FlacDecoder.h
dom/media/fmp4/MP4Decoder.cpp
dom/media/fmp4/MP4Decoder.h
dom/media/mp3/MP3Decoder.cpp
dom/media/mp3/MP3Decoder.h
dom/media/ogg/OggDecoder.cpp
dom/media/ogg/OggDecoder.h
dom/media/wave/WaveDecoder.cpp
dom/media/wave/WaveDecoder.h
dom/media/wave/WaveDemuxer.cpp
dom/media/wave/WaveDemuxer.h
dom/media/webm/WebMDecoder.cpp
dom/media/webm/WebMDecoder.h
--- a/dom/media/ADTSDecoder.cpp
+++ b/dom/media/ADTSDecoder.cpp
@@ -1,16 +1,15 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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 "ADTSDecoder.h"
-#include "ADTSDemuxer.h"
 #include "MediaContainerType.h"
 #include "PDMFactory.h"
 
 namespace mozilla {
 
 /* static */ bool
 ADTSDecoder::IsEnabled()
 {
--- a/dom/media/ADTSDecoder.h
+++ b/dom/media/ADTSDecoder.h
@@ -2,18 +2,16 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 #ifndef ADTS_DECODER_H_
 #define ADTS_DECODER_H_
 
-#include "ChannelMediaDecoder.h"
-
 namespace mozilla {
 
 class MediaContainerType;
 
 class ADTSDecoder
 {
 public:
   // Returns true if the ADTS backend is pref'ed on, and we're running on a
--- a/dom/media/flac/FlacDecoder.cpp
+++ b/dom/media/flac/FlacDecoder.cpp
@@ -1,16 +1,15 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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 "FlacDecoder.h"
-#include "FlacDemuxer.h"
 #include "MediaContainerType.h"
 #include "MediaPrefs.h"
 
 namespace mozilla {
 
 /* static */ bool
 FlacDecoder::IsEnabled()
 {
--- a/dom/media/flac/FlacDecoder.h
+++ b/dom/media/flac/FlacDecoder.h
@@ -2,18 +2,16 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 
 #ifndef FLAC_DECODER_H_
 #define FLAC_DECODER_H_
 
-#include "ChannelMediaDecoder.h"
-
 namespace mozilla {
 
 class MediaContainerType;
 
 class FlacDecoder
 {
 public:
   // Returns true if the Flac backend is pref'ed on, and we're running on a
--- a/dom/media/fmp4/MP4Decoder.cpp
+++ b/dom/media/fmp4/MP4Decoder.cpp
@@ -3,29 +3,20 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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 "MP4Decoder.h"
 #include "MediaContainerType.h"
 #include "MediaFormatReader.h"
 #include "MP4Demuxer.h"
-#include "mozilla/Preferences.h"
-#include "nsCharSeparatedTokenizer.h"
-#include "mozilla/CDMProxy.h"
-#include "mozilla/Logging.h"
+#include "nsMimeTypes.h"
 #include "mozilla/SharedThreadPool.h"
-#include "nsMimeTypes.h"
 #include "VideoUtils.h"
 
-#ifdef MOZ_WIDGET_ANDROID
-#include "nsIGfxInfo.h"
-#endif
-#include "mozilla/layers/LayersTypes.h"
-
 #include "PDMFactory.h"
 
 namespace mozilla {
 
 static bool
 IsWhitelistedH264Codec(const nsAString& aCodec)
 {
   int16_t profile = 0, level = 0;
--- a/dom/media/fmp4/MP4Decoder.h
+++ b/dom/media/fmp4/MP4Decoder.h
@@ -1,23 +1,24 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim:set ts=2 sw=2 sts=2 et cindent: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 #if !defined(MP4Decoder_h_)
 #define MP4Decoder_h_
 
-#include "ChannelMediaDecoder.h"
+class nsACString;
 #include "mozilla/dom/Promise.h"
 #include "mozilla/layers/KnowsCompositor.h"
 
 namespace mozilla {
 
 class MediaContainerType;
+class DecoderDoctorDiagnostics;
 
 // Decoder that uses a bundled MP4 demuxer and platform decoders to play MP4.
 class MP4Decoder
 {
 public:
   // Returns true if aContainerType is an MP4 type that we think we can render
   // with the a platform decoder backend.
   // If provided, codecs are checked for support.
--- a/dom/media/mp3/MP3Decoder.cpp
+++ b/dom/media/mp3/MP3Decoder.cpp
@@ -1,19 +1,16 @@
-
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim:set ts=2 sw=2 sts=2 et cindent: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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 "MP3Decoder.h"
-
 #include "MediaContainerType.h"
-#include "MP3Demuxer.h"
 #include "PDMFactory.h"
 
 namespace mozilla {
 
 /* static */
 bool
 MP3Decoder::IsEnabled() {
   RefPtr<PDMFactory> platform = new PDMFactory();
--- a/dom/media/mp3/MP3Decoder.h
+++ b/dom/media/mp3/MP3Decoder.h
@@ -1,18 +1,16 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim:set ts=2 sw=2 sts=2 et cindent: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 #ifndef MP3Decoder_h_
 #define MP3Decoder_h_
 
-#include "ChannelMediaDecoder.h"
-
 namespace mozilla {
 
 class MediaContainerType;
 
 class MP3Decoder
 {
 public:
   // Returns true if the MP3 backend is preffed on, and we're running on a
--- a/dom/media/ogg/OggDecoder.cpp
+++ b/dom/media/ogg/OggDecoder.cpp
@@ -1,20 +1,18 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim:set ts=2 sw=2 sts=2 et cindent: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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 "OggDecoder.h"
 #include "MediaPrefs.h"
 #include "MediaContainerType.h"
-#include "MediaDecoderStateMachine.h"
-#include "MediaFormatReader.h"
-#include "OggDemuxer.h"
-#include "OggDecoder.h"
+#include "MediaDecoder.h"
 
 namespace mozilla {
 
 /* static */
 bool
 OggDecoder::IsSupportedType(const MediaContainerType& aContainerType)
 {
   if (!MediaPrefs::OggEnabled()) {
--- a/dom/media/ogg/OggDecoder.h
+++ b/dom/media/ogg/OggDecoder.h
@@ -1,18 +1,16 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim:set ts=2 sw=2 sts=2 et cindent: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 #if !defined(OggDecoder_h_)
 #define OggDecoder_h_
 
-#include "ChannelMediaDecoder.h"
-
 namespace mozilla {
 
 class MediaContainerType;
 
 class OggDecoder
 {
 public:
   // Returns true if aContainerType is an Ogg type that we think we can render
--- a/dom/media/wave/WaveDecoder.cpp
+++ b/dom/media/wave/WaveDecoder.cpp
@@ -1,18 +1,17 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim:set ts=2 sw=2 sts=2 et cindent: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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 "WaveDemuxer.h"
+#include "WaveDecoder.h"
 #include "MediaContainerType.h"
-#include "WaveDecoder.h"
-#include "PDMFactory.h"
+#include "MediaDecoder.h"
 
 namespace mozilla {
 
 /* static */ bool
 WaveDecoder::IsSupportedType(const MediaContainerType& aContainerType)
 {
   if (!MediaDecoder::IsWaveEnabled()) {
     return false;
--- a/dom/media/wave/WaveDecoder.h
+++ b/dom/media/wave/WaveDecoder.h
@@ -1,18 +1,16 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim:set ts=2 sw=2 sts=2 et cindent: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 #if !defined(WaveDecoder_h_)
 #define WaveDecoder_h_
 
-#include "ChannelMediaDecoder.h"
-
 namespace mozilla {
 
 class MediaContainerType;
 
 class WaveDecoder
 {
 public:
   // Returns true if the Wave backend is pref'ed on, and we're running on a
--- a/dom/media/wave/WaveDemuxer.cpp
+++ b/dom/media/wave/WaveDemuxer.cpp
@@ -6,24 +6,23 @@
 
 #include "WaveDemuxer.h"
 
 #include <inttypes.h>
 #include <algorithm>
 
 #include "mozilla/Assertions.h"
 #include "mozilla/EndianUtils.h"
+#include "mp4_demuxer/ByteReader.h"
 #include "nsAutoPtr.h"
 #include "VideoUtils.h"
 #include "TimeUnits.h"
-#include "prenv.h"
 
 using mozilla::media::TimeUnit;
 using mozilla::media::TimeIntervals;
-using mp4_demuxer::ByteReader;
 
 namespace mozilla {
 
 // WAVDemuxer
 
 WAVDemuxer::WAVDemuxer(MediaResource* aSource)
   : mSource(aSource)
 {
--- a/dom/media/wave/WaveDemuxer.h
+++ b/dom/media/wave/WaveDemuxer.h
@@ -1,21 +1,21 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * Licence, 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/. */
 
 #ifndef WAV_DEMUXER_H_
 #define WAV_DEMUXER_H_
 
-#include "mozilla/Attributes.h"
-#include "mozilla/Maybe.h"
 #include "MediaDataDemuxer.h"
 #include "MediaResource.h"
-#include "mp4_demuxer/ByteReader.h"
 
+namespace mp4_demuxer {
+class ByteReader;
+}
 using mp4_demuxer::ByteReader;
 
 namespace mozilla {
 
 static const uint32_t FRMT_CODE = 0x666d7420;
 static const uint32_t DATA_CODE = 0x64617461;
 static const uint32_t LIST_CODE = 0x4c495354;
 static const uint32_t INFO_CODE = 0x494e464f;
--- a/dom/media/webm/WebMDecoder.cpp
+++ b/dom/media/webm/WebMDecoder.cpp
@@ -1,23 +1,20 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim:set ts=2 sw=2 sts=2 et cindent: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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 "WebMDecoder.h"
 #include "mozilla/Preferences.h"
 #ifdef MOZ_AV1
 #include "AOMDecoder.h"
 #endif
 #include "MediaContainerType.h"
-#include "MediaFormatReader.h"
-#include "WebMDemuxer.h"
-#include "WebMDecoder.h"
-#include "VideoUtils.h"
 
 namespace mozilla {
 
 /* static */
 bool
 WebMDecoder::IsSupportedType(const MediaContainerType& aContainerType)
 {
   if (!Preferences::GetBool("media.webm.enabled")) {
--- a/dom/media/webm/WebMDecoder.h
+++ b/dom/media/webm/WebMDecoder.h
@@ -1,18 +1,16 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim:set ts=2 sw=2 sts=2 et cindent: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * 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/. */
 #if !defined(WebMDecoder_h_)
 #define WebMDecoder_h_
 
-#include "ChannelMediaDecoder.h"
-
 namespace mozilla {
 
 class MediaContainerType;
 
 class WebMDecoder
 {
 public: