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

Unified Diff: third_party/WebKit/Source/core/inspector/InstrumentingProbesImpl_h.template

Issue 2748383002: [instrumentation] Generate instrumentation probes with jinja2 (Closed)
Patch Set: addressing comments Created 3 years, 9 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 | « third_party/WebKit/Source/core/inspector/InstrumentingProbesImpl_cpp.template ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/inspector/InstrumentingProbesImpl_h.template
diff --git a/third_party/WebKit/Source/core/inspector/InstrumentingProbesImpl_h.template b/third_party/WebKit/Source/core/inspector/InstrumentingProbesImpl_h.template
new file mode 100644
index 0000000000000000000000000000000000000000..d7e2cd0a1ede759fd984ddadbac0c7cc817e6597
--- /dev/null
+++ b/third_party/WebKit/Source/core/inspector/InstrumentingProbesImpl_h.template
@@ -0,0 +1,55 @@
+// This file is generated from {{input_file}}
+
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef {{file.header_name}}_h
+#define {{file.header_name}}_h
+
+{% for include in file.includes %}
+{{include}}
+{% endfor %}
+
+namespace blink {
+
+{% for forward_decl in file.forward_declarations %}
+{{forward_decl}}
+{% endfor %}
+
+namespace probe {
+{% for probe in file.declarations %}
+
+{%- macro params_decl(probe) %}
+{%- for param in probe.params %}
+{{ param.type }}
+{%- if param.default_value %} = {{ param.default_value }}
+{%- endif %}
+{%- if not loop.last %}, {% endif %}
+{%- endfor %}
+{%- endmacro -%}
+
+{% if probe.is_scoped %}
+
+
+class CORE_EXPORT {{probe.name}} : public ProbeBase {
+ STACK_ALLOCATED()
+ public:
+ explicit {{probe.name}}({{ params_decl(probe) }});
+ ~{{probe.name}}();
+{% for param in probe.params %}
+ {{param.member_type}} {{param.name}};
+{% endfor %}
+};
+{%- else %}
+
+CORE_EXPORT {{probe.return_type}} {{probe.name}}({{ params_decl(probe) }});
+
+{%- endif %}
+{%- endfor %}
+
+
+} // namespace probe
+} // namespace blink
+
+#endif // !defined({{file.header_name}}_h)
« no previous file with comments | « third_party/WebKit/Source/core/inspector/InstrumentingProbesImpl_cpp.template ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698