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

Unified Diff: templates/TypeBuilder_h.template

Issue 2482993002: Support config.protocol.options which defines which part of protocol definition should be generated. (Closed)
Patch Set: Created 4 years, 1 month 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
« no previous file with comments | « templates/TypeBuilder_cpp.template ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: templates/TypeBuilder_h.template
diff --git a/templates/TypeBuilder_h.template b/templates/TypeBuilder_h.template
index f665039dd7da19ea76c68b595b2929ff8f33cbe4..246d455a6477ad078d4ed90bc01d76c8c1b9b069 100644
--- a/templates/TypeBuilder_h.template
+++ b/templates/TypeBuilder_h.template
@@ -189,8 +189,8 @@ public:
{% for command in domain.commands %}
{% if "redirect" in command %}{% continue %}{% endif %}
- {% if ("handlers" in command) and not ("renderer" in command["handlers"]) %}{% continue %}{% endif %}
- {% if "async" in command %}
+ {% if not generate_command(domain.domain, command.name) %}{% continue %}{% endif %}
+ {% if is_async_command(domain.domain, command.name) %}
class {{config.protocol.export_macro}} {{command.name | to_title_case}}Callback {
public:
virtual void sendSuccess(
@@ -207,7 +207,7 @@ public:
virtual ~{{command.name | to_title_case}}Callback() { }
};
{% endif %}
- {%- if not("async" in command) %}
+ {%- if not is_async_command(domain.domain, command.name) %}
virtual DispatchResponse {{command.name}}(
{%- else %}
virtual void {{command.name}}(
@@ -220,7 +220,7 @@ public:
{{resolve_type(parameter).pass_type}} in_{{parameter.name}}
{%- endif -%}
{%- endfor -%}
- {%- if "async" in command -%}
+ {%- if is_async_command(domain.domain, command.name) -%}
{%- if command.parameters -%}, {% endif -%}
std::unique_ptr<{{command.name | to_title_case}}Callback> callback
{%- else -%}
@@ -236,7 +236,7 @@ public:
) = 0;
{% endfor %}
- {% if not has_disable(domain.commands) %}
+ {% if generate_disable(domain) %}
virtual DispatchResponse disable()
{
return DispatchResponse::OK();
@@ -250,7 +250,7 @@ class {{config.protocol.export_macro}} Frontend {
public:
Frontend(FrontendChannel* frontendChannel) : m_frontendChannel(frontendChannel) { }
{% for event in domain.events %}
- {% if "handlers" in event and not ("renderer" in event["handlers"]) %}{% continue %}{% endif %}
+ {% if not generate_event(domain.domain, event.name) %}{% continue %}{% endif %}
void {{event.name}}(
{%- for parameter in event.parameters -%}
{%- if "optional" in parameter -%}
« no previous file with comments | « templates/TypeBuilder_cpp.template ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698