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

Side by Side Diff: third_party/WebKit/Source/modules/webgl/WebGLVertexArrayObjectBase.cpp

Issue 2273683003: Use visitDOMWrapper to preserve WebGL JS object wrappers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "modules/webgl/WebGLVertexArrayObjectBase.h" 5 #include "modules/webgl/WebGLVertexArrayObjectBase.h"
6 6
7 #include "gpu/command_buffer/client/gles2_interface.h" 7 #include "gpu/command_buffer/client/gles2_interface.h"
8 #include "modules/webgl/WebGLRenderingContextBase.h" 8 #include "modules/webgl/WebGLRenderingContextBase.h"
9 9
10 namespace blink { 10 namespace blink {
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 133
134 for (size_t i = 0; i < m_arrayBufferList.size(); ++i) { 134 for (size_t i = 0; i < m_arrayBufferList.size(); ++i) {
135 if (m_arrayBufferList[i] == buffer) { 135 if (m_arrayBufferList[i] == buffer) {
136 m_arrayBufferList[i]->onDetached(context()->contextGL()); 136 m_arrayBufferList[i]->onDetached(context()->contextGL());
137 m_arrayBufferList[i] = nullptr; 137 m_arrayBufferList[i] = nullptr;
138 } 138 }
139 } 139 }
140 updateAttribBufferBoundStatus(); 140 updateAttribBufferBoundStatus();
141 } 141 }
142 142
143 ScopedPersistent<v8::Array>* WebGLVertexArrayObjectBase::getPersistentCache() 143 void WebGLVertexArrayObjectBase::visitChildDOMWrappers(v8::Isolate* isolate, con st v8::Persistent<v8::Object>& wrapper)
144 { 144 {
145 return &m_arrayBufferWrappers; 145 trySetWrapperReferencesInAllWorlds(wrapper, this, isolate);
Ken Russell (switch to Gerrit) 2016/09/01 21:03:53 Same comment here.
Kai Ninomiya 2016/09/02 18:29:22 Done.
146 trySetWrapperReferencesInAllWorlds(wrapper, m_boundElementArrayBuffer, isola te);
147 for (size_t i = 0; i < m_arrayBufferList.size(); ++i) {
148 trySetWrapperReferencesInAllWorlds(wrapper, m_arrayBufferList[i], isolat e);
149 }
146 } 150 }
147 151
148 DEFINE_TRACE(WebGLVertexArrayObjectBase) 152 DEFINE_TRACE(WebGLVertexArrayObjectBase)
149 { 153 {
150 visitor->trace(m_boundElementArrayBuffer); 154 visitor->trace(m_boundElementArrayBuffer);
151 visitor->trace(m_arrayBufferList); 155 visitor->trace(m_arrayBufferList);
152 WebGLContextObject::trace(visitor); 156 WebGLContextObject::trace(visitor);
153 } 157 }
154 158
155 } // namespace blink 159 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698