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

Side by Side Diff: Source/bindings/scripts/code_generator_v8.pm

Issue 158273002: Remove [OverrideBuiltins] from HTMLCollection (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 10 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 # Copyright (C) 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> 1 # Copyright (C) 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org>
2 # Copyright (C) 2006 Anders Carlsson <andersca@mac.com> 2 # Copyright (C) 2006 Anders Carlsson <andersca@mac.com>
3 # Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> 3 # Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
4 # Copyright (C) 2006 Alexey Proskuryakov <ap@webkit.org> 4 # Copyright (C) 2006 Alexey Proskuryakov <ap@webkit.org>
5 # Copyright (C) 2006 Apple Computer, Inc. 5 # Copyright (C) 2006 Apple Computer, Inc.
6 # Copyright (C) 2007, 2008, 2009, 2012 Google Inc. 6 # Copyright (C) 2007, 2008, 2009, 2012 Google Inc.
7 # Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au> 7 # Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au>
8 # Copyright (C) Research In Motion Limited 2010. All rights reserved. 8 # Copyright (C) Research In Motion Limited 2010. All rights reserved.
9 # Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 9 # Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
10 # Copyright (C) 2012 Ericsson AB. All rights reserved. 10 # Copyright (C) 2012 Ericsson AB. All rights reserved.
(...skipping 4063 matching lines...) Expand 10 before | Expand all | Expand 10 after
4074 my $isNull = GenerateIsNullExpression($returnType, "element"); 4074 my $isNull = GenerateIsNullExpression($returnType, "element");
4075 my $nativeValue = "element"; 4075 my $nativeValue = "element";
4076 $nativeValue .= ".release()" if (IsRefPtrType($returnType)); 4076 $nativeValue .= ".release()" if (IsRefPtrType($returnType));
4077 my $returnJSValueCode = NativeToJSValue($namedGetterFunction->type, $namedGe tterFunction->extendedAttributes, $nativeValue, " ", "", "info.GetIsolate()", "info", "collection", "", "return"); 4077 my $returnJSValueCode = NativeToJSValue($namedGetterFunction->type, $namedGe tterFunction->extendedAttributes, $nativeValue, " ", "", "info.GetIsolate()", "info", "collection", "", "return");
4078 my $raisesExceptions = $namedGetterFunction->extendedAttributes->{"RaisesExc eption"}; 4078 my $raisesExceptions = $namedGetterFunction->extendedAttributes->{"RaisesExc eption"};
4079 my $methodCallCode = GenerateMethodCall($returnType, "element", "collection- >${methodName}", "propertyName", $raisesExceptions); 4079 my $methodCallCode = GenerateMethodCall($returnType, "element", "collection- >${methodName}", "propertyName", $raisesExceptions);
4080 4080
4081 my $code = "static void namedPropertyGetter(v8::Local<v8::String> name, cons t v8::PropertyCallbackInfo<v8::Value>& info)\n"; 4081 my $code = "static void namedPropertyGetter(v8::Local<v8::String> name, cons t v8::PropertyCallbackInfo<v8::Value>& info)\n";
4082 $code .= "{\n"; 4082 $code .= "{\n";
4083 if (!$interface->extendedAttributes->{"OverrideBuiltins"}) { 4083 if (!$interface->extendedAttributes->{"OverrideBuiltins"}) {
4084 $code .= " if (info.Holder()->HasRealNamedProperty(name))\n";
arv (Not doing code reviews) 2014/02/08 18:13:58 I looked into this too. I find this confusing. Ma
Inactive 2014/02/08 18:57:04 I looked at the V8 implementation and HasRealName
Inactive 2014/02/08 21:34:04 Here is the implementation of those 2 methods if y
4085 $code .= " return;\n";
4084 $code .= " if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(n ame).IsEmpty())\n"; 4086 $code .= " if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(n ame).IsEmpty())\n";
arv (Not doing code reviews) 2014/02/08 18:13:58 So confusing. Why is this Get and not Has?
Inactive 2014/02/08 18:57:04 This API does not have an Has equivalent for some
4085 $code .= " return;\n"; 4087 $code .= " return;\n";
4086 $code .= " if (info.Holder()->HasRealNamedCallbackProperty(name))\n";
4087 $code .= " return;\n";
4088 $code .= " if (info.Holder()->HasRealNamedProperty(name))\n";
4089 $code .= " return;\n";
4090 $code .= "\n"; 4088 $code .= "\n";
4091 } 4089 }
4092 $code .= " ${implClassName}* collection = ${v8ClassName}::toNative(info.H older());\n"; 4090 $code .= " ${implClassName}* collection = ${v8ClassName}::toNative(info.H older());\n";
4093 $code .= " AtomicString propertyName = toCoreAtomicString(name);\n"; 4091 $code .= " AtomicString propertyName = toCoreAtomicString(name);\n";
4094 if ($raisesExceptions) { 4092 if ($raisesExceptions) {
4095 $code .= " ExceptionState exceptionState(info.Holder(), info.GetIsola te());\n"; 4093 $code .= " ExceptionState exceptionState(info.Holder(), info.GetIsola te());\n";
4096 } 4094 }
4097 $code .= $methodCallCode . "\n"; 4095 $code .= $methodCallCode . "\n";
4098 if ($raisesExceptions) { 4096 if ($raisesExceptions) {
4099 $code .= " if (exceptionState.throwIfNeeded())\n"; 4097 $code .= " if (exceptionState.throwIfNeeded())\n";
(...skipping 16 matching lines...) Expand all
4116 my $interfaceName = $interface->name; 4114 my $interfaceName = $interface->name;
4117 4115
4118 my $type = $namedSetterFunction->parameters->[1]->type; 4116 my $type = $namedSetterFunction->parameters->[1]->type;
4119 my $raisesExceptions = $namedSetterFunction->extendedAttributes->{"RaisesExc eption"}; 4117 my $raisesExceptions = $namedSetterFunction->extendedAttributes->{"RaisesExc eption"};
4120 my $treatNullAs = $namedSetterFunction->parameters->[1]->extendedAttributes- >{"TreatNullAs"}; 4118 my $treatNullAs = $namedSetterFunction->parameters->[1]->extendedAttributes- >{"TreatNullAs"};
4121 my $treatUndefinedAs = $namedSetterFunction->parameters->[1]->extendedAttrib utes->{"TreatUndefinedAs"}; 4119 my $treatUndefinedAs = $namedSetterFunction->parameters->[1]->extendedAttrib utes->{"TreatUndefinedAs"};
4122 4120
4123 my $code = "static void namedPropertySetter(v8::Local<v8::String> name, v8:: Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<v8::Value>& info)\n"; 4121 my $code = "static void namedPropertySetter(v8::Local<v8::String> name, v8:: Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<v8::Value>& info)\n";
4124 $code .= "{\n"; 4122 $code .= "{\n";
4125 if (!$interface->extendedAttributes->{"OverrideBuiltins"}) { 4123 if (!$interface->extendedAttributes->{"OverrideBuiltins"}) {
4124 $code .= " if (info.Holder()->HasRealNamedProperty(name))\n";
4125 $code .= " return;\n";
4126 $code .= " if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(n ame).IsEmpty())\n"; 4126 $code .= " if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(n ame).IsEmpty())\n";
4127 $code .= " return;\n"; 4127 $code .= " return;\n";
4128 $code .= " if (info.Holder()->HasRealNamedCallbackProperty(name))\n";
4129 $code .= " return;\n";
4130 $code .= " if (info.Holder()->HasRealNamedProperty(name))\n";
4131 $code .= " return;\n";
4132 $code .= "\n"; 4128 $code .= "\n";
4133 } 4129 }
4134 4130
4135 my $asSetterValue = 0; 4131 my $asSetterValue = 0;
4136 $code .= " ${implClassName}* collection = ${v8ClassName}::toNative(info.H older());\n"; 4132 $code .= " ${implClassName}* collection = ${v8ClassName}::toNative(info.H older());\n";
4137 $code .= JSValueToNativeStatement($namedSetterFunction->parameters->[0]->typ e, $namedSetterFunction->extendedAttributes, $asSetterValue, "name", "propertyNa me", " ", "info.GetIsolate()"); 4133 $code .= JSValueToNativeStatement($namedSetterFunction->parameters->[0]->typ e, $namedSetterFunction->extendedAttributes, $asSetterValue, "name", "propertyNa me", " ", "info.GetIsolate()");
4138 $code .= JSValueToNativeStatement($namedSetterFunction->parameters->[1]->typ e, $namedSetterFunction->extendedAttributes, $asSetterValue, "jsValue", "propert yValue", " ", "info.GetIsolate()"); 4134 $code .= JSValueToNativeStatement($namedSetterFunction->parameters->[1]->typ e, $namedSetterFunction->extendedAttributes, $asSetterValue, "jsValue", "propert yValue", " ", "info.GetIsolate()");
4139 4135
4140 my $extraArguments = ""; 4136 my $extraArguments = "";
4141 if ($raisesExceptions || IsIntegerType($type)) { 4137 if ($raisesExceptions || IsIntegerType($type)) {
(...skipping 2341 matching lines...) Expand 10 before | Expand all | Expand 10 after
6483 if ($parameter->type eq "SerializedScriptValue") { 6479 if ($parameter->type eq "SerializedScriptValue") {
6484 return 1; 6480 return 1;
6485 } elsif (IsIntegerType($parameter->type)) { 6481 } elsif (IsIntegerType($parameter->type)) {
6486 return 1; 6482 return 1;
6487 } 6483 }
6488 } 6484 }
6489 return 0; 6485 return 0;
6490 } 6486 }
6491 6487
6492 1; 6488 1;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698