Bug 1368907 - Part6 - Modify the corresponding native code callers. r=jolin
authorJames Cheng <jacheng@mozilla.com>
Mon, 12 Jun 2017 16:54:19 +0800
changeset 363683 955bb796fd65c00b46165473609ede86629076c4
parent 363682 9f8e9e56f886a9fbfa99d9001404cc3923298b10
child 363684 fd4fd34fbbf9bf20f385e0fda914338274e44d2b
push id32023
push userkwierso@gmail.com
push dateWed, 14 Jun 2017 01:09:52 +0000
treeherdermozilla-central@6bea8e940b9c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjolin
bugs1368907
milestone56.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 1368907 - Part6 - Modify the corresponding native code callers. r=jolin MozReview-Commit-ID: KUa1EjdwE4B
dom/media/hls/HLSDemuxer.cpp
dom/media/hls/HLSDemuxer.h
dom/media/hls/HLSResource.cpp
dom/media/hls/HLSResource.h
--- a/dom/media/hls/HLSDemuxer.cpp
+++ b/dom/media/hls/HLSDemuxer.cpp
@@ -54,94 +54,94 @@ mozilla::StereoMode getStereoMode(int aM
       return mozilla::StereoMode::TOP_BOTTOM;
     case 2:
       return mozilla::StereoMode::LEFT_RIGHT;
     default:
       return mozilla::StereoMode::MONO;
   }
 }
 
-// HlsDemuxerCallbacksSupport is a native implemented callback class for
-// HlsDemuxerCallbacks in GeckoHlsDemuxerWrapper.java.
+// HLSDemuxerCallbacksSupport is a native implemented callback class for
+// Callbacks in GeckoHLSDemuxerWrapper.java.
 // The callback functions will be invoked by JAVA-side thread.
 // Should dispatch the task to the demuxer's task queue.
 // We ensure the callback will never be invoked after
