| OLD | NEW |
| 1 {% filter format_blink_cpp_source_code %} | 1 {% filter format_blink_cpp_source_code %} |
| 2 | 2 |
| 3 {% include 'copyright_block.txt' %} | 3 {% include 'copyright_block.txt' %} |
| 4 | 4 |
| 5 #include "{{class_name.snake_case}}.h" | 5 #include "web/api/{{class_name.snake_case}}.h" |
| 6 | 6 |
| 7 // TODO(dglazkov): Implement generating includes. | 7 // TODO(dglazkov): Properly sort the includes. |
| 8 {% for filename in cpp_includes %} | 8 {% for filename in cpp_includes %} |
| 9 #include "{{filename}}.h" | 9 #include "{{filename}}" |
| 10 {% endfor %} | 10 {% endfor %} |
| 11 | 11 |
| 12 namespace blink { | 12 namespace web { |
| 13 namespace api { | 13 |
| 14 {{class_name.upper_camel_case}}* {{class_name.upper_camel_case}}::Create(blink::
{{class_name.upper_camel_case}}* {{class_name.snake_case}}) { |
| 15 return {{class_name.snake_case}} ? new {{class_name.upper_camel_case}}({{class
_name.snake_case}}) : nullptr; |
| 16 } |
| 17 |
| 18 {% if not base_class %} |
| 19 DEFINE_TRACE({{class_name.upper_camel_case}}) { |
| 20 visitor->trace({{class_name.snake_case}}_); |
| 21 } |
| 22 {% endif %} |
| 14 | 23 |
| 15 // TODO(dglazkov): Implement constant generation | 24 // TODO(dglazkov): Implement constant generation |
| 16 {% for constant in constants %} | 25 {% for constant in constants %} |
| 17 // {{ constant.name }} | 26 // {{ constant.name }} |
| 18 {% endfor %} | 27 {% endfor %} |
| 19 | 28 |
| 20 // TODO(dglazkov): Implement constructor generation | |
| 21 | |
| 22 // TODO(dglazkov): Implement attribute getter/setter generation | 29 // TODO(dglazkov): Implement attribute getter/setter generation |
| 23 {% for attribute in attributes %} | 30 {% for attribute in attributes %} |
| 24 // {{attribute.return_type}} {{attribute.name}} | 31 // {{attribute.return_type}} {{attribute.name}} |
| 25 {% endfor %} | 32 {% endfor %} |
| 26 | 33 |
| 27 // TODO(dglazkov): Implement method generation | 34 // TODO(dglazkov): Implement method generation |
| 28 {% for method in methods %} | 35 {% for method in methods %} |
| 29 // {{method.return_type}} {{class_name.upper_camel_case}}::{{method.name}} | 36 // {{method.return_type}} {{class_name.upper_camel_case}}::{{method.name}} |
| 30 {% endfor %} | 37 {% endfor %} |
| 31 | 38 |
| 32 } // namespace api | 39 {{class_name.upper_camel_case}}::{{class_name.upper_camel_case}}(blink::{{class_
name.upper_camel_case}}* {{class_name.snake_case}}) |
| 33 } // namespace blink | 40 : {{class_name.snake_case}}_({{class_name.snake_case}}) {} |
| 41 |
| 42 blink::{{class_name.upper_camel_case}}* {{class_name.upper_camel_case}}::{{class
_name.snake_case}}() const { |
| 43 return {{class_name.snake_case}}_; |
| 44 } |
| 45 |
| 46 } // namespace web |
| 34 | 47 |
| 35 {% endfilter %} | 48 {% endfilter %} |
| OLD | NEW |