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

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

Issue 13828008: Second part of moving V8 Binding Integrity off of vtables. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix comments. Created 7 years, 8 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
« no previous file with comments | « no previous file | Source/bindings/v8/DOMDataStore.h » ('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 2987 matching lines...) Expand 10 before | Expand all | Expand 10 after
2998 #else 2998 #else
2999 void* expectedVTablePointer = ${vtableRefGnu}; 2999 void* expectedVTablePointer = ${vtableRefGnu};
3000 #endif 3000 #endif
3001 if (actualVTablePointer != expectedVTablePointer) 3001 if (actualVTablePointer != expectedVTablePointer)
3002 CRASH(); 3002 CRASH();
3003 } 3003 }
3004 #endif // ENABLE(BINDING_INTEGRITY) 3004 #endif // ENABLE(BINDING_INTEGRITY)
3005 3005
3006 END 3006 END
3007 3007
3008 my $parentClassInfo = $parentClass ? "&${parentClass}::info" : "0";
3009 my $WrapperTypePrototype = $interface->isException ? "WrapperTypeErrorProtot ype" : "WrapperTypeObjectPrototype";
3008 3010
3009 my $parentClassInfo = $parentClass ? "&${parentClass}::info" : "0"; 3011 if (!$codeGenerator->IsSVGTypeNeedingTearOff($interfaceName)) {
3010 3012 push(@implContentInternals, <<END);
3011 my $WrapperTypePrototype = $interface->isException ? "WrapperTypeErrorProtot ype" : "WrapperTypeObjectPrototype"; 3013 #if defined(OS_WIN)
3014 // In ScriptWrappable, the use of extern function prototypes inside templated st atic methods has an issue on windows.
3015 // These prototypes do not pick up the surrounding namespace, so drop out of Web Core as a workaround.
3016 } // namespace WebCore
3017 using WebCore::ScriptWrappable;
3018 using WebCore::${v8InterfaceName};
3019 END
3020 push(@implContentInternals, <<END) if (GetNamespaceForInterface($interfac e) eq "WebCore");
3021 using WebCore::${interfaceName};
3022 END
3023 push(@implContentInternals, <<END);
3024 #endif
3025 void initializeScriptWrappableForInterface(${interfaceName}* object)
3026 {
3027 if (ScriptWrappable::wrapperCanBeStoredInObject(object))
3028 ScriptWrappable::setTypeInfoInObject(object, &${v8InterfaceName}::info);
3029 }
3030 #if defined(OS_WIN)
3031 namespace WebCore {
3032 #endif
3033 END
3034 }
3012 3035
3013 my $code = "WrapperTypeInfo ${v8InterfaceName}::info = { ${v8InterfaceName}: :GetTemplate, ${v8InterfaceName}::derefObject, $toActiveDOMObject, $toEventTarge t, "; 3036 my $code = "WrapperTypeInfo ${v8InterfaceName}::info = { ${v8InterfaceName}: :GetTemplate, ${v8InterfaceName}::derefObject, $toActiveDOMObject, $toEventTarge t, ";
3014 $code .= "$rootForGC, ${v8InterfaceName}::installPerContextPrototypeProperti es, $parentClassInfo, $WrapperTypePrototype };\n\n"; 3037 $code .= "$rootForGC, ${v8InterfaceName}::installPerContextPrototypeProperti es, $parentClassInfo, $WrapperTypePrototype };\n\n";
3015 AddToImplContentInternals($code); 3038 AddToImplContentInternals($code);
3039
3016 AddToImplContentInternals("namespace ${interfaceName}V8Internal {\n\n"); 3040 AddToImplContentInternals("namespace ${interfaceName}V8Internal {\n\n");
3017
3018 AddToImplContentInternals("template <typename T> void V8_USE(T) { }\n\n"); 3041 AddToImplContentInternals("template <typename T> void V8_USE(T) { }\n\n");
3019 3042
3020 my $hasConstructors = 0; 3043 my $hasConstructors = 0;
3021 my $hasReplaceable = 0; 3044 my $hasReplaceable = 0;
3022 3045
3023 # Generate property accessors for attributes. 3046 # Generate property accessors for attributes.
3024 for (my $index = 0; $index < @{$interface->attributes}; $index++) { 3047 for (my $index = 0; $index < @{$interface->attributes}; $index++) {
3025 my $attribute = @{$interface->attributes}[$index]; 3048 my $attribute = @{$interface->attributes}[$index];
3026 my $attrType = $attribute->signature->type; 3049 my $attrType = $attribute->signature->type;
3027 my $attrExt = $attribute->signature->extendedAttributes; 3050 my $attrExt = $attribute->signature->extendedAttributes;
(...skipping 1732 matching lines...) Expand 10 before | Expand all | Expand 10 after
4760 4783
4761 sub GetPassRefPtrType 4784 sub GetPassRefPtrType
4762 { 4785 {
4763 my $v8InterfaceName = shift; 4786 my $v8InterfaceName = shift;
4764 4787
4765 my $angleBracketSpace = $v8InterfaceName =~ />$/ ? " " : ""; 4788 my $angleBracketSpace = $v8InterfaceName =~ />$/ ? " " : "";
4766 return "PassRefPtr<${v8InterfaceName}${angleBracketSpace}>"; 4789 return "PassRefPtr<${v8InterfaceName}${angleBracketSpace}>";
4767 } 4790 }
4768 4791
4769 1; 4792 1;
OLDNEW
« no previous file with comments | « no previous file | Source/bindings/v8/DOMDataStore.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698