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

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

Issue 386953002: Make WebGLRenderingContext.getAttachedShaders() return type nullable (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fix additional test expectations Created 6 years, 5 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: 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 cf7a3e4ba387949bf347385b6f7adbf7e7f05b2c..952fadf1f0b7ae962f2e4e7104d179819bf182a2 100644
--- a/Source/bindings/core/v8/custom/V8WebGLRenderingContextCustom.cpp
+++ b/Source/bindings/core/v8/custom/V8WebGLRenderingContextCustom.cpp
@@ -325,39 +325,6 @@ static WebGLUniformLocation* toWebGLUniformLocation(v8::Handle<v8::Value> value,
return V8WebGLUniformLocation::toNativeWithTypeCheck(isolate, value);
}
-enum WhichProgramCall {
- kProgramParameter, kUniform
-};
-
-void V8WebGLRenderingContext::getAttachedShadersMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
-{
- ExceptionState exceptionState(ExceptionState::ExecutionContext, "getAttachedShaders", "WebGLRenderingContext", info.Holder(), info.GetIsolate());
- if (info.Length() < 1) {
- exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
- exceptionState.throwIfNeeded();
- return;
- }
-
- const int programArgumentIndex = 0;
- WebGLRenderingContext* context = V8WebGLRenderingContext::toNative(info.Holder());
- if (info.Length() > 0 && !isUndefinedOrNull(info[programArgumentIndex]) && !V8WebGLProgram::hasInstance(info[programArgumentIndex], info.GetIsolate())) {
- exceptionState.throwTypeError(ExceptionMessages::argumentNullOrIncorrectType(programArgumentIndex + 1, "WebGLProgram"));
- exceptionState.throwIfNeeded();
- return;
- }
- WebGLProgram* program = V8WebGLProgram::toNativeWithTypeCheck(info.GetIsolate(), info[programArgumentIndex]);
- Vector<RefPtr<WebGLShader> > shaders;
- bool succeed = context->getAttachedShaders(program, shaders);
- if (!succeed) {
- v8SetReturnValueNull(info);
- return;
- }
- v8::Local<v8::Array> array = v8::Array::New(info.GetIsolate(), shaders.size());
- for (size_t ii = 0; ii < shaders.size(); ++ii)
- array->Set(v8::Integer::New(info.GetIsolate(), ii), toV8(shaders[ii].get(), info.Holder(), info.GetIsolate()));
- v8SetReturnValue(info, array);
-}
-
void V8WebGLRenderingContext::getBufferParameterMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
{
ExceptionState exceptionState(ExceptionState::ExecutionContext, "getBufferParameter", "WebGLRenderingContext", info.Holder(), info.GetIsolate());

Powered by Google App Engine
This is Rietveld 408576698