Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1787)

Unified Diff: core/scripts/make_event_factory.py

Issue 9889044: IDL roll to multivm 1266 (Closed) Base URL: https://dart.googlecode.com/svn/third_party/WebCore
Patch Set: Created 10 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: core/scripts/make_event_factory.py
diff --git a/core/scripts/make_event_factory.py b/core/scripts/make_event_factory.py
index c5a5f0b1e089c85a3274d9afe5d7e69612891dba..5a6653c8644649cab822b879fc3fb7a52fc50e35 100644
--- a/core/scripts/make_event_factory.py
+++ b/core/scripts/make_event_factory.py
@@ -32,20 +32,20 @@ import sys
import shutil
from in_file import InFile
-import in_generator
+import name_macros
import license
IMPLEMENTATION_TEMPLATE = """%(license)s
#include "config.h"
-#include "%(namespace)sFactory.h"
+#include "%(class_name)sFactory.h"
-#include "%(namespace)sHeaders.h"
+#include "%(class_name)sHeaders.h"
#include "RuntimeEnabledFeatures.h"
namespace WebCore {
-PassRefPtr<%(namespace)s> %(namespace)sFactory::create(const String& type)
+PassRefPtr<%(class_name)s> %(class_name)sFactory::create(const String& type)
{
%(factory_implementation)s
return 0;
@@ -55,7 +55,7 @@ PassRefPtr<%(namespace)s> %(namespace)sFactory::create(const String& type)
"""
-class EventFactoryWriter(in_generator.Writer):
+class EventFactoryWriter(name_macros.Writer):
defaults = {
'interfaceName' : None,
'conditional' : None,
@@ -64,10 +64,6 @@ class EventFactoryWriter(in_generator.Writer):
default_parameters = {
'namespace': '',
}
- class_name = 'EventFactory'
-
- def _namespace(self):
- return self.in_file.parameters['namespace']
def _events(self):
return self.in_file.name_dictionaries
@@ -86,16 +82,13 @@ class EventFactoryWriter(in_generator.Writer):
}
return self.wrap_with_condition(implementation, event['conditional'])
- def generate_header(self):
- pass
-
def generate_implementation(self):
return IMPLEMENTATION_TEMPLATE % {
- 'namespace': self._namespace().strip('"'),
+ 'class_name': self.class_name,
'license': license.license_for_generated_cpp(),
'factory_implementation': "\n".join(map(self._factory_implementation, self._events())),
}
if __name__ == "__main__":
- in_generator.Maker(EventFactoryWriter).main(sys.argv)
+ name_macros.Maker(EventFactoryWriter).main(sys.argv)

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b