1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef GFX_VR_THREAD_H
8 #define GFX_VR_THREAD_H
10 #include "nsISupportsImpl.h"
11 #include "base/thread.h" // for Thread
16 class VRThread final
{
17 NS_INLINE_DECL_THREADSAFE_REFCOUNTING(VRThread
)
20 explicit VRThread(const nsCString
& aName
);
24 void SetLifeTime(uint32_t aLifeTime
);
25 uint32_t GetLifeTime();
26 void CheckLife(TimeStamp aCheckTimestamp
);
27 void PostTask(already_AddRefed
<Runnable
> aTask
);
28 void PostDelayedTask(already_AddRefed
<Runnable
> aTask
, uint32_t aTime
);
29 const nsCOMPtr
<nsIThread
> GetThread() const;
36 nsCOMPtr
<nsIThread
> mThread
;
37 TimeStamp mLastActiveTime
;
40 Atomic
<bool> mStarted
;
44 } // namespace mozilla
46 #endif // GFX_VR_THREAD_H