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

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

Issue 14456006: Fixes to make scripts generate includes with paths. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Updated 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
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 # Copyright (C) 2011 Google, Inc. All rights reserved. 7 # Copyright (C) 2011 Google, Inc. All rights reserved.
8 # 8 #
9 # Redistribution and use in source and binary forms, with or without 9 # Redistribution and use in source and binary forms, with or without
10 # modification, are permitted provided that the following conditions 10 # modification, are permitted provided that the following conditions
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 # Currently, only Events have factory files. 76 # Currently, only Events have factory files.
77 return if $namespace ne "Event"; 77 return if $namespace ne "Event";
78 78
79 my $outputFile = "$outputDir/${namespace}Factory.cpp"; 79 my $outputFile = "$outputDir/${namespace}Factory.cpp";
80 80
81 open F, ">$outputFile" or die "Failed to open file: $!"; 81 open F, ">$outputFile" or die "Failed to open file: $!";
82 82
83 print F $InCompiler->license(); 83 print F $InCompiler->license();
84 84
85 print F "#include \"config.h\"\n"; 85 print F "#include \"config.h\"\n";
86 print F "#include \"${namespace}Factory.h\"\n"; 86 print F "#include \"core/dom/${namespace}Factory.h\"\n";
87 print F "\n"; 87 print F "\n";
88 print F "#include \"${namespace}Headers.h\"\n"; 88 print F "#include \"${namespace}Headers.h\"\n";
89 print F "#include \"RuntimeEnabledFeatures.h\"\n"; 89 print F "#include \"core/page/RuntimeEnabledFeatures.h\"\n";
90 print F "\n"; 90 print F "\n";
91 print F "namespace WebCore {\n"; 91 print F "namespace WebCore {\n";
92 print F "\n"; 92 print F "\n";
93 print F "PassRefPtr<$namespace> ${namespace}Factory::create(const String& ty pe)\n"; 93 print F "PassRefPtr<$namespace> ${namespace}Factory::create(const String& ty pe)\n";
94 print F "{\n"; 94 print F "{\n";
95 95
96 for my $eventName (sort keys %parsedEvents) { 96 for my $eventName (sort keys %parsedEvents) {
97 my $conditional = $parsedEvents{$eventName}{"conditional"}; 97 my $conditional = $parsedEvents{$eventName}{"conditional"};
98 my $runtimeConditional = $parsedEvents{$eventName}{"runtimeConditional"} ; 98 my $runtimeConditional = $parsedEvents{$eventName}{"runtimeConditional"} ;
99 my $interfaceName = $InCompiler->interfaceForItem($eventName); 99 my $interfaceName = $InCompiler->interfaceForItem($eventName);
100 100
101 print F "#if ENABLE($conditional)\n" if $conditional; 101 print F "#if ENABLE($conditional)\n" if $conditional;
102 if ($runtimeConditional) { 102 if ($runtimeConditional) {
103 print F " if (type == \"$eventName\" && RuntimeEnabledFeatures::$ runtimeConditional())\n"; 103 print F " if (type == \"$eventName\" && RuntimeEnabledFeatures::$ runtimeConditional())\n";
104 } else { 104 } else {
105 print F " if (type == \"$eventName\")\n"; 105 print F " if (type == \"$eventName\")\n";
106 } 106 }
107 print F " return ${interfaceName}::create();\n"; 107 print F " return ${interfaceName}::create();\n";
108 print F "#endif\n" if $conditional; 108 print F "#endif\n" if $conditional;
109 } 109 }
110 110
111 print F " return 0;\n"; 111 print F " return 0;\n";
112 print F "}\n"; 112 print F "}\n";
113 print F "\n"; 113 print F "\n";
114 print F "} // namespace WebCore\n"; 114 print F "} // namespace WebCore\n";
115 115
116 close F; 116 close F;
117 } 117 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698