| OLD | NEW |
| 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 16 matching lines...) Expand all Loading... |
| 27 # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 27 # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
| 28 # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 28 # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
| 29 # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 29 # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 30 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 30 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
| 31 # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 31 # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 32 | 32 |
| 33 use strict; | 33 use strict; |
| 34 | 34 |
| 35 use InFilesCompiler; | 35 use InFilesCompiler; |
| 36 | 36 |
| 37 use FindBin; # locate this script |
| 38 use lib "$FindBin::Bin/../bindings/script"; # use the binding generator directo
ry. |
| 39 use idltopath; |
| 40 |
| 37 my %defaultParameters = ( | 41 my %defaultParameters = ( |
| 38 'namespace' => 0 | 42 'namespace' => 0 |
| 39 ); | 43 ); |
| 40 | 44 |
| 41 sub defaultItemFactory | 45 sub defaultItemFactory |
| 42 { | 46 { |
| 43 return ( | 47 return ( |
| 44 'interfaceName' => 0, | 48 'interfaceName' => 0, |
| 45 'conditional' => 0 | 49 'conditional' => 0 |
| 46 ); | 50 ); |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 | 138 |
| 135 my $outputFile = "$outputDir/ExceptionCodeDescription.cpp"; | 139 my $outputFile = "$outputDir/ExceptionCodeDescription.cpp"; |
| 136 | 140 |
| 137 open F, ">$outputFile" or die "Failed to open file: $!"; | 141 open F, ">$outputFile" or die "Failed to open file: $!"; |
| 138 | 142 |
| 139 print F $InCompiler->license(); | 143 print F $InCompiler->license(); |
| 140 | 144 |
| 141 print F "#include \"config.h\"\n"; | 145 print F "#include \"config.h\"\n"; |
| 142 print F "#include \"ExceptionCodeDescription.h\"\n"; | 146 print F "#include \"ExceptionCodeDescription.h\"\n"; |
| 143 print F "\n"; | 147 print F "\n"; |
| 144 print F "#include \"ExceptionCode.h\"\n"; | 148 print F "#include \"core/dom/ExceptionCode.h\"\n"; |
| 145 | 149 |
| 146 for my $exceptionType (sort keys %parsedItems) { | 150 for my $exceptionType (sort keys %parsedItems) { |
| 147 my $conditional = $parsedItems{$exceptionType}{"conditional"}; | 151 my $conditional = $parsedItems{$exceptionType}{"conditional"}; |
| 148 | 152 |
| 149 print F "#if ENABLE($conditional)\n" if $conditional; | 153 print F "#if ENABLE($conditional)\n" if $conditional; |
| 150 print F "#include \"$exceptionType.h\"\n"; | 154 my $exceptionpath = idl_to_path($exceptionType); |
| 155 print F "#include \"$exceptionpath$exceptionType.h\"\n"; |
| 151 print F "#endif\n" if $conditional; | 156 print F "#endif\n" if $conditional; |
| 152 } | 157 } |
| 153 | 158 |
| 154 print F "#include \"IDBDatabaseException.h\"\n"; | 159 print F "#include \"modules/indexeddb/IDBDatabaseException.h\"\n"; |
| 155 | 160 |
| 156 print F "\n"; | 161 print F "\n"; |
| 157 print F "namespace WebCore {\n"; | 162 print F "namespace WebCore {\n"; |
| 158 print F "\n"; | 163 print F "\n"; |
| 159 print F "ExceptionCodeDescription::ExceptionCodeDescription(ExceptionCode ec
)\n"; | 164 print F "ExceptionCodeDescription::ExceptionCodeDescription(ExceptionCode ec
)\n"; |
| 160 print F "{\n"; | 165 print F "{\n"; |
| 161 print F " ASSERT(ec);\n"; | 166 print F " ASSERT(ec);\n"; |
| 162 | 167 |
| 163 for my $exceptionType (sort keys %parsedItems) { | 168 for my $exceptionType (sort keys %parsedItems) { |
| 164 # DOMCoreException needs to be last because it's a catch-all. | 169 # DOMCoreException needs to be last because it's a catch-all. |
| (...skipping 16 matching lines...) Expand all Loading... |
| 181 | 186 |
| 182 print F " if (DOMCoreException::initializeDescription(ec, this))\n"; | 187 print F " if (DOMCoreException::initializeDescription(ec, this))\n"; |
| 183 print F " return;\n"; | 188 print F " return;\n"; |
| 184 print F " ASSERT_NOT_REACHED();\n"; | 189 print F " ASSERT_NOT_REACHED();\n"; |
| 185 print F "}\n"; | 190 print F "}\n"; |
| 186 print F "\n"; | 191 print F "\n"; |
| 187 print F "} // namespace WebCore\n"; | 192 print F "} // namespace WebCore\n"; |
| 188 | 193 |
| 189 close F; | 194 close F; |
| 190 } | 195 } |
| OLD | NEW |