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

Unified Diff: webkit/port/bindings/scripts/CodeGenerator.pm

Issue 3195: Use static type information from IDL to streamline the wrapping and unwrappin... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 12 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: webkit/port/bindings/scripts/CodeGenerator.pm
===================================================================
--- webkit/port/bindings/scripts/CodeGenerator.pm (revision 2436)
+++ webkit/port/bindings/scripts/CodeGenerator.pm (working copy)
@@ -115,6 +115,39 @@
}
}
+
+sub FindParentsRecursively
+{
+ my $object = shift;
+ my $dataNode = shift;
+ my @parents = ($dataNode->name);
+ foreach (@{$dataNode->parents}) {
+ my $interface = $object->StripModule($_);
+
+ $endCondition = 0;
+ $foundFilename = "";
+ foreach (@{$useDirectories}) {
+ $object->ScanDirectory("$interface.idl", $_, $_, 0) if ($foundFilename eq "");
+ }
+
+ if ($foundFilename ne "") {
+ print " | |> Parsing parent IDL \"$foundFilename\" for interface \"$interface\"\n" if $verbose;
+
+ # Step #2: Parse the found IDL file (in quiet mode).
+ my $parser = IDLParser->new(1);
+ my $document = $parser->ParseInheritance($foundFilename, $defines, $preprocessor);
+
+ foreach my $class (@{$document->classes}) {
+ @parents = (@parents, FindParentsRecursively($object, $class));
+ }
+ } else {
+ die("Could NOT find specified parent interface \"$interface\"!\n")
+ }
+ }
+ return @parents;
+}
+
+
sub AddMethodsConstantsAndAttributesFromParentClasses
{
# For the passed interface, recursively parse all parent
@@ -248,6 +281,8 @@
my $useDirectory = shift;
my $reportAllFiles = shift;
+ print "Scanning interface " . $interface . " in " . $directory . "\n" if $verbose;
Mike Belshe 2008/09/23 00:36:13 Do we want this print statement? Or is this for d
Feng Qian 2008/09/23 21:46:04 For debugging purpose, the condition variable $ver
+
return if ($endCondition eq 1) and ($reportAllFiles eq 0);
my $sourceRoot = $ENV{SOURCE_ROOT};

Powered by Google App Engine
This is Rietveld 408576698