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

Unified Diff: mojo/public/tools/bindings/generators/cpp_templates/module.h.tmpl

Issue 1127843002: Interfaces declared first in header file. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 7 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
« no previous file with comments | « mojo/public/interfaces/bindings/tests/test_structs.mojom ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/tools/bindings/generators/cpp_templates/module.h.tmpl
diff --git a/mojo/public/tools/bindings/generators/cpp_templates/module.h.tmpl b/mojo/public/tools/bindings/generators/cpp_templates/module.h.tmpl
index 87880a26f31ed52d75244b518a6ba10f86cdf9be..d96fb60b8ff72f23d91a55e3f5fa37f81fd66dc9 100644
--- a/mojo/public/tools/bindings/generators/cpp_templates/module.h.tmpl
+++ b/mojo/public/tools/bindings/generators/cpp_templates/module.h.tmpl
@@ -71,29 +71,6 @@ typedef mojo::StructPtr<{{union.name}}> {{union.name}}Ptr;
{% endif %}
{%- endfor %}
-{#--- Unions must be declared first because they can be members of structs #}
-{#--- Unions #}
-{% for union in unions %}
-{% include "wrapper_union_class_declaration.tmpl" %}
-{%- endfor %}
-
-{#--- NOTE: Non-inlined structs may have pointers to inlined structs, so we #}
-{#--- need to fully define inlined structs ahead of the others. #}
-
-{#--- Inlined structs #}
-{% for struct in structs %}
-{% if struct|should_inline %}
-{% include "wrapper_class_declaration.tmpl" %}
-{% endif %}
-{%- endfor %}
-
-{#--- Non-inlined structs #}
-{% for struct in structs %}
-{% if not struct|should_inline %}
-{% include "wrapper_class_declaration.tmpl" %}
-{% endif %}
-{%- endfor %}
-
{#--- Interfaces -#}
{% for interface in interfaces %}
{% include "interface_declaration.tmpl" %}
@@ -119,6 +96,29 @@ typedef mojo::StructPtr<{{union.name}}> {{union.name}}Ptr;
{% include "interface_response_validator_declaration.tmpl" %}
{%- endfor %}
+{#--- Unions must be declared first because they can be members of structs #}
+{#--- Unions #}
+{% for union in unions %}
+{% include "wrapper_union_class_declaration.tmpl" %}
+{%- endfor %}
+
+{#--- NOTE: Non-inlined structs may have pointers to inlined structs, so we #}
+{#--- need to fully define inlined structs ahead of the others. #}
+
+{#--- Inlined structs #}
+{% for struct in structs %}
+{% if struct|should_inline %}
+{% include "wrapper_class_declaration.tmpl" %}
+{% endif %}
+{%- endfor %}
+
+{#--- Non-inlined structs #}
+{% for struct in structs %}
+{% if not struct|should_inline %}
+{% include "wrapper_class_declaration.tmpl" %}
+{% endif %}
+{%- endfor %}
+
{#--- Struct Serialization Helpers -#}
{% if structs %}
{% for struct in structs %}
« no previous file with comments | « mojo/public/interfaces/bindings/tests/test_structs.mojom ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698