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

Side by Side Diff: Source/bindings/scripts/generate-bindings.pl

Issue 16296004: JSON export/import in generate-bindings.pl (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Revised again Created 7 years, 6 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
OLDNEW
1 #!/usr/bin/perl -w 1 #!/usr/bin/perl -w
2 # 2 #
3 # Copyright (C) 2005 Apple Computer, Inc. 3 # Copyright (C) 2005 Apple Computer, Inc.
4 # Copyright (C) 2006 Anders Carlsson <andersca@mac.com> 4 # Copyright (C) 2006 Anders Carlsson <andersca@mac.com>
5 # 5 #
6 # This file is part of WebKit 6 # This file is part of WebKit
7 # 7 #
8 # This library is free software; you can redistribute it and/or 8 # This library is free software; you can redistribute it and/or
9 # modify it under the terms of the GNU Library General Public 9 # modify it under the terms of the GNU Library General Public
10 # License as published by the Free Software Foundation; either 10 # License as published by the Free Software Foundation; either
(...skipping 20 matching lines...) Expand all
31 use strict; 31 use strict;
32 32
33 use File::Path; 33 use File::Path;
34 use File::Basename; 34 use File::Basename;
35 use Getopt::Long; 35 use Getopt::Long;
36 use Text::ParseWords; 36 use Text::ParseWords;
37 use Cwd; 37 use Cwd;
38 38
39 use IDLParser; 39 use IDLParser;
40 use CodeGeneratorV8; 40 use CodeGeneratorV8;
41 use JSONSerializer;
41 42
42 my @idlDirectories; 43 my @idlDirectories;
43 my $outputDirectory; 44 my $outputDirectory;
44 my $outputHeadersDirectory; 45 my $outputHeadersDirectory;
45 my $defines; 46 my $defines;
46 my $filename; 47 my $filename;
47 my $preprocessor; 48 my $preprocessor;
48 my $verbose; 49 my $verbose;
49 my $supplementalDependencyFile; 50 my $supplementalDependencyFile;
50 my $additionalIdlFiles; 51 my $additionalIdlFiles;
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 $constant->extendedAttributes->{$extendedAttributeName} = $i nterface->extendedAttributes->{$extendedAttributeName}; 178 $constant->extendedAttributes->{$extendedAttributeName} = $i nterface->extendedAttributes->{$extendedAttributeName};
178 } 179 }
179 push(@{$targetDataNode->constants}, $constant); 180 push(@{$targetDataNode->constants}, $constant);
180 } 181 }
181 } else { 182 } else {
182 die "$idlFile is not a supplemental dependency of $targetIdlFile. Th ere maybe a bug in the the supplemental dependency generator (preprocess_idls.py ).\n"; 183 die "$idlFile is not a supplemental dependency of $targetIdlFile. Th ere maybe a bug in the the supplemental dependency generator (preprocess_idls.py ).\n";
183 } 184 }
184 } 185 }
185 } 186 }
186 187
188 # FIXME: This code will be removed once IDLParser.pm and CodeGeneratorV8.pm
dominicc (has gone to gerrit) 2013/06/12 04:39:33 Good.
189 # are connected via JSON files. See http://crbug.com/242795
190 $targetDocument = deserializeJSON(serializeJSON($targetDocument));
191
187 # Generate desired output for the target IDL file. 192 # Generate desired output for the target IDL file.
dominicc (has gone to gerrit) 2013/06/12 04:39:33 Is it possible to chop this up with functions or m
Nils Barth (inactive) 2013/06/12 09:15:27 Agreed.
188 my @dependentIdlFiles = ($targetDocument->fileName(), @supplementedIdlFiles); 193 my @dependentIdlFiles = ($targetDocument->fileName(), @supplementedIdlFiles);
189 my $codeGenerator = CodeGeneratorV8->new($targetDocument, \@idlDirectories, $pre processor, $defines, $verbose, \@dependentIdlFiles, $writeFileOnlyIfChanged); 194 my $codeGenerator = CodeGeneratorV8->new($targetDocument, \@idlDirectories, $pre processor, $defines, $verbose, \@dependentIdlFiles, $writeFileOnlyIfChanged);
190 my $interfaces = $targetDocument->interfaces; 195 my $interfaces = $targetDocument->interfaces;
191 foreach my $interface (@$interfaces) { 196 foreach my $interface (@$interfaces) {
192 print "Generating bindings code for IDL interface \"" . $interface->name . " \"...\n" if $verbose; 197 print "Generating bindings code for IDL interface \"" . $interface->name . " \"...\n" if $verbose;
193 $codeGenerator->GenerateInterface($interface); 198 $codeGenerator->GenerateInterface($interface);
194 $codeGenerator->WriteData($interface, $outputDirectory, $outputHeadersDirect ory); 199 $codeGenerator->WriteData($interface, $outputDirectory, $outputHeadersDirect ory);
195 } 200 }
196 201
197 sub generateEmptyHeaderAndCpp 202 sub generateEmptyHeaderAndCpp
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 last OUTER; 296 last OUTER;
292 } 297 }
293 } 298 }
294 } 299 }
295 if ($error) { 300 if ($error) {
296 die "IDL ATTRIBUTE CHECKER ERROR: $error 301 die "IDL ATTRIBUTE CHECKER ERROR: $error
297 If you want to add a new IDL attribute, you need to add it to bindings/scripts/I DLAttributes.txt and add explanations to the Blink IDL document (http://chromium .org/blink/webidl). 302 If you want to add a new IDL attribute, you need to add it to bindings/scripts/I DLAttributes.txt and add explanations to the Blink IDL document (http://chromium .org/blink/webidl).
298 "; 303 ";
299 } 304 }
300 } 305 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698