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

Unified Diff: Source/bindings/core/v8/custom/V8WebGLRenderingContextCustom.cpp

Issue 555133003: Use ExceptionState to throw exceptions when converting arrays (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebased Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/bindings/core/v8/custom/V8MessageEventCustom.cpp ('k') | Source/bindings/scripts/v8_methods.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/core/v8/custom/V8WebGLRenderingContextCustom.cpp
diff --git a/Source/bindings/core/v8/custom/V8WebGLRenderingContextCustom.cpp b/Source/bindings/core/v8/custom/V8WebGLRenderingContextCustom.cpp
index 87b109589e996100b4a2778db493996fb4bc119d..0b61b748235113238cac6f02e7a984fd63cb0452 100644
--- a/Source/bindings/core/v8/custom/V8WebGLRenderingContextCustom.cpp
+++ b/Source/bindings/core/v8/custom/V8WebGLRenderingContextCustom.cpp
@@ -539,12 +539,9 @@ static void vertexAttribAndUniformHelperf(const v8::FunctionCallbackInfo<v8::Val
exceptionState.throwTypeError("Array length exceeds supported limit.");
return;
}
- v8::TryCatch block;
- Vector<float> implArray = toImplArray<float>(array, 0, info.GetIsolate());
- if (block.HasCaught()) {
- block.ReThrow();
+ Vector<float> implArray = toImplArray<float>(array, 0, info.GetIsolate(), exceptionState);
+ if (exceptionState.hadException())
return;
- }
switch (functionToCall) {
case kUniform1v: context->uniform1fv(location, implArray.data(), implArray.size()); break;
case kUniform2v: context->uniform2fv(location, implArray.data(), implArray.size()); break;
@@ -609,12 +606,9 @@ static void uniformHelperi(const v8::FunctionCallbackInfo<v8::Value>& info, Func
exceptionState.throwTypeError("Array length exceeds supported limit.");
return;
}
- v8::TryCatch block;
- Vector<int> implArray = toImplArray<int>(array, 0, info.GetIsolate());
- if (block.HasCaught()) {
- block.ReThrow();
+ Vector<int> implArray = toImplArray<int>(array, 0, info.GetIsolate(), exceptionState);
+ if (exceptionState.hadException())
return;
- }
switch (functionToCall) {
case kUniform1v: context->uniform1iv(location, implArray.data(), implArray.size()); break;
case kUniform2v: context->uniform2iv(location, implArray.data(), implArray.size()); break;
@@ -723,12 +717,9 @@ static void uniformMatrixHelper(const v8::FunctionCallbackInfo<v8::Value>& info,
exceptionState.throwTypeError("Array length exceeds supported limit.");
return;
}
- v8::TryCatch block;
- Vector<float> implArray = toImplArray<float>(array, 0, info.GetIsolate());
- if (block.HasCaught()) {
- block.ReThrow();
+ Vector<float> implArray = toImplArray<float>(array, 0, info.GetIsolate(), exceptionState);
+ if (exceptionState.hadException())
return;
- }
switch (matrixSize) {
case 2: context->uniformMatrix2fv(location, transpose, implArray.data(), implArray.size()); break;
case 3: context->uniformMatrix3fv(location, transpose, implArray.data(), implArray.size()); break;
« no previous file with comments | « Source/bindings/core/v8/custom/V8MessageEventCustom.cpp ('k') | Source/bindings/scripts/v8_methods.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698