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

Side by Side Diff: Source/core/scripts/make_names.pl

Issue 21437003: Remove the pointer from StringImpl (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Now with placement new Created 7 years, 4 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/scripts/StaticString.pm ('k') | Source/wtf/text/StringImpl.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 #!/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 603 matching lines...) Expand 10 before | Expand all | Expand 10 after
614 my $F; 614 my $F;
615 open F, ">$cppPath"; 615 open F, ">$cppPath";
616 616
617 printLicenseHeader($F); 617 printLicenseHeader($F);
618 printCppHead($F, "DOM", $parameters{namespace}, "WebCore"); 618 printCppHead($F, "DOM", $parameters{namespace}, "WebCore");
619 619
620 my $lowerNamespace = lc($parameters{namespacePrefix}); 620 my $lowerNamespace = lc($parameters{namespacePrefix});
621 621
622 print F "DEFINE_GLOBAL(AtomicString, ${lowerNamespace}NamespaceURI)\n\n"; 622 print F "DEFINE_GLOBAL(AtomicString, ${lowerNamespace}NamespaceURI)\n\n";
623 623
624 print F StaticString::GenerateStrings(\%allStrings); 624 print F StaticString::GenerateStringDecls(\%allStrings);
625 625
626 if (keys %allTags) { 626 if (keys %allTags) {
627 print F "// Tags\n"; 627 print F "// Tags\n";
628 for my $name (sort keys %allTags) { 628 for my $name (sort keys %allTags) {
629 print F "DEFINE_GLOBAL(QualifiedName, ", $name, "Tag)\n"; 629 print F "DEFINE_GLOBAL(QualifiedName, ", $name, "Tag)\n";
630 } 630 }
631 631
632 print F "\n\nWebCore::QualifiedName** get$parameters{namespace}Tags()\n" ; 632 print F "\n\nWebCore::QualifiedName** get$parameters{namespace}Tags()\n" ;
633 print F "{\n static WebCore::QualifiedName* $parameters{namespace}Tag s[] = {\n"; 633 print F "{\n static WebCore::QualifiedName* $parameters{namespace}Tag s[] = {\n";
634 for my $name (sort keys %allTags) { 634 for my $name (sort keys %allTags) {
(...skipping 19 matching lines...) Expand all
654 print F "}\n"; 654 print F "}\n";
655 } 655 }
656 656
657 printInit($F, 0); 657 printInit($F, 0);
658 658
659 print(F " AtomicString ${lowerNamespace}NS(\"$parameters{namespaceURI}\", AtomicString::ConstructFromLiteral);\n\n"); 659 print(F " AtomicString ${lowerNamespace}NS(\"$parameters{namespaceURI}\", AtomicString::ConstructFromLiteral);\n\n");
660 660
661 print(F " // Namespace\n"); 661 print(F " // Namespace\n");
662 print(F " new ((void*)&${lowerNamespace}NamespaceURI) AtomicString(${lowe rNamespace}NS);\n"); 662 print(F " new ((void*)&${lowerNamespace}NamespaceURI) AtomicString(${lowe rNamespace}NS);\n");
663 print(F "\n"); 663 print(F "\n");
664 print F StaticString::GenerateStringAsserts(\%allStrings); 664 print F StaticString::GenerateStringImpls(\%allStrings);
665 665
666 if (keys %allTags) { 666 if (keys %allTags) {
667 my $tagsNamespace = $parameters{tagsNullNamespace} ? "nullAtom" : "${low erNamespace}NS"; 667 my $tagsNamespace = $parameters{tagsNullNamespace} ? "nullAtom" : "${low erNamespace}NS";
668 printDefinitions($F, \%allTags, "tags", $tagsNamespace); 668 printDefinitions($F, \%allTags, "tags", $tagsNamespace);
669 } 669 }
670 if (keys %allAttrs) { 670 if (keys %allAttrs) {
671 my $attrsNamespace = $parameters{attrsNullNamespace} ? "nullAtom" : "${l owerNamespace}NS"; 671 my $attrsNamespace = $parameters{attrsNullNamespace} ? "nullAtom" : "${l owerNamespace}NS";
672 printDefinitions($F, \%allAttrs, "attributes", $attrsNamespace); 672 printDefinitions($F, \%allAttrs, "attributes", $attrsNamespace);
673 } 673 }
674 674
(...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after
1258 1258
1259 printInit($F, 1); 1259 printInit($F, 1);
1260 close F; 1260 close F;
1261 1261
1262 my $source = File::Spec->catfile($outputDir, "${baseName}Names.cpp"); 1262 my $source = File::Spec->catfile($outputDir, "${baseName}Names.cpp");
1263 open F, ">$source" or die "Unable to open $source for writing."; 1263 open F, ">$source" or die "Unable to open $source for writing.";
1264 1264
1265 printLicenseHeader($F); 1265 printLicenseHeader($F);
1266 printCppHead($F, $basePrefix, $baseName, "WTF"); 1266 printCppHead($F, $basePrefix, $baseName, "WTF");
1267 1267
1268 print F StaticString::GenerateStrings(\%parameters); 1268 print F StaticString::GenerateStringDecls(\%parameters);
1269 1269
1270 while ( my ($name, $identifier) = each %parameters ) { 1270 while ( my ($name, $identifier) = each %parameters ) {
1271 print F "DEFINE_GLOBAL(AtomicString, $name)\n"; 1271 print F "DEFINE_GLOBAL(AtomicString, $name)\n";
1272 } 1272 }
1273 1273
1274 printInit($F, 0); 1274 printInit($F, 0);
1275 1275
1276 print F "\n"; 1276 print F "\n";
1277 print F StaticString::GenerateStringAsserts(\%parameters); 1277 print F StaticString::GenerateStringImpls(\%parameters);
1278 1278
1279 while ( my ($name, $identifier) = each %parameters ) { 1279 while ( my ($name, $identifier) = each %parameters ) {
1280 print F " new ((void*)&$name) AtomicString(${name}Impl);\n"; 1280 print F " new ((void*)&$name) AtomicString(${name}Impl);\n";
1281 } 1281 }
1282 1282
1283 print F "}\n}\n}\n"; 1283 print F "}\n}\n}\n";
1284 close F; 1284 close F;
1285 exit 0; 1285 exit 0;
1286 } 1286 }
1287
OLDNEW
« no previous file with comments | « Source/core/scripts/StaticString.pm ('k') | Source/wtf/text/StringImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698