| 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)
|
|
|