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

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

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: Have Nullable<T>::trace() use TraceIfNeeded<>. 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.cpp
diff --git a/Source/core/html/canvas/WebGLObject.cpp b/Source/core/html/canvas/WebGLObject.cpp
index 14dd8ba5ee8d78eeea2c29b7f2dfc08ece0c7a8f..43d0b32e37e2307080920f62c088e2dadc343371 100644
--- a/Source/core/html/canvas/WebGLObject.cpp
+++ b/Source/core/html/canvas/WebGLObject.cpp
@@ -27,9 +27,11 @@
#include "core/html/canvas/WebGLObject.h"
+#include "core/html/canvas/WebGLRenderingContextBase.h"
Ken Russell (switch to Gerrit) 2014/07/19 00:27:15 This #include looks unnecessary.
sof 2014/07/19 19:55:57 Thanks, removed.
+
namespace WebCore {
-WebGLObject::WebGLObject(WebGLRenderingContextBase*)
+WebGLObject::WebGLObject(WebGLRenderingContextBase* base)
: m_object(0)
, m_attachmentCount(0)
, m_deleted(false)
@@ -38,6 +40,10 @@ WebGLObject::WebGLObject(WebGLRenderingContextBase*)
WebGLObject::~WebGLObject()
{
+#if ENABLE(OILPAN)
+ // Verify that platform objects have been explicitly deleted.
+ ASSERT(m_deleted);
+#endif
}
void WebGLObject::setObject(Platform3DObject object)
@@ -70,8 +76,13 @@ void WebGLObject::deleteObject(blink::WebGraphicsContext3D* context3d)
void WebGLObject::detach()
{
m_attachmentCount = 0; // Make sure OpenGL resource is deleted.
- }
+}
+void WebGLObject::detachAndDeleteObject()
+{
+ detach();
+ deleteObject(0);
+}
void WebGLObject::onDetached(blink::WebGraphicsContext3D* context3d)
{

Powered by Google App Engine
This is Rietveld 408576698