-// HlsDemuxerCallbacksSupport::DisposeNative has been called in ~HLSDemuxer.
-class HLSDemuxer::HlsDemuxerCallbacksSupport
- : public GeckoHlsDemuxerWrapper::HlsDemuxerCallbacks::Natives<HlsDemuxerCallbacksSupport>
+// HLSDemuxerCallbacksSupport::DisposeNative has been called in ~HLSDemuxer.
+class HLSDemuxer::HLSDemuxerCallbacksSupport
+ : public GeckoHLSDemuxerWrapper::Callbacks::Natives<HLSDemuxerCallbacksSupport>
 {
-  NS_INLINE_DECL_THREADSAFE_REFCOUNTING(HlsDemuxerCallbacksSupport)
+  NS_INLINE_DECL_THREADSAFE_REFCOUNTING(HLSDemuxerCallbacksSupport)
 public:
-  typedef GeckoHlsDemuxerWrapper::HlsDemuxerCallbacks::Natives<HlsDemuxerCallbacksSupport> NativeCallbacks;
+  typedef GeckoHLSDemuxerWrapper::Callbacks::Natives<HLSDemuxerCallbacksSupport> NativeCallbacks;
   using NativeCallbacks::DisposeNative;
   using NativeCallbacks::AttachNative;
 
-  HlsDemuxerCallbacksSupport(HLSDemuxer* aDemuxer)
-    : mMutex("HlsDemuxerCallbacksSupport")
+  HLSDemuxerCallbacksSupport(HLSDemuxer* aDemuxer)
+    : mMutex("HLSDemuxerCallbacksSupport")
     , mDemuxer(aDemuxer)
   {
     MOZ_ASSERT(mDemuxer);
   }
 
   void OnInitialized(bool aHasAudio, bool aHasVideo)
   {
-    HLS_DEBUG("HlsDemuxerCallbacksSupport",
+    HLS_DEBUG("HLSDemuxerCallbacksSupport",
               "OnInitialized");
     MutexAutoLock lock(mMutex);
     if (!mDemuxer) { return; }
-    RefPtr<HlsDemuxerCallbacksSupport> self = this;
+    RefPtr<HLSDemuxerCallbacksSupport> self = this;
     mDemuxer->GetTaskQueue()->Dispatch(NS_NewRunnableFunction(
      [=] () {
        MutexAutoLock lock(self->mMutex);
        if (self->mDemuxer) {
          self->mDemuxer->OnInitialized(aHasAudio, aHasVideo);
        }
      }));
   }
 
   // TODO: Handle the unexpected error signal from the java implementation
   // in bug 1368904.
   void OnError(int aErrorCode)
   {
-    HLS_DEBUG("HlsDemuxerCallbacksSupport",
+    HLS_DEBUG("HLSDemuxerCallbacksSupport",
               "Got error(%d) from java side",
               aErrorCode);
   }
   void Detach()
   {
     MutexAutoLock lock(mMutex);
     mDemuxer = nullptr;
   }
 
   Mutex mMutex;
 private:
-  ~HlsDemuxerCallbacksSupport() { }
+  ~HLSDemuxerCallbacksSupport() { }
   HLSDemuxer* mDemuxer;
 
 };
 
 HLSDemuxer::HLSDemuxer(MediaResource* aResource)
   : mResource(aResource)
   , mTaskQueue(new AutoTaskQueue(GetMediaThreadPool(MediaThreadType::PLAYBACK),
                                  /* aSupportsTailDispatch = */ false))
   , mMutex("HLSDemuxer")
 {
   MOZ_ASSERT(NS_IsMainThread());
   MOZ_ASSERT(aResource);
-  HlsDemuxerCallbacksSupport::Init();
-  mJavaCallbacks = GeckoHlsDemuxerWrapper::HlsDemuxerCallbacks::New();
+  HLSDemuxerCallbacksSupport::Init();
+  mJavaCallbacks = GeckoHLSDemuxerWrapper::Callbacks::New();
   MOZ_ASSERT(mJavaCallbacks);
 
-  mCallbackSupport = new HlsDemuxerCallbacksSupport(this);
-  HlsDemuxerCallbacksSupport::AttachNative(mJavaCallbacks,
+  mCallbackSupport = new HLSDemuxerCallbacksSupport(this);
+  HLSDemuxerCallbacksSupport::AttachNative(mJavaCallbacks,
                                            mCallbackSupport);
 
   auto resourceWrapper = static_cast<HLSResource*>(aResource)->GetResourceWrapper();
-  mHlsDemuxerWrapper = GeckoHlsDemuxerWrapper::Create(resourceWrapper->GetPlayer(), mJavaCallbacks);
-  MOZ_ASSERT(mHlsDemuxerWrapper);
+  mHLSDemuxerWrapper = GeckoHLSDemuxerWrapper::Create(resourceWrapper->GetPlayer(), mJavaCallbacks);
+  MOZ_ASSERT(mHLSDemuxerWrapper);
 }
 
 void
 HLSDemuxer::OnInitialized(bool aHasAudio, bool aHasVideo)
 {
   MOZ_ASSERT(OnTaskQueue());
 
   if (aHasAudio) {
@@ -185,36 +185,36 @@ HLSDemuxer::HasTrackType(TrackType aType
   }
 }
 
 uint32_t
 HLSDemuxer::GetNumberTracks(TrackType aType) const
 {
   switch (aType) {
     case TrackType::kAudioTrack:
-      return mHlsDemuxerWrapper->GetNumberOfTracks(TrackType::kAudioTrack);
+      return mHLSDemuxerWrapper->GetNumberOfTracks(TrackType::kAudioTrack);
     case TrackType::kVideoTrack:
-      return mHlsDemuxerWrapper->GetNumberOfTracks(TrackType::kVideoTrack);
+      return mHLSDemuxerWrapper->GetNumberOfTracks(TrackType::kVideoTrack);
     default:
       return 0;
   }
 }
 
 already_AddRefed<MediaTrackDemuxer>
 HLSDemuxer::GetTrackDemuxer(TrackType aType, uint32_t aTrackNumber)
 {
   RefPtr<HLSTrackDemuxer> e = new HLSTrackDemuxer(this, aType);
   mDemuxers.AppendElement(e);
   return e.forget();
 }
 
 bool
 HLSDemuxer::IsSeekable() const
 {
-  return !mHlsDemuxerWrapper->IsLiveStream();
+  return !mHLSDemuxerWrapper->IsLiveStream();
 }
 
 UniquePtr<EncryptionInfo>
 HLSDemuxer::GetCrypto()
 {
   // TODO: Currently, our HLS implementation doesn't support encrypted content.
   // Return null at this stage.
   return nullptr;
@@ -234,28 +234,28 @@ HLSDemuxer::GetTrackInfo(TrackType aTrac
     default:
       return nullptr;
   }
 }
 
 TimeUnit
 HLSDemuxer::GetNextKeyFrameTime()
 {
-  MOZ_ASSERT(mHlsDemuxerWrapper);
-  return TimeUnit::FromMicroseconds(mHlsDemuxerWrapper->GetNextKeyFrameTime());
+  MOZ_ASSERT(mHLSDemuxerWrapper);
+  return TimeUnit::FromMicroseconds(mHLSDemuxerWrapper->GetNextKeyFrameTime());
 }
 
 void
 HLSDemuxer::UpdateAudioInfo(int index)
 {
   MOZ_ASSERT(OnTaskQueue());
-  MOZ_ASSERT(mHlsDemuxerWrapper);
+  MOZ_ASSERT(mHLSDemuxerWrapper);
   HLS_DEBUG("HLSDemuxer", "UpdateAudioInfo (%d)", index);
   MutexAutoLock lock(mMutex);
-  jni::Object::LocalRef infoObj = mHlsDemuxerWrapper->GetAudioInfo(index);
+  jni::Object::LocalRef infoObj = mHLSDemuxerWrapper->GetAudioInfo(index);
   if (infoObj) {
     java::GeckoAudioInfo::LocalRef audioInfo(Move(infoObj));
     mInfo.mAudio.mRate = audioInfo->Rate();
     mInfo.mAudio.mChannels = audioInfo->Channels();
     mInfo.mAudio.mProfile = audioInfo->Profile();
     mInfo.mAudio.mBitDepth = audioInfo->BitDepth();
     mInfo.mAudio.mMimeType = NS_ConvertUTF16toUTF8(audioInfo->MimeType()->ToString());
     mInfo.mAudio.mDuration = TimeUnit::FromMicroseconds(audioInfo->Duration());
@@ -265,19 +265,19 @@ HLSDemuxer::UpdateAudioInfo(int index)
                                                       csd.Length());
   }
 }
 
 void
 HLSDemuxer::UpdateVideoInfo(int index)
 {
   MOZ_ASSERT(OnTaskQueue());
-  MOZ_ASSERT(mHlsDemuxerWrapper);
+  MOZ_ASSERT(mHLSDemuxerWrapper);
   MutexAutoLock lock(mMutex);
-  jni::Object::LocalRef infoObj = mHlsDemuxerWrapper->GetVideoInfo(index);
+  jni::Object::LocalRef infoObj = mHLSDemuxerWrapper->GetVideoInfo(index);
   if (infoObj) {
     java::GeckoVideoInfo::LocalRef videoInfo(Move(infoObj));
     mInfo.mVideo.mStereoMode = getStereoMode(videoInfo->StereoMode());
     mInfo.mVideo.mRotation = getVideoInfoRotation(videoInfo->Rotation());
     mInfo.mVideo.mImage.width = videoInfo->DisplayWidth();
     mInfo.mVideo.mImage.height = videoInfo->DisplayHeight();
     mInfo.mVideo.mDisplay.width = videoInfo->PictureWidth();
     mInfo.mVideo.mDisplay.height = videoInfo->PictureHeight();
@@ -295,22 +295,22 @@ HLSDemuxer::OnTaskQueue() const
   return mTaskQueue->IsCurrentThreadIn();
 }
 
 HLSDemuxer::~HLSDemuxer()
 {
   HLS_DEBUG("HLSDemuxer", "~HLSDemuxer()");
   mCallbackSupport->Detach();
   if (mJavaCallbacks) {
-    HlsDemuxerCallbacksSupport::DisposeNative(mJavaCallbacks);
+    HLSDemuxerCallbacksSupport::DisposeNative(mJavaCallbacks);
     mJavaCallbacks = nullptr;
   }
-  if (mHlsDemuxerWrapper) {
-    mHlsDemuxerWrapper->Destroy();
-    mHlsDemuxerWrapper = nullptr;
+  if (mHLSDemuxerWrapper) {
+    mHLSDemuxerWrapper->Destroy();
+    mHLSDemuxerWrapper = nullptr;
   }
   mInitPromise.RejectIfExists(NS_ERROR_DOM_MEDIA_CANCELED, __func__);
 }
 
 HLSTrackDemuxer::HLSTrackDemuxer(HLSDemuxer* aParent, TrackInfo::TrackType aType)
   : mParent(aParent)
   , mType(aType)
 {
@@ -335,17 +335,17 @@ HLSTrackDemuxer::Seek(const TimeUnit& aT
 
 RefPtr<HLSTrackDemuxer::SeekPromise>
 HLSTrackDemuxer::DoSeek(const TimeUnit& aTime)
 {
   MOZ_ASSERT(mParent, "Called after BreackCycle()");
   MOZ_ASSERT(mParent->OnTaskQueue());
   mQueuedSample = nullptr;
   int64_t seekTimeUs = aTime.ToMicroseconds();
-  bool result = mParent->mHlsDemuxerWrapper->Seek(seekTimeUs);
+  bool result = mParent->mHLSDemuxerWrapper->Seek(seekTimeUs);
   if (!result) {
     return SeekPromise::CreateAndReject(NS_ERROR_DOM_MEDIA_WAITING_FOR_DATA,
                                         __func__);
   }
   TimeUnit seekTime = TimeUnit::FromMicroseconds(seekTimeUs);
   return SeekPromise::CreateAndResolve(seekTime, __func__);
 }
 
@@ -379,26 +379,26 @@ HLSTrackDemuxer::DoGetSamples(int32_t aN
     aNumSamples--;
   }
   if (aNumSamples == 0) {
     // Return the queued sample.
     return SamplesPromise::CreateAndResolve(samples, __func__);
   }
   mozilla::jni::ObjectArray::LocalRef demuxedSamples =
     (mType == TrackInfo::kAudioTrack)
-    ? mParent->mHlsDemuxerWrapper->GetSamples(TrackInfo::kAudioTrack, aNumSamples)
-    : mParent->mHlsDemuxerWrapper->GetSamples(TrackInfo::kVideoTrack, aNumSamples);
+    ? mParent->mHLSDemuxerWrapper->GetSamples(TrackInfo::kAudioTrack, aNumSamples)
+    : mParent->mHLSDemuxerWrapper->GetSamples(TrackInfo::kVideoTrack, aNumSamples);
   nsTArray<jni::Object::LocalRef> sampleObjectArray(demuxedSamples->GetElements());
 
   if (sampleObjectArray.IsEmpty()) {
     return SamplesPromise::CreateAndReject(NS_ERROR_DOM_MEDIA_WAITING_FOR_DATA, __func__);
   }
 
   for (auto&& demuxedSample : sampleObjectArray) {
-    java::GeckoHlsSample::LocalRef sample(Move(demuxedSample));
+    java::GeckoHLSSample::LocalRef sample(Move(demuxedSample));
     if (sample->IsEOS()) {
       HLS_DEBUG("HLSTrackDemuxer", "Met BUFFER_FLAG_END_OF_STREAM.");
       if (samples->mSamples.IsEmpty()) {
         return SamplesPromise::CreateAndReject(NS_ERROR_DOM_MEDIA_END_OF_STREAM,
                                                __func__);
       }
       mQueuedSample = new MediaRawData();
       mQueuedSample->mEOS = true;
@@ -491,17 +491,17 @@ HLSTrackDemuxer::ExtractCryptoSample(siz
   } while (false);
 
   HLS_DEBUG("HLSTrackDemuxer",
             "%s", msg);
   return CryptoSample{};
 }
 
 RefPtr<MediaRawData>
-HLSTrackDemuxer::ConvertToMediaRawData(java::GeckoHlsSample::LocalRef aSample)
+HLSTrackDemuxer::ConvertToMediaRawData(java::GeckoHLSSample::LocalRef aSample)
 {
   java::sdk::BufferInfo::LocalRef info = aSample->Info();
   // Currently extract PTS, Size and Data without Crypto information.
   // Transform java Sample into MediaRawData
   RefPtr<MediaRawData> mrd = new MediaRawData();
   int64_t presentationTimeUs = 0;
   bool ok = NS_SUCCEEDED(info->PresentationTimeUs(&presentationTimeUs));
   mrd->mTime = TimeUnit::FromMicroseconds(presentationTimeUs);
@@ -591,24 +591,24 @@ HLSTrackDemuxer::DoSkipToNextRandomAcces
   MOZ_ASSERT(mParent, "Called after BreackCycle()");
   MOZ_ASSERT(mParent->OnTaskQueue());
   mQueuedSample = nullptr;
   uint32_t parsed = 0;
   bool found = false;
   MediaResult result = NS_ERROR_DOM_MEDIA_END_OF_STREAM;
   do {
     mozilla::jni::ObjectArray::LocalRef demuxedSamples =
-      mParent->mHlsDemuxerWrapper->GetSamples(mType, 1);
+      mParent->mHLSDemuxerWrapper->GetSamples(mType, 1);
     nsTArray<jni::Object::LocalRef> sampleObjectArray(demuxedSamples->GetElements());
     if (sampleObjectArray.IsEmpty()) {
       result = NS_ERROR_DOM_MEDIA_WAITING_FOR_DATA;
       break;
     }
     parsed++;
-    java::GeckoHlsSample::LocalRef sample(Move(sampleObjectArray[0]));
+    java::GeckoHLSSample::LocalRef sample(Move(sampleObjectArray[0]));
     if (sample->IsEOS()) {
       result = NS_ERROR_DOM_MEDIA_END_OF_STREAM;
       break;
     }
     if (sample->IsKeyFrame()) {
       java::sdk::BufferInfo::LocalRef info = sample->Info();
       int64_t presentationTimeUs = 0;
       bool ok = NS_SUCCEEDED(info->PresentationTimeUs(&presentationTimeUs));
@@ -627,17 +627,17 @@ HLSTrackDemuxer::DoSkipToNextRandomAcces
   }
   return SkipAccessPointPromise::CreateAndResolve(parsed, __func__);
 }
 
 TimeIntervals
 HLSTrackDemuxer::GetBuffered()
 {
   MOZ_ASSERT(mParent, "Called after BreackCycle()");
-  int64_t bufferedTime = mParent->mHlsDemuxerWrapper->GetBuffered(); //us
+  int64_t bufferedTime = mParent->mHLSDemuxerWrapper->GetBuffered(); //us
   return TimeIntervals(TimeInterval(TimeUnit(),
                                     TimeUnit::FromMicroseconds(bufferedTime)));
 }
 
 void
 HLSTrackDemuxer::BreakCycles()
 {
   RefPtr<HLSTrackDemuxer> self = this;
--- a/dom/media/hls/HLSDemuxer.h
+++ b/dom/media/hls/HLSDemuxer.h
@@ -22,17 +22,17 @@
 namespace mozilla {
 
 class AbstractThread;
 class MediaResult;
 class HLSTrackDemuxer;
 
 class HLSDemuxer final : public MediaDataDemuxer
 {
-  class HlsDemuxerCallbacksSupport;
+  class HLSDemuxerCallbacksSupport;
 public:
   explicit HLSDemuxer(MediaResource* aResource);
 
   RefPtr<InitPromise> Init() override;
 
   bool HasTrackType(TrackInfo::TrackType aType) const override;
 
   uint32_t GetNumberTracks(TrackInfo::TrackType aType) const override;
@@ -60,24 +60,24 @@ private:
   ~HLSDemuxer();
   RefPtr<MediaResource> mResource;
   friend class HLSTrackDemuxer;
 
   const RefPtr<AutoTaskQueue> mTaskQueue;
   nsTArray<RefPtr<HLSTrackDemuxer>> mDemuxers;
 
   MozPromiseHolder<InitPromise> mInitPromise;
-  RefPtr<HlsDemuxerCallbacksSupport> mCallbackSupport;
+  RefPtr<HLSDemuxerCallbacksSupport> mCallbackSupport;
 
   // Mutex to protect members below across multiple threads.
   mutable Mutex mMutex;
   MediaInfo mInfo;
 
-  java::GeckoHlsDemuxerWrapper::HlsDemuxerCallbacks::GlobalRef mJavaCallbacks;
-  java::GeckoHlsDemuxerWrapper::GlobalRef mHlsDemuxerWrapper;
+  java::GeckoHLSDemuxerWrapper::Callbacks::GlobalRef mJavaCallbacks;
+  java::GeckoHLSDemuxerWrapper::GlobalRef mHLSDemuxerWrapper;
 };
 
 class HLSTrackDemuxer : public MediaTrackDemuxer
 {
 public:
   HLSTrackDemuxer(HLSDemuxer* aParent,
                   TrackInfo::TrackType aType);
   ~HLSTrackDemuxer();
@@ -110,17 +110,17 @@ private:
   // Runs on HLSDemuxer's task queue.
   RefPtr<SeekPromise> DoSeek(const media::TimeUnit& aTime);
   RefPtr<SamplesPromise> DoGetSamples(int32_t aNumSamples);
   RefPtr<SkipAccessPointPromise> DoSkipToNextRandomAccessPoint(
     const media::TimeUnit& aTimeThreshold);
 
   CryptoSample ExtractCryptoSample(size_t aSampleSize,
                                    java::sdk::CryptoInfo::LocalRef aCryptoInfo);
-  RefPtr<MediaRawData> ConvertToMediaRawData(java::GeckoHlsSample::LocalRef aSample);
+  RefPtr<MediaRawData> ConvertToMediaRawData(java::GeckoHLSSample::LocalRef aSample);
 
   RefPtr<HLSDemuxer> mParent;
   TrackInfo::TrackType mType;
   Maybe<media::TimeUnit> mNextKeyframeTime;
   int32_t mLastFormatIndex = -1;
   // Queued samples extracted by the demuxer, but not yet returned.
   RefPtr<MediaRawData> mQueuedSample;
 };
--- a/dom/media/hls/HLSResource.cpp
+++ b/dom/media/hls/HLSResource.cpp
@@ -6,67 +6,67 @@
 
 #include "HLSResource.h"
 #include "HLSUtils.h"
 
 using namespace mozilla::java;
 
 namespace mozilla {
 
-HlsResourceCallbacksSupport::HlsResourceCallbacksSupport(HLSResource* aResource)
+HLSResourceCallbacksSupport::HLSResourceCallbacksSupport(HLSResource* aResource)
 {
   MOZ_ASSERT(aResource);
   mResource = aResource;
 }
 
 void
-HlsResourceCallbacksSupport::OnDataArrived()
+HLSResourceCallbacksSupport::OnDataArrived()
 {
   MOZ_ASSERT(mResource);
   mResource->onDataAvailable();
 }
 
 void
-HlsResourceCallbacksSupport::OnError(int aErrorCode)
+HLSResourceCallbacksSupport::OnError(int aErrorCode)
 {
   MOZ_ASSERT(mResource);
 }
 
 HLSResource::HLSResource(MediaResourceCallback* aCallback,
                          nsIChannel* aChannel,
                          nsIURI* aURI,
                          const MediaContainerType& aContainerType)
   : BaseMediaResource(aCallback, aChannel, aURI, aContainerType)
 {
   nsCString spec;
   nsresult rv = aURI->GetSpec(spec);
   (void)rv;
-  HlsResourceCallbacksSupport::Init();
-  mJavaCallbacks = GeckoHlsResourceWrapper::HlsResourceCallbacks::New();
-  HlsResourceCallbacksSupport::AttachNative(mJavaCallbacks,
-                                            mozilla::MakeUnique<HlsResourceCallbacksSupport>(this));
-  mHlsResourceWrapper = java::GeckoHlsResourceWrapper::Create(NS_ConvertUTF8toUTF16(spec),
+  HLSResourceCallbacksSupport::Init();
+  mJavaCallbacks = GeckoHLSResourceWrapper::Callbacks::New();
+  HLSResourceCallbacksSupport::AttachNative(mJavaCallbacks,
+                                            mozilla::MakeUnique<HLSResourceCallbacksSupport>(this));
+  mHLSResourceWrapper = java::GeckoHLSResourceWrapper::Create(NS_ConvertUTF8toUTF16(spec),
                                                               mJavaCallbacks);
-  MOZ_ASSERT(mHlsResourceWrapper);
+  MOZ_ASSERT(mHLSResourceWrapper);
 }
 
 void
 HLSResource::onDataAvailable()
 {
   MOZ_ASSERT(mCallback);
   HLS_DEBUG("HLSResource", "onDataAvailable");
   mCallback->NotifyDataArrived();
 }
 
 HLSResource::~HLSResource()
 {
   if (mJavaCallbacks) {
-    HlsResourceCallbacksSupport::DisposeNative(mJavaCallbacks);
+    HLSResourceCallbacksSupport::DisposeNative(mJavaCallbacks);
     mJavaCallbacks = nullptr;
   }
-  if (mHlsResourceWrapper) {
-    mHlsResourceWrapper->Destroy();
-    mHlsResourceWrapper = nullptr;
+  if (mHLSResourceWrapper) {
+    mHLSResourceWrapper->Destroy();
+    mHLSResourceWrapper = nullptr;
   }
   HLS_DEBUG("HLSResource", "Destroy");
 }
 
 } // namespace mozilla
--- a/dom/media/hls/HLSResource.h
+++ b/dom/media/hls/HLSResource.h
@@ -15,25 +15,25 @@
 #define UNIMPLEMENTED() HLS_DEBUG("HLSResource", "UNIMPLEMENTED FUNCTION")
 
 using namespace mozilla::java;
 
 namespace mozilla {
 
 class HLSResource;
 
-class HlsResourceCallbacksSupport
-  : public GeckoHlsResourceWrapper::HlsResourceCallbacks::Natives<HlsResourceCallbacksSupport>
+class HLSResourceCallbacksSupport
+  : public GeckoHLSResourceWrapper::Callbacks::Natives<HLSResourceCallbacksSupport>
 {
 public:
-  typedef GeckoHlsResourceWrapper::HlsResourceCallbacks::Natives<HlsResourceCallbacksSupport> NativeCallbacks;
+  typedef GeckoHLSResourceWrapper::Callbacks::Natives<HLSResourceCallbacksSupport> NativeCallbacks;
   using NativeCallbacks::DisposeNative;
   using NativeCallbacks::AttachNative;
 
-  HlsResourceCallbacksSupport(HLSResource* aResource);
+  HLSResourceCallbacksSupport(HLSResource* aResource);
   void OnDataArrived();
   void OnError(int aErrorCode);
 
 private:
   HLSResource* mResource;
 };
 
 class HLSResource final : public BaseMediaResource
@@ -93,36 +93,36 @@ public:
     return false;
   }
 
   bool IsExpectingMoreData() override
   {
     return false;
   }
 
-  java::GeckoHlsResourceWrapper::GlobalRef GetResourceWrapper() {
-    return mHlsResourceWrapper;
+  java::GeckoHLSResourceWrapper::GlobalRef GetResourceWrapper() {
+    return mHLSResourceWrapper;
   }
 
 private:
-  friend class HlsResourceCallbacksSupport;
+  friend class HLSResourceCallbacksSupport;
 
   void onDataAvailable();
 
   size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override
   {
     size_t size = MediaResource::SizeOfExcludingThis(aMallocSizeOf);
     size += mContainerType.SizeOfExcludingThis(aMallocSizeOf);
 
     return size;
   }
 
   size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override
   {
     return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
   }
 
-  java::GeckoHlsResourceWrapper::GlobalRef mHlsResourceWrapper;
-  java::GeckoHlsResourceWrapper::HlsResourceCallbacks::GlobalRef mJavaCallbacks;
+  java::GeckoHLSResourceWrapper::GlobalRef mHLSResourceWrapper;
+  java::GeckoHLSResourceWrapper::Callbacks::GlobalRef mJavaCallbacks;
 };
 
 } // namespace mozilla
 #endif /* HLSResource_h_ */