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

Side by Side Diff: third_party/WebKit/Source/build/scripts/templates/ProbeSink.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 {% set sink_class = (name | to_singular) + "Sink" %} 7 {% set sink_class = (name | to_singular) + "Sink" %}
8 {% set export_symbol = config["settings"]["export_symbol"] %}
8 9
9 #ifndef {{sink_class}}_h 10 #ifndef {{sink_class}}_h
10 #define {{sink_class}}_h 11 #define {{sink_class}}_h
11 12
12 #include "platform/heap/HeapAllocator.h" 13 #include "platform/heap/HeapAllocator.h"
13 {% for define in defines %}
14 {{define}}
15 {% endfor %}
16 14
17 namespace blink { 15 namespace blink {
18 16
19 {% for agent in agents %} 17 {% for agent in agents %}
20 class {{ agent | agent_name_to_class }}; 18 class {{ agent | agent_name_to_class }};
21 {% endfor %} 19 {% endfor %}
22 20
23 class PROBE_EXPORT {{sink_class}} : public GarbageCollected<{{sink_class}}> { 21 class {{export_symbol}} {{sink_class}} : public GarbageCollected<{{sink_class}}> {
24 WTF_MAKE_NONCOPYABLE({{sink_class}}); 22 WTF_MAKE_NONCOPYABLE({{sink_class}});
25 23
26 public: 24 public:
27 {{sink_class}}(); 25 {{sink_class}}();
28 DECLARE_TRACE(); 26 DECLARE_TRACE();
29 27
30 {% for agent in agents %} 28 {% for agent in agents %}
31 {% set class_name = agent | agent_name_to_class %} 29 {% set class_name = agent | agent_name_to_class %}
32 {% set getter_name = class_name | to_lower_case %} 30 {% set getter_name = class_name | to_lower_case %}
33 bool has{{class_name}}s() const { return m_has{{class_name}}s; } 31 bool has{{class_name}}s() const { return m_has{{class_name}}s; }
34 const HeapHashSet<Member<{{class_name}}>>& {{getter_name}}s() const { return m _{{getter_name}}s; } 32 const HeapHashSet<Member<{{class_name}}>>& {{getter_name}}s() const { return m _{{getter_name}}s; }
35 void add{{class_name}}({{class_name}}* agent); 33 void add{{class_name}}({{class_name}}* agent);
36 void remove{{class_name}}({{class_name}}* agent); 34 void remove{{class_name}}({{class_name}}* agent);
37 35
38 {% endfor %} 36 {% endfor %}
39 private: 37 private:
40 {% for agent in agents %} 38 {% for agent in agents %}
41 {% set class_name = agent | agent_name_to_class %} 39 {% set class_name = agent | agent_name_to_class %}
42 {% set getter_name = class_name | to_lower_case %} 40 {% set getter_name = class_name | to_lower_case %}
43 HeapHashSet<Member<{{class_name}}>> m_{{getter_name}}s; 41 HeapHashSet<Member<{{class_name}}>> m_{{getter_name}}s;
44 bool m_has{{class_name}}s = false; 42 bool m_has{{class_name}}s = false;
45 {% endfor %} 43 {% endfor %}
46 }; 44 };
47 45
48 } // namespace blink 46 } // namespace blink
49 47
50 #endif // !defined({{sink_class}}_h) 48 #endif // !defined({{sink_class}}_h)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698