Chromium Code Reviews| Index: third_party/WebKit/Source/modules/webgl/WebGLObject.h |
| diff --git a/third_party/WebKit/Source/modules/webgl/WebGLObject.h b/third_party/WebKit/Source/modules/webgl/WebGLObject.h |
| index 6fe0442298e365e767876869325286932dc2abce..50aad57ab19205c8edcb3199eb49434e20ab56ba 100644 |
| --- a/third_party/WebKit/Source/modules/webgl/WebGLObject.h |
| +++ b/third_party/WebKit/Source/modules/webgl/WebGLObject.h |
| @@ -26,6 +26,7 @@ |
| #ifndef WebGLObject_h |
| #define WebGLObject_h |
| +#include "bindings/core/v8/DOMWrapperWorld.h" |
| #include "bindings/core/v8/ScriptWrappable.h" |
| #include "platform/heap/Handle.h" |
| #include "third_party/khronos/GLES2/gl2.h" |
| @@ -77,9 +78,20 @@ public: |
| virtual bool validate(const WebGLContextGroup*, const WebGLRenderingContextBase*) const = 0; |
| virtual bool hasObject() const = 0; |
| + static void trySetWrapperReferencesInAllWorlds(const v8::Persistent<v8::Object>& wrapper, ScriptWrappable* scriptWrappable, v8::Isolate* isolate) |
| + { |
| + if (scriptWrappable) { |
|
haraken
2016/08/31 23:14:50
I'd prefer moving the null check to DOMWrapperWorl
Kai Ninomiya
2016/09/02 18:29:22
Done.
|
| + DOMWrapperWorld::setWrapperReferencesInAllWorlds(wrapper, scriptWrappable, isolate); |
| + } |
| + } |
| + |
| DEFINE_INLINE_VIRTUAL_TRACE() { } |
| protected: |
| + // To allow WebGL[2]RenderingContextBase to call visitChildDOMWrappers. |
| + friend class WebGLRenderingContextBase; |
| + friend class WebGL2RenderingContextBase; |
| + |
| explicit WebGLObject(WebGLRenderingContextBase*); |
| // deleteObjectImpl should be only called once to delete the OpenGL resource. |
| @@ -93,6 +105,8 @@ protected: |
| virtual gpu::gles2::GLES2Interface* getAGLInterface() const = 0; |
| + virtual void visitChildDOMWrappers(v8::Isolate*, const v8::Persistent<v8::Object>&) { } |
| + |
| private: |
| unsigned m_attachmentCount; |
| bool m_deleted; |