summaryrefslogtreecommitdiffstats
path: root/dom/media/hls/HLSDecoder.h
diff options
context:
space:
mode:
Diffstat (limited to 'dom/media/hls/HLSDecoder.h')
-rw-r--r--dom/media/hls/HLSDecoder.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/dom/media/hls/HLSDecoder.h b/dom/media/hls/HLSDecoder.h
index 0f65457765..3624a8c3f4 100644
--- a/dom/media/hls/HLSDecoder.h
+++ b/dom/media/hls/HLSDecoder.h
@@ -47,6 +47,8 @@ class HLSDecoder final : public MediaDecoder {
// Called when Exoplayer start to load media. Main thread only.
void NotifyLoad(nsCString aMediaUrl);
+ bool IsHLSDecoder() const override { return true; }
+
private:
friend class HLSResourceCallbacksSupport;
@@ -61,8 +63,9 @@ class HLSDecoder final : public MediaDecoder {
return true;
}
- void UpdateCurrentPrincipal(nsCString aMediaUrl);
- already_AddRefed<nsIPrincipal> GetContentPrincipal(nsCString aMediaUrl);
+ void UpdateCurrentPrincipal(nsIURI* aMediaUri);
+ already_AddRefed<nsIPrincipal> GetContentPrincipal(nsIURI* aMediaUri);
+ void RecordMediaUsage(nsIURI* aMediaUri);
static size_t sAllocatedInstances; // Access only in the main thread.
@@ -72,6 +75,9 @@ class HLSDecoder final : public MediaDecoder {
java::GeckoHLSResourceWrapper::Callbacks::GlobalRef mJavaCallbacks;
RefPtr<HLSResourceCallbacksSupport> mCallbackSupport;
nsCOMPtr<nsIPrincipal> mContentPrincipal;
+ // There can be multiple media files loaded for one HLS content. Use this flag
+ // to ensure we only record once per content.
+ bool mUsageRecorded;
};
} // namespace mozilla