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

Side by Side Diff: Source/WebCore/dom/make_event_factory.pl

Issue 9467023: Merge 106603 - BMW Car Configuration Page doesn't work (Only manifests in Chromium) (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/963/
Patch Set: Created 8 years, 10 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
« no previous file with comments | « Source/WebCore/dom/EventFactory.in ('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 # 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 24 matching lines...) Expand all
35 use InFilesCompiler; 35 use InFilesCompiler;
36 36
37 my %defaultParameters = ( 37 my %defaultParameters = (
38 'namespace' => 0 38 'namespace' => 0
39 ); 39 );
40 40
41 sub defaultItemFactory 41 sub defaultItemFactory
42 { 42 {
43 return ( 43 return (
44 'interfaceName' => 0, 44 'interfaceName' => 0,
45 'conditional' => 0 45 'conditional' => 0,
46 'runtimeConditional' => 0
46 ); 47 );
47 } 48 }
48 49
49 my $InCompiler = InFilesCompiler->new(\%defaultParameters, \&defaultItemFactory) ; 50 my $InCompiler = InFilesCompiler->new(\%defaultParameters, \&defaultItemFactory) ;
50 51
51 my $outputDir = $InCompiler->initializeFromCommandLine(); 52 my $outputDir = $InCompiler->initializeFromCommandLine();
52 $InCompiler->compile(\&generateCode); 53 $InCompiler->compile(\&generateCode);
53 54
54 sub generateCode() 55 sub generateCode()
55 { 56 {
(...skipping 22 matching lines...) Expand all
78 my $outputFile = "$outputDir/${namespace}Factory.cpp"; 79 my $outputFile = "$outputDir/${namespace}Factory.cpp";
79 80
80 open F, ">$outputFile" or die "Failed to open file: $!"; 81 open F, ">$outputFile" or die "Failed to open file: $!";
81 82
82 print F $InCompiler->license(); 83 print F $InCompiler->license();
83 84
84 print F "#include \"config.h\"\n"; 85 print F "#include \"config.h\"\n";
85 print F "#include \"${namespace}Factory.h\"\n"; 86 print F "#include \"${namespace}Factory.h\"\n";
86 print F "\n"; 87 print F "\n";
87 print F "#include \"${namespace}Headers.h\"\n"; 88 print F "#include \"${namespace}Headers.h\"\n";
89 print F "#if USE(V8)\n";
90 print F "#include \"RuntimeEnabledFeatures.h\"\n";
91 print F "#endif\n";
88 print F "\n"; 92 print F "\n";
89 print F "namespace WebCore {\n"; 93 print F "namespace WebCore {\n";
90 print F "\n"; 94 print F "\n";
91 print F "PassRefPtr<$namespace> ${namespace}Factory::create(const String& ty pe)\n"; 95 print F "PassRefPtr<$namespace> ${namespace}Factory::create(const String& ty pe)\n";
92 print F "{\n"; 96 print F "{\n";
93 97
94 for my $eventName (sort keys %parsedEvents) { 98 for my $eventName (sort keys %parsedEvents) {
95 my $conditional = $parsedEvents{$eventName}{"conditional"}; 99 my $conditional = $parsedEvents{$eventName}{"conditional"};
100 my $runtimeConditional = $parsedEvents{$eventName}{"runtimeConditional"} ;
96 my $interfaceName = $InCompiler->interfaceForItem($eventName); 101 my $interfaceName = $InCompiler->interfaceForItem($eventName);
97 102
98 print F "#if ENABLE($conditional)\n" if $conditional; 103 print F "#if ENABLE($conditional)\n" if $conditional;
104 if ($runtimeConditional) {
105 print F " #if USE(V8)\n";
106 print F " // FIXME: JSC should support RuntimeEnabledFeatures as well.\n";
107 print F " if (type == \"$eventName\" && RuntimeEnabledFeatures::$ runtimeConditional())\n";
108 print F " return ${interfaceName}::create();\n";
109 print F " #else\n";
110 }
99 print F " if (type == \"$eventName\")\n"; 111 print F " if (type == \"$eventName\")\n";
100 print F " return ${interfaceName}::create();\n"; 112 print F " return ${interfaceName}::create();\n";
113 print F "#endif // USE(V8)\n" if $runtimeConditional;
101 print F "#endif\n" if $conditional; 114 print F "#endif\n" if $conditional;
102 } 115 }
103 116
104 print F " return 0;\n"; 117 print F " return 0;\n";
105 print F "}\n"; 118 print F "}\n";
106 print F "\n"; 119 print F "\n";
107 print F "} // namespace WebCore\n"; 120 print F "} // namespace WebCore\n";
108 121
109 close F; 122 close F;
110 } 123 }
OLDNEW
« no previous file with comments | « Source/WebCore/dom/EventFactory.in ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698