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

Unified Diff: Source/bindings/scripts/compute_interfaces_info_individual.py

Issue 386963003: [WIP][NotForLand] IDL dictionary support (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: sequence and array support Created 6 years, 5 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/compute_interfaces_info_individual.py
diff --git a/Source/bindings/scripts/compute_interfaces_info_individual.py b/Source/bindings/scripts/compute_interfaces_info_individual.py
index c3671d9ebdf8ff735dd54aab530404b00382de01..3bd0d7f075a0fcd1ef5788ee6e50451ca9aeed91 100755
--- a/Source/bindings/scripts/compute_interfaces_info_individual.py
+++ b/Source/bindings/scripts/compute_interfaces_info_individual.py
@@ -47,7 +47,7 @@ import os
import posixpath
import sys
-from utilities import get_file_contents, read_file_to_list, idl_filename_to_interface_name, write_pickle_file, get_interface_extended_attributes_from_idl, is_callback_interface_from_idl, get_partial_interface_name_from_idl, get_implements_from_idl, get_parent_interface, get_put_forward_interfaces_from_idl
+from utilities import get_file_contents, read_file_to_list, idl_filename_to_interface_name, write_pickle_file, get_interface_extended_attributes_from_idl, is_callback_interface_from_idl, is_dictionary_from_idl, get_partial_interface_name_from_idl, get_implements_from_idl, get_parent_interface, get_put_forward_interfaces_from_idl
module_path = os.path.dirname(__file__)
source_path = os.path.normpath(os.path.join(module_path, os.pardir, os.pardir))
@@ -85,21 +85,25 @@ def parse_options():
# Computations
################################################################################
+def relative_dir_posix(idl_filename):
+ """Returns relative path to the directory of idl_file in POSIX format."""
+ relative_path_local = os.path.relpath(idl_filename, source_path)
+ relative_dir_local = os.path.dirname(relative_path_local)
+ return relative_dir_local.replace(os.path.sep, posixpath.sep)
+
+
def include_path(idl_filename, implemented_as=None):
"""Returns relative path to header file in POSIX format; used in includes.
POSIX format is used for consistency of output, so reference tests are
platform-independent.
"""
- relative_path_local = os.path.relpath(idl_filename, source_path)
- relative_dir_local = os.path.dirname(relative_path_local)
- relative_dir_posix = relative_dir_local.replace(os.path.sep, posixpath.sep)
-
+ relative_dir = relative_dir_posix(idl_filename)
# IDL file basename is used even if only a partial interface file
idl_file_basename, _ = os.path.splitext(os.path.basename(idl_filename))
cpp_class_name = implemented_as or idl_file_basename
- return posixpath.join(relative_dir_posix, cpp_class_name + '.h')
+ return posixpath.join(relative_dir, cpp_class_name + '.h')
def add_paths_to_partials_dict(partial_interface_name, full_path, this_include_path=None):
@@ -116,6 +120,7 @@ def compute_info_individual(idl_filename, component_dir):
extended_attributes = get_interface_extended_attributes_from_idl(idl_file_contents)
implemented_as = extended_attributes.get('ImplementedAs')
this_include_path = include_path(idl_filename, implemented_as)
+ relative_dir = relative_dir_posix(idl_filename)
# Handle partial interfaces
partial_interface_name = get_partial_interface_name_from_idl(idl_file_contents)
@@ -140,10 +145,11 @@ def compute_info_individual(idl_filename, component_dir):
'implemented_by_interfaces': left_interfaces, # private, merged to next
'implements_interfaces': right_interfaces,
'include_path': this_include_path,
+ 'is_callback_interface': is_callback_interface_from_idl(idl_file_contents),
+ 'is_dictionary': is_dictionary_from_idl(idl_file_contents),
# FIXME: temporary private field, while removing old treatement of
# 'implements': http://crbug.com/360435
'is_legacy_treat_as_partial_interface': 'LegacyTreatAsPartialInterface' in extended_attributes,
- 'is_callback_interface': is_callback_interface_from_idl(idl_file_contents),
'parent': get_parent_interface(idl_file_contents),
# Interfaces that are referenced (used as types) and that we introspect
# during code generation (beyond interface-level data ([ImplementedAs],
@@ -152,6 +158,7 @@ def compute_info_individual(idl_filename, component_dir):
# These cause rebuilds of referrers, due to the dependency, so these
# should be minimized; currently only targets of [PutForwards].
'referenced_interfaces': get_put_forward_interfaces_from_idl(idl_file_contents),
+ 'relative_dir': relative_dir,
}
« no previous file with comments | « Source/bindings/scripts/code_generator_v8.py ('k') | Source/bindings/scripts/generate_global_constructors.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698