Bug 1892041 - Part 1: Update test262 features. r=spidermonkey-reviewers,dminor
[gecko.git] / dom / canvas / WebGLContextLossHandler.h
blobf3bce8a4c1b744b491f69f11948395e8c87a95c9
1 /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
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/Atomics.h"
10 #include "mozilla/WeakPtr.h"
11 #include "mozilla/RefPtr.h"
12 #include "nsThreadUtils.h"
14 namespace mozilla {
15 class WebGLContext;
17 class WebGLContextLossHandler final : public SupportsWeakPtr {
18 RefPtr<Runnable> mRunnable;
19 Atomic<bool> mTimerIsScheduled;
21 public:
22 explicit WebGLContextLossHandler(WebGLContext* webgl);
23 ~WebGLContextLossHandler();
25 void RunTimer();
26 // Allow future queueing of context loss timer.
27 void ClearTimer();
30 } // namespace mozilla
32 #endif // WEBGL_CONTEXT_LOSS_HANDLER_H_