summaryrefslogtreecommitdiffstats
path: root/dom/media/systemservices/CamerasChild.h
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-05-10 11:50:47 +0200
committerwolfbeast <mcwerewolf@gmail.com>2018-05-10 11:50:47 +0200
commitbece236d81a519a51ae36ccac911365b2d94fedc (patch)
tree08d406dbe44f89d188485a93b3f14602e6041863 /dom/media/systemservices/CamerasChild.h
parentb98c4ed80b389400df2792a49147d191e5bb9921 (diff)
parent04b3d5178c893bfb794c0053e559133f413250e7 (diff)
downloadUXP-bece236d81a519a51ae36ccac911365b2d94fedc.tar
UXP-bece236d81a519a51ae36ccac911365b2d94fedc.tar.gz
UXP-bece236d81a519a51ae36ccac911365b2d94fedc.tar.lz
UXP-bece236d81a519a51ae36ccac911365b2d94fedc.tar.xz
UXP-bece236d81a519a51ae36ccac911365b2d94fedc.zip
Merge branch 'ported-upstream'
Diffstat (limited to 'dom/media/systemservices/CamerasChild.h')
-rw-r--r--dom/media/systemservices/CamerasChild.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/dom/media/systemservices/CamerasChild.h b/dom/media/systemservices/CamerasChild.h
index 1530714e9..9ca125cfd 100644
--- a/dom/media/systemservices/CamerasChild.h
+++ b/dom/media/systemservices/CamerasChild.h
@@ -89,6 +89,14 @@ public:
return gTheInstance.get()->mFakeDeviceChangeEventThread;
}
+ static bool InShutdown() {
+ return gTheInstance.get()->mInShutdown;
+ }
+
+ static void StartShutdown() {
+ gTheInstance.get()->mInShutdown = true;
+ }
+
private:
static Singleton<CamerasSingleton> gTheInstance;
@@ -106,6 +114,7 @@ private:
CamerasChild* mCameras;
nsCOMPtr<nsIThread> mCamerasChildThread;
nsCOMPtr<nsIThread> mFakeDeviceChangeEventThread;
+ Atomic<bool> mInShutdown;
};
// Get a pointer to a CamerasChild object we can use to do IPC with.
@@ -145,7 +154,7 @@ class CamerasChild final : public PCamerasChild
public:
// We are owned by the PBackground thread only. CamerasSingleton
// takes a non-owning reference.
- NS_INLINE_DECL_REFCOUNTING(CamerasChild)
+ NS_INLINE_DECL_THREADSAFE_REFCOUNTING(CamerasChild)
// IPC messages recevied, received on the PBackground thread
// these are the actual callbacks with data