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

Unified Diff: Source/core/html/canvas/WebGLContextObject.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: 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/WebGLContextObject.cpp
diff --git a/Source/core/html/canvas/WebGLContextObject.cpp b/Source/core/html/canvas/WebGLContextObject.cpp
index 83441589defb70bea4690902c64c94840d3ce119..7d3612694d7f21ddd92f1cfee5b3bd6e803a8bcc 100644
--- a/Source/core/html/canvas/WebGLContextObject.cpp
+++ b/Source/core/html/canvas/WebGLContextObject.cpp
@@ -39,8 +39,10 @@ WebGLContextObject::WebGLContextObject(WebGLRenderingContextBase* context)
WebGLContextObject::~WebGLContextObject()
{
+#if !ENABLE(OILPAN)
if (m_context)
m_context->removeContextObject(this);
+#endif
}
void WebGLContextObject::detachContext()
@@ -49,13 +51,21 @@ void WebGLContextObject::detachContext()
if (m_context) {
deleteObject(m_context->webContext());
m_context->removeContextObject(this);
- m_context = 0;
+ m_context = nullptr;
}
}
+#if !ENABLE(OILPAN)
blink::WebGraphicsContext3D* WebGLContextObject::getAWebGraphicsContext3D() const
{
return m_context ? m_context->webContext() : 0;
}
+#endif
+
+void WebGLContextObject::trace(Visitor* visitor)
+{
+ visitor->trace(m_context);
+ WebGLObject::trace(visitor);
+}
}

Powered by Google App Engine
This is Rietveld 408576698