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

Side by Side Diff: third_party/WebKit/Source/platform/instrumentation/InstrumentingAgents_h.template

Issue 2760363002: [instrumentation] Generalize instrumentation to be used beyond the core layer (Closed)
Patch Set: 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 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 InstrumentingAgents_h 7 {% set agents_class = name + "Agents" %}
8 #define InstrumentingAgents_h
9 8
10 #include "core/CoreExport.h" 9 #ifndef {{agents_class}}_h
10 #define {{agents_class}}_h
11
11 #include "platform/heap/HeapAllocator.h" 12 #include "platform/heap/HeapAllocator.h"
13 {% for define in defines %}
14 {{define}}
15 {% endfor %}
12 16
13 namespace blink { 17 namespace blink {
14 18
15 {% for agent in agents %} 19 {% for agent in agents %}
16 class {{ agent | agent_name_to_class }}; 20 class {{ agent | agent_name_to_class }};
17 {% endfor %} 21 {% endfor %}
18 22
19 class CORE_EXPORT InstrumentingAgents : public GarbageCollected<InstrumentingAge nts> { 23 class PROBE_EXPORT {{agents_class}} : public GarbageCollected<{{agents_class}}> {
20 WTF_MAKE_NONCOPYABLE(InstrumentingAgents); 24 WTF_MAKE_NONCOPYABLE({{agents_class}});
21 25
22 public: 26 public:
23 InstrumentingAgents(); 27 {{agents_class}}();
24 DECLARE_TRACE(); 28 DECLARE_TRACE();
25 29
26 {% for agent in agents %} 30 {% for agent in agents %}
27 {% set class_name = agent | agent_name_to_class %} 31 {% set class_name = agent | agent_name_to_class %}
28 {% set getter_name = class_name | to_lower_case %} 32 {% set getter_name = class_name | to_lower_case %}
29 bool has{{class_name}}s() const { return m_has{{class_name}}s; } 33 bool has{{class_name}}s() const { return m_has{{class_name}}s; }
30 const HeapHashSet<Member<{{class_name}}>>& {{getter_name}}s() const { return m _{{getter_name}}s; } 34 const HeapHashSet<Member<{{class_name}}>>& {{getter_name}}s() const { return m _{{getter_name}}s; }
31 void add{{class_name}}({{class_name}}* agent); 35 void add{{class_name}}({{class_name}}* agent);
32 void remove{{class_name}}({{class_name}}* agent); 36 void remove{{class_name}}({{class_name}}* agent);
33 37
34 {% endfor %} 38 {% endfor %}
35 private: 39 private:
36 {% for agent in agents %} 40 {% for agent in agents %}
37 {% set class_name = agent | agent_name_to_class %} 41 {% set class_name = agent | agent_name_to_class %}
38 {% set getter_name = class_name | to_lower_case %} 42 {% set getter_name = class_name | to_lower_case %}
39 HeapHashSet<Member<{{class_name}}>> m_{{getter_name}}s; 43 HeapHashSet<Member<{{class_name}}>> m_{{getter_name}}s;
40 bool m_has{{class_name}}s = false; 44 bool m_has{{class_name}}s = false;
41 {% endfor %} 45 {% endfor %}
42 }; 46 };
43 47
44 } // namespace blink 48 } // namespace blink
45 49
46 #endif // !defined(InstrumentingAgents_h) 50 #endif // !defined({{agents_class}}_h)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698