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

Issue 2547813002: Remove WebGLObject maps from WebGLRenderingContextBase and WebGLContextGroup. (Closed)

Created:
4 years ago by Ken Russell (switch to Gerrit)
Modified:
4 years ago
CC:
chromium-reviews, blink-reviews, haraken, Kai Ninomiya
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Remove WebGLObject maps from WebGLRenderingContextBase and WebGLContextGroup. There are two high-level goals for the handling of WebGLObjects: 1) When they are GC'd, the underlying graphics resource is deleted promptly. 2) When the context is destroyed, all of the underlying graphics resources are reclaimed. The WebGLContextObject and WebGLSharedObject maps were an attempt to implement (2) before WebGL contexts were in their own client-side share group, separate from the compositor. Unfortunately, with the introduction of Oilpan, it's become clear that there are longstanding bugs in the lifetime management of WebGLObjects. These bugs recently began manifesting frequently on the bots. To fix these bugs, WebGLObjects are now eagerly finalized, rather than the WebGLRenderingContextBase. WebGLObjects maintain a strong reference either to their context or share group, depending on whether they're per-context or shared objects. WebGLContextGroup becomes an Oilpan object which maintains weak references to all of its contexts (currently, just one). WebGLRenderingContextBase maintains a strong reference to its context group. Because WebGLObjects can no longer be enumerated, their invalidation during context loss needs to be rewritten. This is handled by tracking the number of context losses on a per-share-group basis, and comparing this with a cached version in each WebGLObject instance during its validation. As a consequence of this change, most of the work in WebGLRenderingContextBase's destructor, as well as in the destructors of corollary types like WebGLExtension, becomes useless, and it has been removed. The destructors of the WebGLObject subclasses have been made more uniform to prevent errors. More fixes around wrapper tracing are probably both needed and enabled by this CL, but they can follow this necessary fix. BUG=537054, 666061 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel;master.tryserver.chromium.android:android_optional_gpu_tests_rel TBR=zmo@chromium.org Committed: https://crrev.com/f5e91b15573820ff14396b6be246c54ca6755a13 Cr-Commit-Position: refs/heads/master@{#436080}

Patch Set 1 #

Total comments: 11

Patch Set 2 : Fixed WebGLContextObject::validate. Made WebGLExtension non-finalized. #

