Index: Source/core/html/canvas/WebGLObject.h |
diff --git a/Source/core/html/canvas/WebGLObject.h b/Source/core/html/canvas/WebGLObject.h |
index 06716d7668c93d1776dee44833d149a9dee17698..2b5628cb38458a9f9dedc6c381aacc4512f4210e 100644 |
--- a/Source/core/html/canvas/WebGLObject.h |
+++ b/Source/core/html/canvas/WebGLObject.h |
@@ -27,6 +27,7 @@ |
#define WebGLObject_h |
#include "platform/graphics/GraphicsTypes3D.h" |
+#include "platform/heap/Handle.h" |
#include "wtf/RefCounted.h" |
namespace blink { |
@@ -38,7 +39,7 @@ namespace blink { |
class WebGLContextGroup; |
class WebGLRenderingContextBase; |
-class WebGLObject : public RefCounted<WebGLObject> { |
+class WebGLObject : public RefCountedWillBeGarbageCollectedFinalized<WebGLObject> { |
public: |
virtual ~WebGLObject(); |
@@ -60,8 +61,10 @@ public: |
// True if this object belongs to the group or context. |
virtual bool validate(const WebGLContextGroup*, const WebGLRenderingContextBase*) const = 0; |
+ virtual void trace(Visitor*) { } |
+ |
protected: |
- WebGLObject(WebGLRenderingContextBase*); |
+ explicit WebGLObject(WebGLRenderingContextBase*); |
// setObject should be only called once right after creating a WebGLObject. |
void setObject(Platform3DObject); |
@@ -71,7 +74,8 @@ protected: |
virtual bool hasGroupOrContext() const = 0; |
- virtual void detach(); |
+ void detach(); |
+ void detachAndDeleteObject(); |
virtual blink::WebGraphicsContext3D* getAWebGraphicsContext3D() const = 0; |