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

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

Issue 1414553002: Fix out-of-memory crashes related to ArrayBuffer allocation Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase+more tweaks Created 5 years, 1 month 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/WebGLRenderingContextBase.cpp
diff --git a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
index bd0e6118d7a75771929261732a313375941ff9eb..304a8e9682bd407146cbc7eb800894552ded4dbb 100644
--- a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
+++ b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
@@ -2810,7 +2810,7 @@ ScriptValue WebGLRenderingContextBase::getParameter(ScriptState* scriptState, GL
case GL_COLOR_WRITEMASK:
return getBooleanArrayParameter(scriptState, pname);
case GL_COMPRESSED_TEXTURE_FORMATS:
- return WebGLAny(scriptState, DOMUint32Array::create(m_compressedTextureFormats.data(), m_compressedTextureFormats.size()));
+ return WebGLAny(scriptState, DOMUint32Array::deprecatedCreateOrCrash(m_compressedTextureFormats.data(), m_compressedTextureFormats.size()));
case GL_CULL_FACE:
return getBooleanParameter(scriptState, pname);
case GL_CULL_FACE_MODE:
@@ -3397,21 +3397,21 @@ ScriptValue WebGLRenderingContextBase::getUniform(ScriptState* scriptState, WebG
webContext()->getUniformfv(objectOrZero(program), location, value);
if (length == 1)
return WebGLAny(scriptState, value[0]);
- return WebGLAny(scriptState, DOMFloat32Array::create(value, length));
+ return WebGLAny(scriptState, DOMFloat32Array::deprecatedCreateOrCrash(value, length));
}
case GL_INT: {
GLint value[4] = {0};
webContext()->getUniformiv(objectOrZero(program), location, value);
if (length == 1)
return WebGLAny(scriptState, value[0]);
- return WebGLAny(scriptState, DOMInt32Array::create(value, length));
+ return WebGLAny(scriptState, DOMInt32Array::deprecatedCreateOrCrash(value, length));
}
case GL_UNSIGNED_INT: {
GLuint value[4] = {0};
webContext()->getUniformuiv(objectOrZero(program), location, value);
if (length == 1)
return WebGLAny(scriptState, value[0]);
- return WebGLAny(scriptState, DOMUint32Array::create(value, length));
+ return WebGLAny(scriptState, DOMUint32Array::deprecatedCreateOrCrash(value, length));
}
case GL_BOOL: {
GLint value[4] = {0};
@@ -3489,11 +3489,11 @@ ScriptValue WebGLRenderingContextBase::getVertexAttrib(ScriptState* scriptState,
VertexAttribValue& attribValue = m_vertexAttribValue[index];
switch (attribValue.type) {
case Float32ArrayType:
- return WebGLAny(scriptState, DOMFloat32Array::create(attribValue.value.floatValue, 4));
+ return WebGLAny(scriptState, DOMFloat32Array::deprecatedCreateOrCrash(attribValue.value.floatValue, 4));
case Int32ArrayType:
- return WebGLAny(scriptState, DOMInt32Array::create(attribValue.value.intValue, 4));
+ return WebGLAny(scriptState, DOMInt32Array::deprecatedCreateOrCrash(attribValue.value.intValue, 4));
case Uint32ArrayType:
- return WebGLAny(scriptState, DOMUint32Array::create(attribValue.value.uintValue, 4));
+ return WebGLAny(scriptState, DOMUint32Array::deprecatedCreateOrCrash(attribValue.value.uintValue, 4));
default:
ASSERT_NOT_REACHED();
break;
@@ -5363,7 +5363,7 @@ ScriptValue WebGLRenderingContextBase::getWebGLFloatArrayParameter(ScriptState*
default:
notImplemented();
}
- return WebGLAny(scriptState, DOMFloat32Array::create(value, length));
+ return WebGLAny(scriptState, DOMFloat32Array::deprecatedCreateOrCrash(value, length));
}
ScriptValue WebGLRenderingContextBase::getWebGLIntArrayParameter(ScriptState* scriptState, GLenum pname)
@@ -5383,7 +5383,7 @@ ScriptValue WebGLRenderingContextBase::getWebGLIntArrayParameter(ScriptState* sc
default:
notImplemented();
}
- return WebGLAny(scriptState, DOMInt32Array::create(value, length));
+ return WebGLAny(scriptState, DOMInt32Array::deprecatedCreateOrCrash(value, length));
}
void WebGLRenderingContextBase::handleTextureCompleteness(const char* functionName, bool prepareToDraw)

Powered by Google App Engine
This is Rietveld 408576698