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/core/scripts/make_names.pl

Issue 18332025: Split CustomElementRegistry into a registration context and a registry. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Synced to tip. Created 7 years, 5 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 | « Source/core/dom/Element.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/perl -w 1 #!/usr/bin/perl -w
2 2
3 # Copyright (C) 2005, 2006, 2007, 2009 Apple Inc. All rights reserved. 3 # Copyright (C) 2005, 2006, 2007, 2009 Apple Inc. All rights reserved.
4 # Copyright (C) 2009, Julien Chaffraix <jchaffraix@webkit.org> 4 # Copyright (C) 2009, Julien Chaffraix <jchaffraix@webkit.org>
5 # Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmob ile.com/) 5 # Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmob ile.com/)
6 # Copyright (C) 2011 Ericsson AB. All rights reserved. 6 # Copyright (C) 2011 Ericsson AB. All rights reserved.
7 # 7 #
8 # Redistribution and use in source and binary forms, with or without 8 # Redistribution and use in source and binary forms, with or without
9 # modification, are permitted provided that the following conditions 9 # modification, are permitted provided that the following conditions
10 # are met: 10 # are met:
(...skipping 819 matching lines...) Expand 10 before | Expand all | Expand 10 after
830 830
831 printConditionalElementIncludes($F); 831 printConditionalElementIncludes($F);
832 832
833 print F <<END 833 print F <<END
834 834
835 #include "ContextFeatures.h" 835 #include "ContextFeatures.h"
836 #include "Document.h" 836 #include "Document.h"
837 #include "RuntimeEnabledFeatures.h" 837 #include "RuntimeEnabledFeatures.h"
838 #include "Settings.h" 838 #include "Settings.h"
839 839
840 #include "CustomElementRegistry.h" 840 #include "CustomElementRegistrationContext.h"
841 841
842 namespace WebCore { 842 namespace WebCore {
843 843
844 using namespace $parameters{namespace}Names; 844 using namespace $parameters{namespace}Names;
845 845
846 END 846 END
847 ; 847 ;
848 848
849 print F "typedef PassRefPtr<$parameters{namespace}Element> (*ConstructorFunction )(const QualifiedName&, Document*"; 849 print F "typedef PassRefPtr<$parameters{namespace}Element> (*ConstructorFunction )(const QualifiedName&, Document*";
850 print F ", HTMLFormElement*" if $parameters{namespace} eq "HTML"; 850 print F ", HTMLFormElement*" if $parameters{namespace} eq "HTML";
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
884 884
885 885
886 print F "\nPassRefPtr<$parameters{namespace}Element> $parameters{namespace}Eleme ntFactory::create$parameters{namespace}Element(const QualifiedName& qName, Docum ent* document"; 886 print F "\nPassRefPtr<$parameters{namespace}Element> $parameters{namespace}Eleme ntFactory::create$parameters{namespace}Element(const QualifiedName& qName, Docum ent* document";
887 print F ", HTMLFormElement* formElement" if $parameters{namespace} eq "HTML"; 887 print F ", HTMLFormElement* formElement" if $parameters{namespace} eq "HTML";
888 print F ", bool createdByParser)\n{\n"; 888 print F ", bool createdByParser)\n{\n";
889 889
890 print F <<END 890 print F <<END
891 if (!document) 891 if (!document)
892 return 0; 892 return 0;
893 893
894 if (RuntimeEnabledFeatures::customDOMElementsEnabled() && CustomElementRegis try::isCustomTagName(qName.localName())) { 894 if (CustomElementRegistrationContext::isCustomTagName(qName.localName())) {
895 RefPtr<Element> element = document->ensureCustomElementRegistry()->creat eCustomTagElement(document, qName); 895 RefPtr<Element> element = document->registrationContext()->createCustomT agElement(document, qName);
896 ASSERT_WITH_SECURITY_IMPLICATION(element->is$parameters{namespace}Elemen t()); 896 ASSERT_WITH_SECURITY_IMPLICATION(element->is$parameters{namespace}Elemen t());
897 return static_pointer_cast<$parameters{namespace}Element>(element.releas e()); 897 return static_pointer_cast<$parameters{namespace}Element>(element.releas e());
898 } 898 }
899 899
900 if (!gFunctionMap) 900 if (!gFunctionMap)
901 createFunctionMap(); 901 createFunctionMap();
902 if (ConstructorFunction function = gFunctionMap->get(qName.localName().impl( ))) { 902 if (ConstructorFunction function = gFunctionMap->get(qName.localName().impl( ))) {
903 END 903 END
904 ; 904 ;
905 905
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
1141 if ($conditional) { 1141 if ($conditional) {
1142 print F "#endif\n"; 1142 print F "#endif\n";
1143 } 1143 }
1144 } 1144 }
1145 1145
1146 print F <<END 1146 print F <<END
1147 } 1147 }
1148 1148
1149 Create$parameters{namespace}ElementWrapperFunction createWrapperFunction = m ap.get(element->localName().impl()); 1149 Create$parameters{namespace}ElementWrapperFunction createWrapperFunction = m ap.get(element->localName().impl());
1150 if (element->isCustomElement()) 1150 if (element->isCustomElement())
1151 return CustomElementWrapper<$parameters{namespace}Element>::wrap(element , creationContext, isolate, createWrapperFunction); 1151 return CustomElementWrapper<$parameters{namespace}Element, V8$parameters {namespace}Element>::wrap(element, creationContext, isolate, createWrapperFuncti on);
1152 if (createWrapperFunction) 1152 if (createWrapperFunction)
1153 { 1153 {
1154 END 1154 END
1155 ; 1155 ;
1156 if ($parameters{namespace} eq "HTML") { 1156 if ($parameters{namespace} eq "HTML") {
1157 print F <<END 1157 print F <<END
1158 if (createWrapperFunction == createHTMLElementWrapper) 1158 if (createWrapperFunction == createHTMLElementWrapper)
1159 return V8HTMLElement::createWrapper(element, creationContext, isolate ); 1159 return V8HTMLElement::createWrapper(element, creationContext, isolate );
1160 END 1160 END
1161 } 1161 }
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
1253 } 1253 }
1254 } 1254 }
1255 END 1255 END
1256 ; 1256 ;
1257 print F "#endif // $parameters{guardFactoryWith}\n\n" if $parameters{guardFa ctoryWith}; 1257 print F "#endif // $parameters{guardFactoryWith}\n\n" if $parameters{guardFa ctoryWith};
1258 1258
1259 print F "#endif // V8$parameters{namespace}ElementWrapperFactory_h\n"; 1259 print F "#endif // V8$parameters{namespace}ElementWrapperFactory_h\n";
1260 1260
1261 close F; 1261 close F;
1262 } 1262 }
OLDNEW
« no previous file with comments | « Source/core/dom/Element.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698