Index: third_party/WebKit/Source/bindings/scripts/code_generator_blink_api.py |
diff --git a/third_party/WebKit/Source/bindings/scripts/code_generator_web_module.py b/third_party/WebKit/Source/bindings/scripts/code_generator_blink_api.py |
similarity index 91% |
rename from third_party/WebKit/Source/bindings/scripts/code_generator_web_module.py |
rename to third_party/WebKit/Source/bindings/scripts/code_generator_blink_api.py |
index 7953d0fc2ad622a50b15d569e46f56c509413ecb..17ba402826838434a4ad8c1530710cdf6ca7d92c 100644 |
--- a/third_party/WebKit/Source/bindings/scripts/code_generator_web_module.py |
+++ b/third_party/WebKit/Source/bindings/scripts/code_generator_blink_api.py |
@@ -4,19 +4,19 @@ |
# pylint: disable=import-error,print-statement,relative-import |
-"""Generates Blink Web Module bindings. |
+"""Generates Blink API bindings. |
-The Blink Web Module bindings provide a stable, IDL-generated interface for the |
-Web Modules. |
+The Blink API bindings provide a stable, IDL-generated interface for the |
+Web Agents. |
-The Web Modules are the high-level services like Autofill, |
-Autocomplete, Translate, Distiller, Phishing Detector, and others. Web Modules |
+The Web Agents are the high-level services like Autofill, |
+Autocomplete, Translate, Distiller, Phishing Detector, and others. Web Agents |
typically want to introspec the document and rendering infromation to implement |
browser features. |
The bindings are meant to be as simple and as ephemeral as possible, mostly just |
wrapping existing DOM classes. Their primary goal is to avoid leaking the actual |
-DOM classes to the Web Modules layer. |
+DOM classes to the Web Agents layer. |
""" |
import os |
@@ -28,9 +28,10 @@ from code_generator_v8 import TypedefResolver |
MODULE_PYNAME = os.path.splitext(os.path.basename(__file__))[0] + '.py' |
-WEB_MODULE_IDL_ATTRIBUTE = 'WebModuleAPI' |
+BLINK_API_IDL_ATTRIBUTE = 'BlinkAPI' |
STRING_INCLUDE_PATH = 'wtf/text/WTFString.h' |
+ |
def interface_context(idl_interface): |
builder = InterfaceContextBuilder(MODULE_PYNAME, TypeResolver()) |
builder.set_class_name(idl_interface.name) |
@@ -130,14 +131,14 @@ class InterfaceContextBuilder(object): |
return self.result |
-class CodeGeneratorWebModule(CodeGeneratorBase): |
+class CodeGeneratorBlinkAPI(CodeGeneratorBase): |
def __init__(self, info_provider, cache_dir, output_dir): |
CodeGeneratorBase.__init__(self, MODULE_PYNAME, info_provider, |
cache_dir, output_dir) |
self.typedef_resolver = TypedefResolver(info_provider) |
def get_template(self, file_extension): |
- template_filename = 'web_module_interface.%s.tmpl' % file_extension |
+ template_filename = 'blink_api_interface.%s.tmpl' % file_extension |
return self.jinja_env.get_template(template_filename) |
# TODO(dglazkov): Move to CodeGeneratorBase. |
@@ -169,15 +170,13 @@ class CodeGeneratorWebModule(CodeGeneratorBase): |
def generate_code(self, definitions, definition_name): |
self.typedef_resolver.resolve(definitions, definition_name) |
- header_path, cpp_path = self.output_paths(definition_name) |
- template_context = {} |
# TODO(dglazkov): Implement dictionaries |
if definition_name not in definitions.interfaces: |
return None |
interface = definitions.interfaces[definition_name] |
- if WEB_MODULE_IDL_ATTRIBUTE not in interface.extended_attributes: |
+ if BLINK_API_IDL_ATTRIBUTE not in interface.extended_attributes: |
return None |
return self.generate_interface_code(interface) |