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

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

Issue 2023603003: Fix content scripts that use WebGL. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@yukishiino-v8privateproperty-fix
Patch Set: Rebased. Created 4 years, 7 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: third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp
diff --git a/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp b/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp
index 7cfd619db6c863d5bdcb01e239d49562bad9dadb..8b626823727292bc0674be52b5a2f4651a3e7ad3 100644
--- a/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp
+++ b/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp
@@ -321,11 +321,11 @@ void WebGL2RenderingContextBase::framebufferTextureLayer(ScriptState* scriptStat
// We divide it here so in WebGLFramebuffer, we don't have to handle DEPTH_STENCIL_ATTACHMENT in WebGL 2.
framebufferBinding->setAttachmentForBoundFramebuffer(target, GL_DEPTH_ATTACHMENT, textarget, texture, level, layer);
framebufferBinding->setAttachmentForBoundFramebuffer(target, GL_STENCIL_ATTACHMENT, textarget, texture, level, layer);
- preserveObjectWrapper(scriptState, framebufferBinding, V8HiddenValue::webglAttachments(scriptState->isolate()), framebufferBinding->getPersistentCache(), GL_DEPTH_ATTACHMENT, texture);
- preserveObjectWrapper(scriptState, framebufferBinding, V8HiddenValue::webglAttachments(scriptState->isolate()), framebufferBinding->getPersistentCache(), GL_STENCIL_ATTACHMENT, texture);
+ preserveObjectWrapper(scriptState, framebufferBinding, V8PrivateProperty::getWebGLFramebufferAttachments(scriptState->isolate()), GL_DEPTH_ATTACHMENT, texture);
+ preserveObjectWrapper(scriptState, framebufferBinding, V8PrivateProperty::getWebGLFramebufferAttachments(scriptState->isolate()), GL_STENCIL_ATTACHMENT, texture);
} else {
framebufferBinding->setAttachmentForBoundFramebuffer(target, attachment, textarget, texture, level, layer);
- preserveObjectWrapper(scriptState, framebufferBinding, V8HiddenValue::webglAttachments(scriptState->isolate()), framebufferBinding->getPersistentCache(), attachment, texture);
+ preserveObjectWrapper(scriptState, framebufferBinding, V8PrivateProperty::getWebGLFramebufferAttachments(scriptState->isolate()), attachment, texture);
Yuki 2016/06/02 13:07:22 Could you tell us why you need to preserve the wra
Ken Russell (switch to Gerrit) 2016/06/03 00:59:19 Yes, the wrapper objects need to be kept alive, pe
}
applyStencilTest();
}
@@ -1778,7 +1778,7 @@ void WebGL2RenderingContextBase::beginQuery(ScriptState* scriptState, GLenum tar
query->setTarget(target);
contextGL()->BeginQueryEXT(target, query->object());
- preserveObjectWrapper(scriptState, this, V8HiddenValue::webglQueries(scriptState->isolate()), &m_queryWrappers, static_cast<uint32_t>(target), query);
+ preserveObjectWrapper(scriptState, this, V8PrivateProperty::getWebGLRenderingContextQueries(scriptState->isolate()), static_cast<uint32_t>(target), query);
}
void WebGL2RenderingContextBase::endQuery(GLenum target)
@@ -1938,7 +1938,7 @@ void WebGL2RenderingContextBase::bindSampler(ScriptState* scriptState, GLuint un
contextGL()->BindSampler(unit, objectOrZero(sampler));
- preserveObjectWrapper(scriptState, this, V8HiddenValue::webglSamplers(scriptState->isolate()), &m_samplerWrappers, static_cast<uint32_t>(unit), sampler);
+ preserveObjectWrapper(scriptState, this, V8PrivateProperty::getWebGLRenderingContextSamplers(scriptState->isolate()), static_cast<uint32_t>(unit), sampler);
}
void WebGL2RenderingContextBase::samplerParameter(WebGLSampler* sampler, GLenum pname, GLfloat paramf, GLint parami, bool isFloat)
@@ -2197,7 +2197,7 @@ void WebGL2RenderingContextBase::bindTransformFeedback(ScriptState* scriptState,
contextGL()->BindTransformFeedback(target, objectOrZero(feedback));
if (feedback) {
feedback->setTarget(target);
- preserveObjectWrapper(scriptState, this, V8HiddenValue::webglMisc(scriptState->isolate()), &m_miscWrappers, static_cast<uint32_t>(PreservedTransformFeedback), feedback);
+ preserveObjectWrapper(scriptState, this, V8PrivateProperty::getWebGLRenderingContextMisc(scriptState->isolate()), static_cast<uint32_t>(PreservedTransformFeedback), feedback);
}
}
@@ -2738,7 +2738,7 @@ void WebGL2RenderingContextBase::bindFramebuffer(ScriptState* scriptState, GLenu
setFramebuffer(target, buffer);
if (scriptState) {
- preserveObjectWrapper(scriptState, this, V8HiddenValue::webglMisc(scriptState->isolate()), &m_miscWrappers, static_cast<uint32_t>(PreservedFramebuffer), buffer);
+ preserveObjectWrapper(scriptState, this, V8PrivateProperty::getWebGLRenderingContextMisc(scriptState->isolate()), static_cast<uint32_t>(PreservedFramebuffer), buffer);
}
}

Powered by Google App Engine
This is Rietveld 408576698