Total comments: 18
Unified diffs Side-by-side diffs Delta from patch set Stats (+243 lines, -430 lines) Patch
M third_party/WebKit/Source/modules/webgl/ANGLEInstancedArrays.h View 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/Source/modules/webgl/ANGLEInstancedArrays.cpp View 1 chunk +0 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/modules/webgl/EXTBlendMinMax.h View 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/Source/modules/webgl/EXTBlendMinMax.cpp View 1 chunk +0 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/modules/webgl/EXTColorBufferFloat.h View 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/Source/modules/webgl/EXTColorBufferFloat.cpp View 1 chunk +0 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/modules/webgl/EXTDisjointTimerQuery.h View 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/Source/modules/webgl/EXTDisjointTimerQuery.cpp View 2 chunks +2 lines, -7 lines 0 comments Download
M third_party/WebKit/Source/modules/webgl/EXTDisjointTimerQueryWebGL2.h View 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/Source/modules/webgl/EXTDisjointTimerQueryWebGL2.cpp View 1 chunk +0 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/modules/webgl/EXTFragDepth.h View 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/Source/modules/webgl/EXTFragDepth.cpp View 1 chunk +0 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/modules/webgl/EXTShaderTextureLOD.h View 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/Source/modules/webgl/EXTShaderTextureLOD.cpp View 1 chunk +0 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/modules/webgl/EXTTextureFilterAnisotropic.h View 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/Source/modules/webgl/EXTTextureFilterAnisotropic.cpp View 1 chunk +0 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/modules/webgl/EXTsRGB.h View 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/Source/modules/webgl/EXTsRGB.cpp View 1 chunk +0 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/modules/webgl/OESElementIndexUint.h View 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/Source/modules/webgl/OESElementIndexUint.cpp View 1 chunk +0 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/modules/webgl/OESStandardDerivatives.h View 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/Source/modules/webgl/OESStandardDerivatives.cpp View 1 chunk +0 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/modules/webgl/OESTextureFloat.h View 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/Source/modules/webgl/OESTextureFloat.cpp View 1 chunk +0 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/modules/webgl/OESTextureFloatLinear.h View 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/Source/modules/webgl/OESTextureFloatLinear.cpp View 1 chunk +0 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/modules/webgl/OESTextureHalfFloat.h View 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/Source/modules/webgl/OESTextureHalfFloat.cpp View 1 chunk +0 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/modules/webgl/OESTextureHalfFloatLinear.h View 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/Source/modules/webgl/OESTextureHalfFloatLinear.cpp View 1 chunk +0 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/modules/webgl/OESVertexArrayObject.h View 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/Source/modules/webgl/OESVertexArrayObject.cpp View 2 chunks +1 line, -5 lines 0 comments Download
M third_party/WebKit/Source/modules/webgl/WebGL2RenderingContext.h View 1 chunk +0 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/modules/webgl/WebGL2RenderingContext.cpp View 1 chunk +0 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.h View 2 chunks +0 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp View 6 chunks +5 lines, -30 lines 0 comments Download
M third_party/WebKit/Source/modules/webgl/WebGLBuffer.cpp View 1 chunk +1 line, -2 lines 0 comments Download
M third_party/WebKit/Source/modules/webgl/WebGLCompressedTextureASTC.h View 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/Source/modules/webgl/WebGLCompressedTextureASTC.cpp View 1 chunk +0 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/modules/webgl/WebGLCompressedTextureATC.h View 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/Source/modules/webgl/WebGLCompressedTextureATC.cpp View 1 chunk +0 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/modules/webgl/WebGLCompressedTextureETC.h View 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/Source/modules/webgl/WebGLCompressedTextureETC.cpp View 1 chunk +0 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/modules/webgl/WebGLCompressedTextureETC1.h View 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/Source/modules/webgl/WebGLCompressedTextureETC1.cpp View 1 chunk +0 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/modules/webgl/WebGLCompressedTexturePVRTC.h View 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/Source/modules/webgl/WebGLCompressedTexturePVRTC.cpp View 1 chunk +0 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/modules/webgl/WebGLCompressedTextureS3TC.h View 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/Source/modules/webgl/WebGLCompressedTextureS3TC.cpp View 1 chunk +0 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/modules/webgl/WebGLCompressedTextureS3TCsRGB.h View 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/Source/modules/webgl/WebGLCompressedTextureS3TCsRGB.cpp View 1 chunk +0 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/modules/webgl/WebGLContextGroup.h View 2 chunks +26 lines, -20 lines 0 comments Download
M third_party/WebKit/Source/modules/webgl/WebGLContextGroup.cpp View 1 2 chunks +18 lines, -38 lines 8 comments Download
M third_party/WebKit/Source/modules/webgl/WebGLContextObject.h View 1 2 chunks +3 lines, -7 lines 0 comments Download
M third_party/WebKit/Source/modules/webgl/WebGLContextObject.cpp View 1 1 chunk +12 lines, -9 lines 0 comments Download
M third_party/WebKit/Source/modules/webgl/WebGLDebugRendererInfo.h View 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/Source/modules/webgl/WebGLDebugRendererInfo.cpp View 1 chunk +0 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/modules/webgl/WebGLDebugShaders.h View 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/Source/modules/webgl/WebGLDebugShaders.cpp View 1 chunk +0 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/modules/webgl/WebGLDepthTexture.h View 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/Source/modules/webgl/WebGLDepthTexture.cpp View 1 chunk +0 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/modules/webgl/WebGLDrawBuffers.h View 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/Source/modules/webgl/WebGLDrawBuffers.cpp View 1 chunk +0 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/modules/webgl/WebGLExtension.h View 1 1 chunk +1 line, -2 lines 0 comments Download
M third_party/WebKit/Source/modules/webgl/WebGLExtension.cpp View 1 1 chunk +0 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/modules/webgl/WebGLFenceSync.h View 1 chunk +0 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/modules/webgl/WebGLFenceSync.cpp View 1 chunk +0 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/modules/webgl/WebGLFramebuffer.h View 2 chunks +1 line, -4 lines 0 comments Download
M third_party/WebKit/Source/modules/webgl/WebGLFramebuffer.cpp View 6 chunks +2 lines, -13 lines 0 comments Download
M third_party/WebKit/Source/modules/webgl/WebGLLoseContext.h View 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/Source/modules/webgl/WebGLLoseContext.cpp View 1 chunk +0 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/modules/webgl/WebGLObject.h View 4 chunks +43 lines, -0 lines 4 comments Download
M third_party/WebKit/Source/modules/webgl/WebGLObject.cpp View 4 chunks +29 lines, -8 lines 2 comments Download
M third_party/WebKit/Source/modules/webgl/WebGLProgram.cpp View 1 chunk +10 lines, -16 lines 0 comments Download
M third_party/WebKit/Source/modules/webgl/WebGLQuery.cpp View 2 chunks +4 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/modules/webgl/WebGLRenderbuffer.cpp View 2 chunks +4 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/modules/webgl/WebGLRenderingContext.h View 2 chunks +0 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/modules/webgl/WebGLRenderingContext.cpp View 1 chunk +0 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h View 1 7 chunks +3 lines, -16 lines 0 comments Download
M third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp View 1 12 chunks +27 lines, -86 lines 0 comments Download
M third_party/WebKit/Source/modules/webgl/WebGLSampler.cpp View 2 chunks +4 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/modules/webgl/WebGLShader.cpp View 1 chunk +1 line, -2 lines 0 comments Download
M third_party/WebKit/Source/modules/webgl/WebGLSharedObject.h View 3 chunks +10 lines, -9 lines 0 comments Download
M third_party/WebKit/Source/modules/webgl/WebGLSharedObject.cpp View 1 chunk +21 lines, -12 lines 4 comments Download
M third_party/WebKit/Source/modules/webgl/WebGLSharedPlatform3DObject.h View 1 chunk +0 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/modules/webgl/WebGLSharedPlatform3DObject.cpp View 1 chunk +0 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/modules/webgl/WebGLSync.cpp View 1 chunk +4 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/modules/webgl/WebGLTexture.cpp View 1 chunk +1 line, -2 lines 0 comments Download
M third_party/WebKit/Source/modules/webgl/WebGLTimerQueryEXT.cpp View 2 chunks +4 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/modules/webgl/WebGLTransformFeedback.cpp View 2 chunks +4 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/modules/webgl/WebGLVertexArrayObjectBase.h View 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/Source/modules/webgl/WebGLVertexArrayObjectBase.cpp View 3 chunks +2 lines, -9 lines 0 comments Download

