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

Unified Diff: Source/bindings/scripts/CodeGenerator.pm

Issue 14179013: Add support for [NoInterfaceObject] extended attribute to bindings generator (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Applied Kentaro's comments 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 side-by-side diff with in-line comments
Download patch
Index: Source/bindings/scripts/CodeGenerator.pm
diff --git a/Source/bindings/scripts/CodeGenerator.pm b/Source/bindings/scripts/CodeGenerator.pm
index 094b08125197c7c94570ffda2154e34257a27c83..d6ab7244c68c3f9e8a4f83094acf66d88636627b 100644
--- a/Source/bindings/scripts/CodeGenerator.pm
+++ b/Source/bindings/scripts/CodeGenerator.pm
@@ -242,10 +242,8 @@ sub FindSuperMethod
return $indexer;
}
-sub IDLFileForInterface
-{
+sub PopulateIDLFiles {
my $object = shift;
- my $interfaceName = shift;
unless ($idlFiles) {
my $sourceRoot = $ENV{SOURCE_ROOT};
@@ -255,11 +253,37 @@ sub IDLFileForInterface
$idlFiles = { };
my $wanted = sub {
- $idlFiles->{$1} = $File::Find::name if /^([A-Z].*)\.idl$/;
+ $idlFiles->{$1} = $File::Find::name if /^(?!Test)([A-Z].*)\.idl$/;
$File::Find::prune = 1 if /^\../;
};
find($wanted, @directories);
}
+}
+
+sub GetAllInterfaces
+{
+ my $object = shift;
+
+ $object->PopulateIDLFiles();
+
+ foreach my $filename (values $idlFiles) {
+ my $parser = IDLParser->new(1);
+ my $document = $parser->Parse($filename, $defines, $preprocessor);
+
+ foreach my $interface (@{$document->interfaces}) {
+ $cachedInterfaces->{$interface->name} = $interface;
+ }
+ }
+
+ return (values $cachedInterfaces);
+}
+
+sub IDLFileForInterface
+{
+ my $object = shift;
+ my $interfaceName = shift;
+
+ $object->PopulateIDLFiles();
return $idlFiles->{$interfaceName};
}

Powered by Google App Engine
This is Rietveld 408576698