1 /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef WEBGL_CONTEXT_LOSS_HANDLER_H_
7 #define WEBGL_CONTEXT_LOSS_HANDLER_H_
9 #include "mozilla/DebugOnly.h"
10 #include "mozilla/RefPtr.h"
11 #include "mozilla/WeakPtr.h"
20 class WebGLContextLossHandler
21 : public RefCounted
<WebGLContextLossHandler
>
23 WeakPtr
<WebGLContext
> mWeakWebGL
;
24 nsCOMPtr
<nsITimer
> mTimer
;
26 bool mShouldRunTimerAgain
;
28 DebugOnly
<nsIThread
*> mThread
;
31 MOZ_DECLARE_REFCOUNTED_TYPENAME(WebGLContextLossHandler
)
33 WebGLContextLossHandler(WebGLContext
* webgl
);
34 ~WebGLContextLossHandler();
40 void StartTimer(unsigned long delayMS
);
41 static void StaticTimerCallback(nsITimer
*, void* tempRefForTimer
);
45 } // namespace mozilla