| Index: Source/bindings/v8/custom/V8HTMLCanvasElementCustom.cpp
|
| diff --git a/Source/bindings/v8/custom/V8HTMLCanvasElementCustom.cpp b/Source/bindings/v8/custom/V8HTMLCanvasElementCustom.cpp
|
| index eb863d76fb16fc310f59f302f4147b4f3bb18380..0f791dbc489b710145ed08e6cee6aff225baba81 100644
|
| --- a/Source/bindings/v8/custom/V8HTMLCanvasElementCustom.cpp
|
| +++ b/Source/bindings/v8/custom/V8HTMLCanvasElementCustom.cpp
|
| @@ -47,17 +47,17 @@
|
|
|
| namespace WebCore {
|
|
|
| -void V8HTMLCanvasElement::getContextMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& args)
|
| +void V8HTMLCanvasElement::getContextMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| {
|
| - v8::Handle<v8::Object> holder = args.Holder();
|
| + v8::Handle<v8::Object> holder = info.Holder();
|
| HTMLCanvasElement* imp = V8HTMLCanvasElement::toNative(holder);
|
| - V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, contextIdResource, args[0]);
|
| + V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, contextIdResource, info[0]);
|
| String contextId = contextIdResource;
|
| RefPtr<CanvasContextAttributes> attributes;
|
| if (contextId == "webgl" || contextId == "experimental-webgl" || contextId == "webkit-3d") {
|
| RefPtr<WebGLContextAttributes> webGLAttributes = WebGLContextAttributes::create();
|
| - if (args.Length() > 1 && args[1]->IsObject()) {
|
| - v8::Handle<v8::Object> jsAttributes = args[1]->ToObject();
|
| + if (info.Length() > 1 && info[1]->IsObject()) {
|
| + v8::Handle<v8::Object> jsAttributes = info[1]->ToObject();
|
| v8::Handle<v8::String> alpha = v8::String::NewSymbol("alpha");
|
| if (jsAttributes->Has(alpha))
|
| webGLAttributes->setAlpha(jsAttributes->Get(alpha)->BooleanValue());
|
| @@ -80,8 +80,8 @@ void V8HTMLCanvasElement::getContextMethodCustom(const v8::FunctionCallbackInfo<
|
| attributes = webGLAttributes;
|
| } else {
|
| RefPtr<Canvas2DContextAttributes> canvas2DAttributes = Canvas2DContextAttributes::create();
|
| - if (args.Length() > 1 && args[1]->IsObject()) {
|
| - v8::Handle<v8::Object> jsAttributes = args[1]->ToObject();
|
| + if (info.Length() > 1 && info[1]->IsObject()) {
|
| + v8::Handle<v8::Object> jsAttributes = info[1]->ToObject();
|
| v8::Handle<v8::String> alpha = v8::String::NewSymbol("alpha");
|
| if (jsAttributes->Has(alpha))
|
| canvas2DAttributes->setAlpha(jsAttributes->Get(alpha)->BooleanValue());
|
| @@ -90,58 +90,58 @@ void V8HTMLCanvasElement::getContextMethodCustom(const v8::FunctionCallbackInfo<
|
| }
|
| CanvasRenderingContext* result = imp->getContext(contextId, attributes.get());
|
| if (!result) {
|
| - v8SetReturnValueNull(args);
|
| + v8SetReturnValueNull(info);
|
| return;
|
| }
|
| if (result->is2d()) {
|
| - v8::Handle<v8::Value> v8Result = toV8(static_cast<CanvasRenderingContext2D*>(result), args.Holder(), args.GetIsolate());
|
| + v8::Handle<v8::Value> v8Result = toV8(static_cast<CanvasRenderingContext2D*>(result), info.Holder(), info.GetIsolate());
|
| if (InspectorInstrumentation::canvasAgentEnabled(&imp->document())) {
|
| ScriptState* scriptState = ScriptState::forContext(v8::Context::GetCurrent());
|
| ScriptObject context(scriptState, v8::Handle<v8::Object>::Cast(v8Result));
|
| ScriptObject wrapped = InspectorInstrumentation::wrapCanvas2DRenderingContextForInstrumentation(&imp->document(), context);
|
| if (!wrapped.hasNoValue()) {
|
| - v8SetReturnValue(args, wrapped.v8Value());
|
| + v8SetReturnValue(info, wrapped.v8Value());
|
| return;
|
| }
|
| }
|
| - v8SetReturnValue(args, v8Result);
|
| + v8SetReturnValue(info, v8Result);
|
| return;
|
| }
|
| if (result->is3d()) {
|
| - v8::Handle<v8::Value> v8Result = toV8(static_cast<WebGLRenderingContext*>(result), args.Holder(), args.GetIsolate());
|
| + v8::Handle<v8::Value> v8Result = toV8(static_cast<WebGLRenderingContext*>(result), info.Holder(), info.GetIsolate());
|
| if (InspectorInstrumentation::canvasAgentEnabled(&imp->document())) {
|
| ScriptState* scriptState = ScriptState::forContext(v8::Context::GetCurrent());
|
| ScriptObject glContext(scriptState, v8::Handle<v8::Object>::Cast(v8Result));
|
| ScriptObject wrapped = InspectorInstrumentation::wrapWebGLRenderingContextForInstrumentation(&imp->document(), glContext);
|
| if (!wrapped.hasNoValue()) {
|
| - v8SetReturnValue(args, wrapped.v8Value());
|
| + v8SetReturnValue(info, wrapped.v8Value());
|
| return;
|
| }
|
| }
|
| - v8SetReturnValue(args, v8Result);
|
| + v8SetReturnValue(info, v8Result);
|
| return;
|
| }
|
| ASSERT_NOT_REACHED();
|
| - v8SetReturnValueNull(args);
|
| + v8SetReturnValueNull(info);
|
| }
|
|
|
| -void V8HTMLCanvasElement::toDataURLMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& args)
|
| +void V8HTMLCanvasElement::toDataURLMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| {
|
| - v8::Handle<v8::Object> holder = args.Holder();
|
| + v8::Handle<v8::Object> holder = info.Holder();
|
| HTMLCanvasElement* canvas = V8HTMLCanvasElement::toNative(holder);
|
| - ExceptionState es(args.GetIsolate());
|
| + ExceptionState es(info.GetIsolate());
|
|
|
| - V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, type, args[0]);
|
| + V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, type, info[0]);
|
| double quality;
|
| double* qualityPtr = 0;
|
| - if (args.Length() > 1 && args[1]->IsNumber()) {
|
| - quality = args[1]->NumberValue();
|
| + if (info.Length() > 1 && info[1]->IsNumber()) {
|
| + quality = info[1]->NumberValue();
|
| qualityPtr = &quality;
|
| }
|
|
|
| String result = canvas->toDataURL(type, qualityPtr, es);
|
| es.throwIfNeeded();
|
| - v8SetReturnValueStringOrUndefined(args, result, args.GetIsolate());
|
| + v8SetReturnValueStringOrUndefined(info, result, info.GetIsolate());
|
| }
|
|
|
| } // namespace WebCore
|
|
|