Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 {%- import "interface_macros.tmpl" as interface_macros %} | 1 {%- import "interface_macros.tmpl" as interface_macros %} |
| 2 class {{interface.name}}Proxy; | 2 class {{interface.name}}Proxy; |
| 3 | 3 |
| 4 template <typename ImplRefTraits> | 4 template <typename ImplRefTraits> |
| 5 class {{interface.name}}Stub; | 5 class {{interface.name}}Stub; |
| 6 | 6 |
| 7 class {{interface.name}}RequestValidator; | 7 class {{interface.name}}RequestValidator; |
| 8 {%- if interface|has_callbacks %} | 8 {%- if interface|has_callbacks %} |
| 9 class {{interface.name}}ResponseValidator; | 9 class {{interface.name}}ResponseValidator; |
| 10 {%- endif %} | 10 {%- endif %} |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 22 template <typename ImplRefTraits> | 22 template <typename ImplRefTraits> |
| 23 using Stub_ = {{interface.name}}Stub<ImplRefTraits>; | 23 using Stub_ = {{interface.name}}Stub<ImplRefTraits>; |
| 24 | 24 |
| 25 using RequestValidator_ = {{interface.name}}RequestValidator; | 25 using RequestValidator_ = {{interface.name}}RequestValidator; |
| 26 {%- if interface|has_callbacks %} | 26 {%- if interface|has_callbacks %} |
| 27 using ResponseValidator_ = {{interface.name}}ResponseValidator; | 27 using ResponseValidator_ = {{interface.name}}ResponseValidator; |
| 28 {%- else %} | 28 {%- else %} |
| 29 using ResponseValidator_ = mojo::PassThroughFilter; | 29 using ResponseValidator_ = mojo::PassThroughFilter; |
| 30 {%- endif %} | 30 {%- endif %} |
| 31 | 31 |
| 32 {#--- Metadata #} | |
| 33 enum kMethodIndices : uint32_t { | |
|
yzshen1
2016/12/22 18:53:28
For Foo.Bar(), we already have "const uint32_t int
| |
| 34 {%- for method in interface.methods %} | |
| 35 k{{method.name}}MethodIndex, | |
| 36 {%- endfor %} | |
| 37 kMethodMetadataSize | |
| 38 }; | |
| 39 | |
| 40 static const mojo::MethodMetadata kMethodMetadata[]; | |
| 41 | |
| 32 {#--- Enums #} | 42 {#--- Enums #} |
| 33 {%- for enum in interface.enums %} | 43 {%- for enum in interface.enums %} |
| 34 using {{enum.name}} = {{enum|get_name_for_kind(flatten_nested_kind=True)}}; | 44 using {{enum.name}} = {{enum|get_name_for_kind(flatten_nested_kind=True)}}; |
| 35 {%- endfor %} | 45 {%- endfor %} |
| 36 | 46 |
| 37 {#--- Constants #} | 47 {#--- Constants #} |
| 38 {%- for constant in interface.constants %} | 48 {%- for constant in interface.constants %} |
| 39 {%- if constant.kind|is_integral_kind %} | 49 {%- if constant.kind|is_integral_kind %} |
| 40 static const {{constant.kind|cpp_pod_type}} {{constant.name}} = {{constant|con stant_value}}; | 50 static const {{constant.kind|cpp_pod_type}} {{constant.name}} = {{constant|con stant_value}}; |
| 41 {%- else %} | 51 {%- else %} |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 53 // should implement the signature with callback below. | 63 // should implement the signature with callback below. |
| 54 virtual bool {{method.name}}({{interface_macros.declare_sync_method_params("", method)}}); | 64 virtual bool {{method.name}}({{interface_macros.declare_sync_method_params("", method)}}); |
| 55 {%- endif %} | 65 {%- endif %} |
| 56 | 66 |
| 57 using {{method.name}}Callback = {{interface_macros.declare_callback(method, | 67 using {{method.name}}Callback = {{interface_macros.declare_callback(method, |
| 58 for_blink, use_once_callback)}}; | 68 for_blink, use_once_callback)}}; |
| 59 {%- endif %} | 69 {%- endif %} |
| 60 virtual void {{method.name}}({{interface_macros.declare_request_params("", met hod, use_once_callback)}}) = 0; | 70 virtual void {{method.name}}({{interface_macros.declare_request_params("", met hod, use_once_callback)}}) = 0; |
| 61 {%- endfor %} | 71 {%- endfor %} |
| 62 }; | 72 }; |
| OLD | NEW |