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

Unified Diff: third_party/WebKit/Source/modules/webgl/WebGLContextGroup.cpp

Issue 2548153002: Remove now-incorrect assert in WebGLContextGroup. (Closed)
Patch Set: Created 4 years 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698