| OLD | NEW |
| 1 // This file is generated from {{input_file}} | 1 // This file is generated from {{input_file}} |
| 2 | 2 |
| 3 // Copyright 2017 The Chromium Authors. All rights reserved. | 3 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 4 // Use of this source code is governed by a BSD-style license that can be | 4 // Use of this source code is governed by a BSD-style license that can be |
| 5 // found in the LICENSE file. | 5 // found in the LICENSE file. |
| 6 | 6 |
| 7 | 7 |
| 8 {% set sink_class = (name | to_singular) + "Sink" %} | 8 {% set sink_class = (name | to_singular) + "Sink" %} |
| 9 {% for file in files %} | 9 {% for file in files %} |
| 10 #include "{{file.name}}Inl.h" | 10 #include "{{file.name}}Inl.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 {{param.type}} {{param.name}} | 47 {{param.type}} {{param.name}} |
| 48 {%- if not loop.last %}, {% endif -%} | 48 {%- if not loop.last %}, {% endif -%} |
| 49 {%- endfor -%} | 49 {%- endfor -%} |
| 50 {%- endmacro %} | 50 {%- endmacro %} |
| 51 | 51 |
| 52 {% macro probe_body(probe, common_name) %} | 52 {% macro probe_body(probe, common_name) %} |
| 53 {% set agent_probe_name = method_name(common_name or probe.name) %} | 53 {% set agent_probe_name = method_name(common_name or probe.name) %} |
| 54 {{sink_class}}* sink = To{{sink_class}}({{probe.params[0].name}}); | 54 {{sink_class}}* sink = To{{sink_class}}({{probe.params[0].name}}); |
| 55 if (!sink) | 55 if (!sink) |
| 56 return; | 56 return; |
| 57 {% for param in probe.params %} | |
| 58 {% if param.is_prp %} | |
| 59 RefPtr<{{param.inner_type}}> {{param.value}} = {{param.name}}; | |
| 60 {% endif %} | |
| 61 {% endfor %} | |
| 62 {% for agent in probe.agents %} | 57 {% for agent in probe.agents %} |
| 63 {% set class_name = agent | agent_name_to_class %} | 58 {% set class_name = agent | agent_name_to_class %} |
| 64 if (sink->has{{class_name}}s()) { | 59 if (sink->has{{class_name}}s()) { |
| 65 for ({{class_name}}* agent : sink->{{ class_name | to_lower_case }}s()) | 60 for ({{class_name}}* agent : sink->{{ class_name | to_lower_case }}s()) |
| 66 agent->{{agent_probe_name}}({{caller()}}); | 61 agent->{{agent_probe_name}}({{caller()}}); |
| 67 } | 62 } |
| 68 {% endfor %} | 63 {% endfor %} |
| 69 {% endmacro -%} | 64 {% endmacro -%} |
| 70 | 65 |
| 71 {% for file in files %} | 66 {% for file in files %} |
| (...skipping 11 matching lines...) Expand all Loading... |
| 83 {{probe.name}}::~{{probe.name}}() { | 78 {{probe.name}}::~{{probe.name}}() { |
| 84 {% call probe_body(probe, "Did") %}*this{% endcall %} | 79 {% call probe_body(probe, "Did") %}*this{% endcall %} |
| 85 } | 80 } |
| 86 | 81 |
| 87 {% else -%} | 82 {% else -%} |
| 88 | 83 |
| 89 CORE_EXPORT void {{probe.name}}({{ params_list(probe) }}) { | 84 CORE_EXPORT void {{probe.name}}({{ params_list(probe) }}) { |
| 90 {% call probe_body(probe, "") %} | 85 {% call probe_body(probe, "") %} |
| 91 {%- for param in probe.params %} | 86 {%- for param in probe.params %} |
| 92 {%- if not loop.first or "Keep" in param.options -%} | 87 {%- if not loop.first or "Keep" in param.options -%} |
| 93 {{param.value}} | 88 {{param.name}} |
| 94 {%- if not loop.last %}, {% endif -%} | 89 {%- if not loop.last %}, {% endif -%} |
| 95 {%- endif -%} | 90 {%- endif -%} |
| 96 {%- endfor %} | 91 {%- endfor %} |
| 97 {%- endcall %} | 92 {%- endcall %} |
| 98 } | 93 } |
| 99 | 94 |
| 100 {% endif %} | 95 {% endif %} |
| 101 {% endfor %} | 96 {% endfor %} |
| 102 {% endfor %} | 97 {% endfor %} |
| 103 | 98 |
| 104 } // namespace probe | 99 } // namespace probe |
| 105 } // namespace blink | 100 } // namespace blink |
| OLD | NEW |