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

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

Issue 113213002: Rename toWebCoreString*() utility methods to toCoreString*() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Keep "to" prefix Created 7 years 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
« no previous file with comments | « no previous file | Source/bindings/tests/results/V8TestEventTarget.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 3949 matching lines...) Expand 10 before | Expand all | Expand 10 after
3960 $code .= " if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(n ame).IsEmpty())\n"; 3960 $code .= " if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(n ame).IsEmpty())\n";
3961 $code .= " return;\n"; 3961 $code .= " return;\n";
3962 $code .= " if (info.Holder()->HasRealNamedCallbackProperty(name))\n"; 3962 $code .= " if (info.Holder()->HasRealNamedCallbackProperty(name))\n";
3963 $code .= " return;\n"; 3963 $code .= " return;\n";
3964 $code .= " if (info.Holder()->HasRealNamedProperty(name))\n"; 3964 $code .= " if (info.Holder()->HasRealNamedProperty(name))\n";
3965 $code .= " return;\n"; 3965 $code .= " return;\n";
3966 } 3966 }
3967 $code .= "\n"; 3967 $code .= "\n";
3968 $code .= " ASSERT(V8DOMWrapper::maybeDOMWrapper(info.Holder()));\n"; 3968 $code .= " ASSERT(V8DOMWrapper::maybeDOMWrapper(info.Holder()));\n";
3969 $code .= " ${implClassName}* collection = ${v8ClassName}::toNative(info.H older());\n"; 3969 $code .= " ${implClassName}* collection = ${v8ClassName}::toNative(info.H older());\n";
3970 $code .= " AtomicString propertyName = toWebCoreAtomicString(name);\n"; 3970 $code .= " AtomicString propertyName = toCoreAtomicString(name);\n";
3971 if ($raisesExceptions) { 3971 if ($raisesExceptions) {
3972 $code .= " ExceptionState exceptionState(info.Holder(), info.GetIsola te());\n"; 3972 $code .= " ExceptionState exceptionState(info.Holder(), info.GetIsola te());\n";
3973 } 3973 }
3974 $code .= $methodCallCode . "\n"; 3974 $code .= $methodCallCode . "\n";
3975 if ($raisesExceptions) { 3975 if ($raisesExceptions) {
3976 $code .= " if (exceptionState.throwIfNeeded())\n"; 3976 $code .= " if (exceptionState.throwIfNeeded())\n";
3977 $code .= " return;\n"; 3977 $code .= " return;\n";
3978 } 3978 }
3979 if (IsUnionType($returnType)) { 3979 if (IsUnionType($returnType)) {
3980 $code .= "${returnJSValueCode}\n"; 3980 $code .= "${returnJSValueCode}\n";
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
4079 my $namedDeleterFunction = shift; 4079 my $namedDeleterFunction = shift;
4080 my $implClassName = GetImplName($interface); 4080 my $implClassName = GetImplName($interface);
4081 my $v8ClassName = GetV8ClassName($interface); 4081 my $v8ClassName = GetV8ClassName($interface);
4082 my $methodName = GetImplName($namedDeleterFunction); 4082 my $methodName = GetImplName($namedDeleterFunction);
4083 4083
4084 my $raisesExceptions = $namedDeleterFunction->extendedAttributes->{"RaisesEx ception"}; 4084 my $raisesExceptions = $namedDeleterFunction->extendedAttributes->{"RaisesEx ception"};
4085 4085
4086 my $code = "static void namedPropertyDeleter(v8::Local<v8::String> name, con st v8::PropertyCallbackInfo<v8::Boolean>& info)\n"; 4086 my $code = "static void namedPropertyDeleter(v8::Local<v8::String> name, con st v8::PropertyCallbackInfo<v8::Boolean>& info)\n";
4087 $code .= "{\n"; 4087 $code .= "{\n";
4088 $code .= " ${implClassName}* collection = ${v8ClassName}::toNative(info.H older());\n"; 4088 $code .= " ${implClassName}* collection = ${v8ClassName}::toNative(info.H older());\n";
4089 $code .= " AtomicString propertyName = toWebCoreAtomicString(name);\n"; 4089 $code .= " AtomicString propertyName = toCoreAtomicString(name);\n";
4090 my $extraArguments = ""; 4090 my $extraArguments = "";
4091 if ($raisesExceptions) { 4091 if ($raisesExceptions) {
4092 $code .= " ExceptionState exceptionState(info.Holder(), info.GetIsola te());\n"; 4092 $code .= " ExceptionState exceptionState(info.Holder(), info.GetIsola te());\n";
4093 $extraArguments = ", exceptionState"; 4093 $extraArguments = ", exceptionState";
4094 } 4094 }
4095 $code .= " bool result = collection->${methodName}(propertyName$extraArgu ments);\n"; 4095 $code .= " bool result = collection->${methodName}(propertyName$extraArgu ments);\n";
4096 if ($raisesExceptions) { 4096 if ($raisesExceptions) {
4097 $code .= " if (exceptionState.throwIfNeeded())\n"; 4097 $code .= " if (exceptionState.throwIfNeeded())\n";
4098 $code .= " return;\n"; 4098 $code .= " return;\n";
4099 } 4099 }
(...skipping 29 matching lines...) Expand all
4129 sub GenerateImplementationNamedPropertyQuery 4129 sub GenerateImplementationNamedPropertyQuery
4130 { 4130 {
4131 my $interface = shift; 4131 my $interface = shift;
4132 my $implClassName = GetImplName($interface); 4132 my $implClassName = GetImplName($interface);
4133 my $v8ClassName = GetV8ClassName($interface); 4133 my $v8ClassName = GetV8ClassName($interface);
4134 4134
4135 $implementation{nameSpaceInternal}->add(<<END); 4135 $implementation{nameSpaceInternal}->add(<<END);
4136 static void namedPropertyQuery(v8::Local<v8::String> name, const v8::PropertyCal lbackInfo<v8::Integer>& info) 4136 static void namedPropertyQuery(v8::Local<v8::String> name, const v8::PropertyCal lbackInfo<v8::Integer>& info)
4137 { 4137 {
4138 ${implClassName}* collection = ${v8ClassName}::toNative(info.Holder()); 4138 ${implClassName}* collection = ${v8ClassName}::toNative(info.Holder());
4139 AtomicString propertyName = toWebCoreAtomicString(name); 4139 AtomicString propertyName = toCoreAtomicString(name);
4140 ExceptionState exceptionState(info.Holder(), info.GetIsolate()); 4140 ExceptionState exceptionState(info.Holder(), info.GetIsolate());
4141 bool result = collection->namedPropertyQuery(propertyName, exceptionState); 4141 bool result = collection->namedPropertyQuery(propertyName, exceptionState);
4142 if (exceptionState.throwIfNeeded()) 4142 if (exceptionState.throwIfNeeded())
4143 return; 4143 return;
4144 if (!result) 4144 if (!result)
4145 return; 4145 return;
4146 v8SetReturnValueInt(info, v8::None); 4146 v8SetReturnValueInt(info, v8::None);
4147 } 4147 }
4148 4148
4149 END 4149 END
(...skipping 2201 matching lines...) Expand 10 before | Expand all | Expand 10 after
6351 6351
6352 return 1 if ExtendedAttributeContains($interface->extendedAttributes->{"Cust om"}, "ToV8"); 6352 return 1 if ExtendedAttributeContains($interface->extendedAttributes->{"Cust om"}, "ToV8");
6353 return 1 if ExtendedAttributeContains($interface->extendedAttributes->{"Cust om"}, "Wrap"); 6353 return 1 if ExtendedAttributeContains($interface->extendedAttributes->{"Cust om"}, "Wrap");
6354 return 1 if $interface->extendedAttributes->{"SpecialWrapFor"}; 6354 return 1 if $interface->extendedAttributes->{"SpecialWrapFor"};
6355 return 1 if InheritsInterface($interface, "Document"); 6355 return 1 if InheritsInterface($interface, "Document");
6356 6356
6357 return 0; 6357 return 0;
6358 } 6358 }
6359 6359
6360 1; 6360 1;
OLDNEW
« no previous file with comments | « no previous file | Source/bindings/tests/results/V8TestEventTarget.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698