| Index: Source/core/html/canvas/WebGLExtension.h
|
| diff --git a/Source/core/html/canvas/WebGLExtension.h b/Source/core/html/canvas/WebGLExtension.h
|
| index 84eef1bcd1fc2882fe781208c3effc86271f775d..7e41cb7e59d53e127945264d82ce310670cc0ee3 100644
|
| --- a/Source/core/html/canvas/WebGLExtension.h
|
| +++ b/Source/core/html/canvas/WebGLExtension.h
|
| @@ -27,10 +27,11 @@
|
| #define WebGLExtension_h
|
|
|
| #include "core/html/canvas/WebGLRenderingContext.h"
|
| +#include "wtf/RefCounted.h"
|
|
|
| namespace WebCore {
|
|
|
| -class WebGLExtension {
|
| +class WebGLExtension : public RefCounted<WebGLExtension> {
|
| WTF_MAKE_FAST_ALLOCATED;
|
| public:
|
| // Extension names are needed to properly wrap instances in JavaScript objects.
|
| @@ -54,15 +55,27 @@ public:
|
| WebGLLoseContextName,
|
| };
|
|
|
| - void ref() { m_context->ref(); }
|
| - void deref() { m_context->deref(); }
|
| WebGLRenderingContext* context() { return m_context; }
|
|
|
| virtual ~WebGLExtension();
|
| virtual ExtensionName getName() const = 0;
|
|
|
| + // Lose this extension. Passing true = force loss. Some extensions
|
| + // like WEBGL_lose_context are not normally lost when the context
|
| + // is lost but must be lost when destroying their WebGLRenderingContext.
|
| + virtual void lose(bool)
|
| + {
|
| + m_context = 0;
|
| + }
|
| +
|
| + bool isLost()
|
| + {
|
| + return !m_context;
|
| + }
|
| +
|
| protected:
|
| WebGLExtension(WebGLRenderingContext*);
|
| +
|
| WebGLRenderingContext* m_context;
|
| };
|
|
|
|
|