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

Side by Side Diff: third_party/WebKit/Source/build/scripts/templates/InstrumentingProbesInl.h.tmpl

Issue 2790973002: [instrumentation] Introduce JSON5 config files for probe generator. (Closed)
Patch Set: add missing config files Created 3 years, 8 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 unified diff | Download patch
OLDNEW
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 #ifndef {{file.header_name}}_h 7 #ifndef {{file.header_name}}_h
8 #define {{file.header_name}}_h 8 #define {{file.header_name}}_h
9 9
10 #include "platform/heap/HeapAllocator.h" 10 #include "platform/heap/HeapAllocator.h"
11 {% for include in file.includes %} 11 {% for include in file.includes %}
12 {{include}} 12 {{include}}
13 {% endfor %} 13 {% endfor %}
14 14
15 {% for define in file.defines %} 15 {% set export_symbol = config["settings"]["export_symbol"] %}
16 {{define}}
17 {% endfor %}
18 16
19 namespace blink { 17 namespace blink {
20 18
21 {% for forward_decl in file.forward_declarations %} 19 {% for forward_decl in file.forward_declarations %}
22 {{forward_decl}} 20 {{forward_decl}}
23 {% endfor %} 21 {% endfor %}
24 22
25 namespace probe { 23 namespace probe {
26 {% for probe in file.declarations %} 24 {% for probe in file.declarations %}
27 25
28 {%- macro params_decl(probe) %} 26 {%- macro params_decl(probe) %}
29 {%- for param in probe.params %} 27 {%- for param in probe.params %}
30 {{ param.type }} 28 {{ param.type }}
31 {%- if param.default_value %} = {{ param.default_value }} 29 {%- if param.default_value %} = {{ param.default_value }}
32 {%- endif %} 30 {%- endif %}
33 {%- if not loop.last %}, {% endif %} 31 {%- if not loop.last %}, {% endif %}
34 {%- endfor %} 32 {%- endfor %}
35 {%- endmacro -%} 33 {%- endmacro -%}
36 34
37 {% if probe.is_scoped %} 35 {% if probe.is_scoped %}
38 36
39 37
40 class PROBE_EXPORT {{probe.name}} : public ProbeBase { 38 class {{export_symbol}} {{probe.name}} : public ProbeBase {
41 STACK_ALLOCATED() 39 STACK_ALLOCATED()
42 public: 40 public:
43 explicit {{probe.name}}({{ params_decl(probe) }}); 41 explicit {{probe.name}}({{ params_decl(probe) }});
44 ~{{probe.name}}(); 42 ~{{probe.name}}();
45 {% for param in probe.params %} 43 {% for param in probe.params %}
46 {{param.member_type}} {{param.name}}; 44 {{param.member_type}} {{param.name}};
47 {% endfor %} 45 {% endfor %}
48 }; 46 };
49 {%- else %} 47 {%- else %}
50 48
51 PROBE_EXPORT {{probe.return_type}} {{probe.name}}({{ params_decl(probe) }}); 49 {{export_symbol}} {{probe.return_type}} {{probe.name}}({{ params_decl(probe) }}) ;
52 50
53 {%- endif %} 51 {%- endif %}
54 {%- endfor %} 52 {%- endfor %}
55 53
56 54
57 } // namespace probe 55 } // namespace probe
58 } // namespace blink 56 } // namespace blink
59 57
60 #endif // !defined({{file.header_name}}_h) 58 #endif // !defined({{file.header_name}}_h)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698