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

Unified Diff: Source/core/html/canvas/WebGLBuffer.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: Smaller adjustments 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/WebGLBuffer.cpp
diff --git a/Source/core/html/canvas/WebGLBuffer.cpp b/Source/core/html/canvas/WebGLBuffer.cpp
index 8eab4d8161e5a1ccae9ce0ac56d463f3114ca161..4400d0ade85e3adf4ce1bd2e2fecf1f98926c148 100644
--- a/Source/core/html/canvas/WebGLBuffer.cpp
+++ b/Source/core/html/canvas/WebGLBuffer.cpp
@@ -31,9 +31,9 @@
namespace blink {
-PassRefPtr<WebGLBuffer> WebGLBuffer::create(WebGLRenderingContextBase* ctx)
+PassRefPtrWillBeRawPtr<WebGLBuffer> WebGLBuffer::create(WebGLRenderingContextBase* ctx)
{
- return adoptRef(new WebGLBuffer(ctx));
+ return adoptRefWillBeNoop(new WebGLBuffer(ctx));
}
WebGLBuffer::WebGLBuffer(WebGLRenderingContextBase* ctx)
@@ -46,7 +46,16 @@ WebGLBuffer::WebGLBuffer(WebGLRenderingContextBase* ctx)
WebGLBuffer::~WebGLBuffer()
{
- deleteObject(0);
+ // Delete the buffer's platform object. This object will have been
+ // detached from the WebGLContextGroup if the group object was
+ // finalized first. With Oilpan not enabled, it always will be,
+ // but with Oilpan enabled, the WebGLBuffer might end up being
+ // finalized first. In which case detachment is needed to ensure
+ // that the platform object is indeed deleted.
+ //
+ // To keep the code regular, the trivial detach()ment is always
+ // performed.
+ detachAndDeleteObject();
}
void WebGLBuffer::deleteObjectImpl(blink::WebGraphicsContext3D* context3d, Platform3DObject object)

Powered by Google App Engine
This is Rietveld 408576698