Chromium Code Reviews| Index: third_party/WebKit/Source/modules/webgl/WebGLContextGroup.cpp |
| diff --git a/third_party/WebKit/Source/modules/webgl/WebGLContextGroup.cpp b/third_party/WebKit/Source/modules/webgl/WebGLContextGroup.cpp |
| index 46ac62e5f1abe5aea8b3ddb2a0f502d97ba25661..0f7d79f5a4c0f6b25924bc361c1219bb6ae7844e 100644 |
| --- a/third_party/WebKit/Source/modules/webgl/WebGLContextGroup.cpp |
| +++ b/third_party/WebKit/Source/modules/webgl/WebGLContextGroup.cpp |
| @@ -30,7 +30,13 @@ namespace blink { |
| WebGLContextGroup::WebGLContextGroup() : m_numberOfContextLosses(0) {} |
| gpu::gles2::GLES2Interface* WebGLContextGroup::getAGLInterface() { |
| - ASSERT(!m_contexts.isEmpty()); |
| + // During an Oilpan GC where WebGL objects become unreachable at the same |
| + // time the context does, the m_contexts set can be fully cleared out |
| + // before WebGLObjects' destructors run. Since the calling code handles |
| + // this gracefully, explicitly test for this possibility. |
| + if (m_contexts.isEmpty()) |
|
haraken
2016/12/05 01:31:10
Hmm, I'm not sure if this works.
If A's destructo
Ken Russell (switch to Gerrit)
2016/12/05 01:38:13
m_contexts is a HeapHashSet containing WeakMembers
haraken
2016/12/05 01:47:25
Remember that if both WebGLObject and WebGLContext
Ken Russell (switch to Gerrit)
2016/12/05 01:59:37
When exactly in Oilpan's GC cycle does weak proces
|
| + return nullptr; |
| + |
| // Weak processing removes dead entries from the HeapHashSet, so it's |
| // guaranteed that this will not return null for the reason that a |
| // WeakMember was nulled out. |