Messages

Total messages: 33 (15 generated)
Ken Russell (switch to Gerrit)
I think the tryjobs will all come back green, so sending this for review. zmo: ...
4 years ago (2016-12-02 09:58:48 UTC) #6
haraken
https://codereview.chromium.org/2547813002/diff/1/third_party/WebKit/Source/modules/webgl/WebGLContextGroup.cpp File third_party/WebKit/Source/modules/webgl/WebGLContextGroup.cpp (right): https://codereview.chromium.org/2547813002/diff/1/third_party/WebKit/Source/modules/webgl/WebGLContextGroup.cpp#newcode36 third_party/WebKit/Source/modules/webgl/WebGLContextGroup.cpp:36: // removed from the HeapHashSet? On 2016/12/02 09:58:48, Ken ...
4 years ago (2016-12-02 10:14:34 UTC) #7
sof
I do hope this one works out & lands safely, swashbuckling simplifications. https://codereview.chromium.org/2547813002/diff/1/third_party/WebKit/Source/modules/webgl/WebGLContextGroup.cpp File third_party/WebKit/Source/modules/webgl/WebGLContextGroup.cpp ...
4 years ago (2016-12-02 10:39:06 UTC) #8
Kai Ninomiya
Seems good, not sure what's going on with the failures. One question. https://codereview.chromium.org/2547813002/diff/1/third_party/WebKit/Source/modules/webgl/WebGLProgram.cpp File third_party/WebKit/Source/modules/webgl/WebGLProgram.cpp ...
4 years ago (2016-12-02 18:51:29 UTC) #12
Zhenyao Mo
Mostly looks good with one question. https://codereview.chromium.org/2547813002/diff/1/third_party/WebKit/Source/modules/webgl/WebGLContextObject.h File third_party/WebKit/Source/modules/webgl/WebGLContextObject.h (right): https://codereview.chromium.org/2547813002/diff/1/third_party/WebKit/Source/modules/webgl/WebGLContextObject.h#newcode43 third_party/WebKit/Source/modules/webgl/WebGLContextObject.h:43: return context == ...
4 years ago (2016-12-02 18:58:40 UTC) #13
Ken Russell (switch to Gerrit)
Thanks for your reviews. The test failures are unrelated. The webkit_tests timeouts on Windows are ...
4 years ago (2016-12-02 20:38:49 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2547813002/20001
4 years ago (2016-12-02 20:39:57 UTC) #16
commit-bot: I haz the power
No L-G-T-M from a valid reviewer yet. CQ run can only be started by full ...
4 years ago (2016-12-02 20:39:59 UTC) #18
Ken Russell (switch to Gerrit)
I suspect Mo intended to give a thumbs-up on this so I'm TBR'ing it. It's ...
4 years ago (2016-12-02 21:50:24 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2547813002/20001
4 years ago (2016-12-02 21:51:35 UTC) #22
Ken Russell (switch to Gerrit)
https://codereview.chromium.org/2547813002/diff/1/third_party/WebKit/Source/modules/webgl/WebGLContextObject.h File third_party/WebKit/Source/modules/webgl/WebGLContextObject.h (right): https://codereview.chromium.org/2547813002/diff/1/third_party/WebKit/Source/modules/webgl/WebGLContextObject.h#newcode43 third_party/WebKit/Source/modules/webgl/WebGLContextObject.h:43: return context == m_context; On 2016/12/02 18:58:39, Zhenyao Mo ...
4 years ago (2016-12-02 22:13:38 UTC) #23
Zhenyao Mo
On 2016/12/02 22:13:38, Ken Russell wrote: > https://codereview.chromium.org/2547813002/diff/1/third_party/WebKit/Source/modules/webgl/WebGLContextObject.h > File third_party/WebKit/Source/modules/webgl/WebGLContextObject.h (right): > > https://codereview.chromium.org/2547813002/diff/1/third_party/WebKit/Source/modules/webgl/WebGLContextObject.h#newcode43 ...
4 years ago (2016-12-02 22:39:25 UTC) #24
commit-bot: I haz the power
Committed patchset #2 (id:20001)
4 years ago (2016-12-02 23:46:45 UTC) #27
commit-bot: I haz the power
Patchset 2 (id:??) landed as https://crrev.com/f5e91b15573820ff14396b6be246c54ca6755a13 Cr-Commit-Position: refs/heads/master@{#436080}
4 years ago (2016-12-02 23:48:46 UTC) #29
haraken
LGTM with comments. https://codereview.chromium.org/2547813002/diff/20001/third_party/WebKit/Source/modules/webgl/WebGLContextGroup.cpp File third_party/WebKit/Source/modules/webgl/WebGLContextGroup.cpp (right): https://codereview.chromium.org/2547813002/diff/20001/third_party/WebKit/Source/modules/webgl/WebGLContextGroup.cpp#newcode41 third_party/WebKit/Source/modules/webgl/WebGLContextGroup.cpp:41: m_contexts.add(context); You need to add a ...
4 years ago (2016-12-05 05:15:59 UTC) #30
Ken Russell (switch to Gerrit)
https://codereview.chromium.org/2547813002/diff/20001/third_party/WebKit/Source/modules/webgl/WebGLContextGroup.cpp File third_party/WebKit/Source/modules/webgl/WebGLContextGroup.cpp (right): https://codereview.chromium.org/2547813002/diff/20001/third_party/WebKit/Source/modules/webgl/WebGLContextGroup.cpp#newcode41 third_party/WebKit/Source/modules/webgl/WebGLContextGroup.cpp:41: m_contexts.add(context); On 2016/12/05 05:15:59, haraken wrote: > > You ...
4 years ago (2016-12-05 06:03:40 UTC) #31
haraken
https://codereview.chromium.org/2547813002/diff/20001/third_party/WebKit/Source/modules/webgl/WebGLContextGroup.cpp File third_party/WebKit/Source/modules/webgl/WebGLContextGroup.cpp (right): https://codereview.chromium.org/2547813002/diff/20001/third_party/WebKit/Source/modules/webgl/WebGLContextGroup.cpp#newcode41 third_party/WebKit/Source/modules/webgl/WebGLContextGroup.cpp:41: m_contexts.add(context); On 2016/12/05 06:03:40, Ken Russell wrote: > On ...
4 years ago (2016-12-05 06:08:40 UTC) #32
Ken Russell (switch to Gerrit)
4 years ago (2016-12-05 06:36:20 UTC) #33
Message was sent while issue was closed.
Addressing review feedback in this follow-on CL:
https://codereview.chromium.org/2548273002/

https://codereview.chromium.org/2547813002/diff/20001/third_party/WebKit/Sour...
File third_party/WebKit/Source/modules/webgl/WebGLContextGroup.cpp (right):

https://codereview.chromium.org/2547813002/diff/20001/third_party/WebKit/Sour...
third_party/WebKit/Source/modules/webgl/WebGLContextGroup.cpp:41:
m_contexts.add(context);
On 2016/12/05 06:08:39, haraken wrote:
> On 2016/12/05 06:03:40, Ken Russell wrote:
> > On 2016/12/05 05:15:59, haraken wrote:
> > > 
> > > You need to add a write barrier here.
> > 
> > What should it read?
> > 
> > ScriptWrappableVisitor::writeBarrier(this, context)?
> > ScriptWrappableVisitor::writeBarrier(this, m_contexts)?
> > ScriptWrappableVisitor::writeBarrier(m_contexts, context)?
> > 
> > From
> >
>
https://chromium.googlesource.com/chromium/src/+/master/third_party/WebKit/So...
> > I don't understand what the rules are when using a collection class holding
> > Members (or WeakMembers, in this case).
> 
> ScriptWrappableVisitor::writeBarrier(this, context)
> 
> Write barrier should be added from an object that has traceWrappers() to an
> object that has traceWrappers().

Thanks, will add.

https://codereview.chromium.org/2547813002/diff/20001/third_party/WebKit/Sour...
File third_party/WebKit/Source/modules/webgl/WebGLObject.h (right):

https://codereview.chromium.org/2547813002/diff/20001/third_party/WebKit/Sour...
third_party/WebKit/Source/modules/webgl/WebGLObject.h:94:
DECLARE_EAGER_FINALIZATION_OPERATOR_NEW();
On 2016/12/05 06:08:40, haraken wrote:
> On 2016/12/05 06:03:40, Ken Russell wrote:
> > On 2016/12/05 05:15:59, haraken wrote:
> > > 
> > > Do you need this macro?
> > 
> > Yes, we absolutely do. The entire point of this CL is to make WebGLObject
> > eagerly finalized before its context or context group, so that it has the
> > opportunity to use that context to delete itself, if the context isn't also
> > being destroyed. This is critical to ensure prompt reclamation of graphics
> > resources if the programmer loses references to potentially-expensive
objects
> > like WebGLBuffer or WebGLTexture.
> 
> EAGERLY_FINALIZE() is needed but DECLARE_EAGER_FINALIZATION_OPERATOR_NEW()
won't
> be needed.

Thanks for the clarification. Will fix. (Is there any documentation for this?
https://chromium.googlesource.com/chromium/src/+/master/third_party/WebKit/So...
is empty.)

https://codereview.chromium.org/2547813002/diff/20001/third_party/WebKit/Sour...
File third_party/WebKit/Source/modules/webgl/WebGLSharedObject.cpp (right):

https://codereview.chromium.org/2547813002/diff/20001/third_party/WebKit/Sour...
third_party/WebKit/Source/modules/webgl/WebGLSharedObject.cpp:49:
gpu::gles2::GLES2Interface* WebGLSharedObject::getAGLInterface() const {
On 2016/12/05 06:08:40, haraken wrote:
> On 2016/12/05 06:03:40, Ken Russell wrote:
> > On 2016/12/05 05:15:59, haraken wrote:
> > > 
> > > Don't we need to have a call path that clears m_contextGroup when WebGL
> object
> > > gets destructed?
> > 
> > Actually, looking at this code again, m_contextGroup is guaranteed to be
> > non-null. WebGLSharedObject maintains a strong reference to it. We don't
need
> to
> > zero it out in WebGLSharedObject's destructor.
> > 
> > As we discussed in https://codereview.chromium.org/2548153002/ , the only
> thing
> > that might happen is that all of m_contextGroup's weak references might be
> > cleared.
> > 
> > Should I change this code to:
> > 
> >   return m_contextGroup->getAGLInterface();
> > 
> > ?
> 
> Sounds nicer.

Will fix.

Powered by Google App Engine
This is Rietveld 408576698