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

Unified Diff: Source/core/html/canvas/WebGLContextGroup.h

Issue 365653002: Oilpan: move 2D Canvas and WebGL objects to the heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Complete VectorTraits<> specialization for VertexAttribState Created 6 years, 6 months 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
Index: Source/core/html/canvas/WebGLContextGroup.h
diff --git a/Source/core/html/canvas/WebGLContextGroup.h b/Source/core/html/canvas/WebGLContextGroup.h
index 6c2f995354013332bda0e70ba332cefb2c2f7aec..e2d6fbf4f8d9e2dc3c99f98092ff9d2f579b9f27 100644
--- a/Source/core/html/canvas/WebGLContextGroup.h
+++ b/Source/core/html/canvas/WebGLContextGroup.h
@@ -27,6 +27,7 @@
#define WebGLContextGroup_h
#include "core/html/canvas/WebGLRenderingContextBase.h"
+#include "platform/heap/Handle.h"
#include "wtf/HashSet.h"
#include "wtf/PassRefPtr.h"
#include "wtf/RefCounted.h"
@@ -43,10 +44,10 @@ class WebGLRenderingContextBase;
typedef int ExceptionCode;
-class WebGLContextGroup FINAL : public RefCounted<WebGLContextGroup> {
+class WebGLContextGroup FINAL : public RefCountedWillBeGarbageCollected<WebGLContextGroup> {
+ DECLARE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(WebGLContextGroup);
public:
- static PassRefPtr<WebGLContextGroup> create();
- ~WebGLContextGroup();
+ static PassRefPtrWillBeRawPtr<WebGLContextGroup> create();
void addContext(WebGLRenderingContextBase*);
void removeContext(WebGLRenderingContextBase*);
haraken 2014/07/02 07:47:38 Can we add #if !ENABLE(OILPAN) to this method?
sof 2014/07/02 11:43:52 I don't think that's workable overall as contexts
@@ -58,6 +59,9 @@ public:
void loseContextGroup(WebGLRenderingContextBase::LostContextMode);
+ void trace(Visitor*);
+ void clearWeakMembers(Visitor*);
+
private:
friend class WebGLObject;
@@ -65,8 +69,17 @@ public:
void detachAndRemoveAllObjects();
- HashSet<WebGLRenderingContextBase*> m_contexts;
- HashSet<WebGLSharedObject*> m_groupObjects;
+ WillBeHeapHashSet<RawPtrWillBeWeakMember<WebGLRenderingContextBase> > m_contexts;
+ WillBeHeapHashSet<RawPtrWillBeWeakMember<WebGLSharedObject> > m_groupObjects;
+
+#if ENABLE(OILPAN)
+ // Oilpan: Weak context references are kept, so in order to handle
+ // the case where all contexts fall away and the group objects
+ // will have to be flushed, we save away a 3D context object during
+ // tracing. It will be used during the weak callback only and cleared
+ // then.
+ blink::WebGraphicsContext3D* m_savedContext;
+#endif
};
} // namespace WebCore

Powered by Google App Engine
This is Rietveld 408576698