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

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

Issue 32323012: IDL compiler: move EventHandler null check out of generated bindings (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased Created 7 years, 2 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 1937 matching lines...) Expand 10 before | Expand all | Expand 10 after
1948 my $useExceptions = 1 if $attribute->extendedAttributes->{"SetterRaisesExcep tion"} || $attribute->extendedAttributes->{"RaisesException"}; 1948 my $useExceptions = 1 if $attribute->extendedAttributes->{"SetterRaisesExcep tion"} || $attribute->extendedAttributes->{"RaisesException"};
1949 1949
1950 if ($useExceptions) { 1950 if ($useExceptions) {
1951 AddToImplIncludes("bindings/v8/ExceptionMessages.h"); 1951 AddToImplIncludes("bindings/v8/ExceptionMessages.h");
1952 AddToImplIncludes("bindings/v8/ExceptionState.h"); 1952 AddToImplIncludes("bindings/v8/ExceptionState.h");
1953 $code .= " ExceptionState es(info.GetIsolate());\n"; 1953 $code .= " ExceptionState es(info.GetIsolate());\n";
1954 } 1954 }
1955 1955
1956 if ($attribute->type eq "EventHandler") { 1956 if ($attribute->type eq "EventHandler") {
1957 my $implSetterFunctionName = FirstLetterToUpperCase($attrName); 1957 my $implSetterFunctionName = FirstLetterToUpperCase($attrName);
1958 # Non callable input should be treated as null
1959 $code .= " if (!jsValue->IsNull() && !jsValue->IsFunction())\n";
1960 $code .= " jsValue = v8::Null(info.GetIsolate());\n";
1961 if (!InheritsInterface($interface, "Node")) { 1958 if (!InheritsInterface($interface, "Node")) {
1962 my $attrImplName = GetImplName($attribute); 1959 my $attrImplName = GetImplName($attribute);
1963 $code .= " transferHiddenDependency(info.Holder(), imp->${attrImp lName}(isolatedWorldForIsolate(info.GetIsolate())), jsValue, ${v8ClassName}::eve ntListenerCacheIndex, info.GetIsolate());\n"; 1960 $code .= " transferHiddenDependency(info.Holder(), imp->${attrImp lName}(isolatedWorldForIsolate(info.GetIsolate())), jsValue, ${v8ClassName}::eve ntListenerCacheIndex, info.GetIsolate());\n";
1964 } 1961 }
1965 if (($interfaceName eq "Window" or $interfaceName eq "WorkerGlobalScope" ) and $attribute->name eq "onerror") { 1962 if (($interfaceName eq "Window" or $interfaceName eq "WorkerGlobalScope" ) and $attribute->name eq "onerror") {
1966 AddToImplIncludes("bindings/v8/V8ErrorHandler.h"); 1963 AddToImplIncludes("bindings/v8/V8ErrorHandler.h");
1967 $code .= " imp->set$implSetterFunctionName(V8EventListenerList::f indOrCreateWrapper<V8ErrorHandler>(jsValue, true, info.GetIsolate()), isolatedWo rldForIsolate(info.GetIsolate()));\n"; 1964 $code .= " imp->set$implSetterFunctionName(V8EventListenerList::f indOrCreateWrapper<V8ErrorHandler>(jsValue, true, info.GetIsolate()), isolatedWo rldForIsolate(info.GetIsolate()));\n";
1968 } else { 1965 } else {
1969 $code .= " imp->set$implSetterFunctionName(V8EventListenerList::g etEventListener(jsValue, true, ListenerFindOrCreate), isolatedWorldForIsolate(in fo.GetIsolate()));\n"; 1966 $code .= " imp->set$implSetterFunctionName(V8EventListenerList::g etEventListener(jsValue, true, ListenerFindOrCreate), isolatedWorldForIsolate(in fo.GetIsolate()));\n";
1970 } 1967 }
(...skipping 4226 matching lines...) Expand 10 before | Expand all | Expand 10 after
6197 my $interface = shift; 6194 my $interface = shift;
6198 6195
6199 return 1 if $interface->extendedAttributes->{"CustomToV8"}; 6196 return 1 if $interface->extendedAttributes->{"CustomToV8"};
6200 return 1 if $interface->extendedAttributes->{"SpecialWrapFor"}; 6197 return 1 if $interface->extendedAttributes->{"SpecialWrapFor"};
6201 return 1 if InheritsInterface($interface, "Document"); 6198 return 1 if InheritsInterface($interface, "Document");
6202 6199
6203 return 0; 6200 return 0;
6204 } 6201 }
6205 6202
6206 1; 6203 1;
OLDNEW
« no previous file with comments | « no previous file | Source/bindings/templates/attributes.cpp » ('j') | Source/bindings/v8/V8EventListenerList.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698