summaryrefslogtreecommitdiffstats
path: root/dom/media/imagecapture/CaptureTask.h
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2020-04-22 02:32:20 +0000
committerMoonchild <moonchild@palemoon.org>2020-06-03 11:49:58 +0000
commit5a64ee34a9e5242bbe5fe4e509ef38ef42f360fa (patch)
tree648f0ce4febbee2f901ef6af74385df8ce452eee /dom/media/imagecapture/CaptureTask.h
parentda8fbfb4d56a4800b3e4c134ea387c2d9fcd9df7 (diff)
downloadUXP-5a64ee34a9e5242bbe5fe4e509ef38ef42f360fa.tar
UXP-5a64ee34a9e5242bbe5fe4e509ef38ef42f360fa.tar.gz
UXP-5a64ee34a9e5242bbe5fe4e509ef38ef42f360fa.tar.lz
UXP-5a64ee34a9e5242bbe5fe4e509ef38ef42f360fa.tar.xz
UXP-5a64ee34a9e5242bbe5fe4e509ef38ef42f360fa.zip
Issue #80 - Re-land early dom/media de-unification with fixups.
For some reason these changes never got merged back to master after reverting to work on a branch...
Diffstat (limited to 'dom/media/imagecapture/CaptureTask.h')
-rw-r--r--dom/media/imagecapture/CaptureTask.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/dom/media/imagecapture/CaptureTask.h b/dom/media/imagecapture/CaptureTask.h
index 2b4f0a04c..f9c810158 100644
--- a/dom/media/imagecapture/CaptureTask.h
+++ b/dom/media/imagecapture/CaptureTask.h
@@ -86,6 +86,24 @@ protected:
bool mPrincipalChanged;
};
+class CaptureTask::MediaStreamEventListener : public MediaStreamTrackListener
+{
+public:
+ explicit MediaStreamEventListener(CaptureTask* aCaptureTask)
+ : mCaptureTask(aCaptureTask) {};
+
+ // MediaStreamListener methods.
+ void NotifyEnded() override
+ {
+ if(!mCaptureTask->mImageGrabbedOrTrackEnd) {
+ mCaptureTask->PostTrackEndEvent();
+ }
+ }
+
+private:
+ CaptureTask* mCaptureTask;
+};
+
} // namespace mozilla
#endif // CAPTURETASK_H