summaryrefslogtreecommitdiff
path: root/deps/v8/third_party/inspector_protocol/templates/TypeBuilder_h.template
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/third_party/inspector_protocol/templates/TypeBuilder_h.template')
-rw-r--r--deps/v8/third_party/inspector_protocol/templates/TypeBuilder_h.template13
1 files changed, 7 insertions, 6 deletions
diff --git a/deps/v8/third_party/inspector_protocol/templates/TypeBuilder_h.template b/deps/v8/third_party/inspector_protocol/templates/TypeBuilder_h.template
index 81dd7f20e5..11d529bce9 100644
--- a/deps/v8/third_party/inspector_protocol/templates/TypeBuilder_h.template
+++ b/deps/v8/third_party/inspector_protocol/templates/TypeBuilder_h.template
@@ -14,7 +14,9 @@
// For each imported domain we generate a ValueConversions struct instead of a full domain definition
// and include Domain::API version from there.
{% for name in domain.dependencies %}
+ {% if protocol.is_imported_dependency(name) %}
#include {{format_include(config.protocol.package, name)}}
+ {% endif %}
{% endfor %}
{% if protocol.is_exported_domain(domain.domain) %}
#include {{format_include(config.exported.package, domain.domain)}}
@@ -27,6 +29,7 @@ namespace {{domain.domain}} {
// ------------- Forward and enum declarations.
{% for type in domain.types %}
+ {% if not protocol.generate_type(domain.domain, type.id) %}{% continue %}{% endif %}
{% if type.type == "object" %}
{% if "properties" in type %}
// {{type.description}}
@@ -41,6 +44,7 @@ using {{type.id}} = {{protocol.resolve_type(type).type}};
{% endif %}
{% endfor %}
{% for type in domain.types %}
+ {% if not protocol.generate_type(domain.domain, type.id) %}{% continue %}{% endif %}
{% if "enum" in type %}
namespace {{type.id}}Enum {
@@ -67,6 +71,7 @@ namespace {{param.name | to_title_case}}Enum {
// ------------- Type and builder declarations.
{% for type in domain.types %}
+ {% if not protocol.generate_type(domain.domain, type.id) %}{% continue %}{% endif %}
{% if not (type.type == "object") or not ("properties" in type) %}{% continue %}{% endif %}
// {{type.description}}
@@ -110,12 +115,8 @@ public:
public:
enum {
NoFieldsSet = 0,
- {% set count = 0 %}
- {% for property in type.properties %}
- {% if not(property.optional) %}
- {% set count = count + 1 %}
- {{property.name | to_title_case}}Set = 1 << {{count}},
- {% endif %}
+ {% for property in type.properties|rejectattr("optional") %}
+ {{property.name | to_title_case}}Set = 1 << {{loop.index}},
{% endfor %}
AllFieldsSet = (
{%- for property in type.properties %}