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

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

Issue 2558853003: Use strong references from WebGLContextGroup to WebGLRenderingContextBase. (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 | « third_party/WebKit/Source/modules/webgl/WebGLContextGroup.h ('k') | 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 e2406d71941820713bca6b4258daf83fdccd70b1..5d881650f3f9b215e121c109f693d1ddbcfcd85f 100644
--- a/third_party/WebKit/Source/modules/webgl/WebGLContextGroup.cpp
+++ b/third_party/WebKit/Source/modules/webgl/WebGLContextGroup.cpp
@@ -30,24 +30,12 @@ namespace blink {
WebGLContextGroup::WebGLContextGroup() : m_numberOfContextLosses(0) {}
gpu::gles2::GLES2Interface* WebGLContextGroup::getAGLInterface() {
- // It's possible that all of the WebGLRenderingContextBases (currently
- // only one) referenced weakly by this WebGLContextGroup are GC'd before
- // the (shared) WebGLObjects that it created. Since the calling code
- // handles this gracefully, and since the graphical resources will have
- // been implicitly reclaimed by the deletion of the context, explicitly
- // test for this possibility.
- if (m_contexts.isEmpty())
- 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.
+ DCHECK(!m_contexts.isEmpty());
return (*m_contexts.begin())->contextGL();
}
void WebGLContextGroup::addContext(WebGLRenderingContextBase* context) {
- m_contexts.add(context);
- ScriptWrappableVisitor::writeBarrier(this, context);
+ m_contexts.add(TraceWrapperMember<WebGLRenderingContextBase>(this, context));
}
void WebGLContextGroup::loseContextGroup(
@@ -63,11 +51,8 @@ uint32_t WebGLContextGroup::numberOfContextLosses() const {
}
DEFINE_TRACE_WRAPPERS(WebGLContextGroup) {
- // TODO(kbr, mlippautz): need to use the manual write barrier since we
- // need to use weak members to get the desired semantics in Oilpan, but
- // no such TraceWrapperMember (like TraceWrapperWeakMember) exists yet.
for (auto context : m_contexts) {
- visitor->traceWrappersWithManualWriteBarrier(context);
+ visitor->traceWrappers(context);
}
}
« no previous file with comments | « third_party/WebKit/Source/modules/webgl/WebGLContextGroup.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698