Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1212)

Unified Diff: Source/core/html/canvas/WebGLObject.h

Issue 365653002: Oilpan: move 2D Canvas and WebGL objects to the heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Make WebGLObjects keep a blink::WebGraphicsContext3D for finalization. Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/html/canvas/WebGLObject.h
diff --git a/Source/core/html/canvas/WebGLObject.h b/Source/core/html/canvas/WebGLObject.h
index ae5c439c8a6be5f9d8a5ff3f930100daa3508a78..753a8b5037c2511948dd5018b556c43e09c1ea6e 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 WebCore {
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,12 +74,17 @@ protected:
virtual bool hasGroupOrContext() const = 0;
- virtual void detach();
+ void detach();
+#if !ENABLE(OILPAN)
virtual blink::WebGraphicsContext3D* getAWebGraphicsContext3D() const = 0;
+#endif
private:
Platform3DObject m_object;
+#if ENABLE(OILPAN)
+ blink::WebGraphicsContext3D* m_context3d;
+#endif
unsigned m_attachmentCount;
bool m_deleted;
};

Powered by Google App Engine
This is Rietveld 408576698