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

Unified Diff: third_party/WebKit/Source/core/inspector/InstrumentingAgents_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
Index: third_party/WebKit/Source/core/inspector/InstrumentingAgents_h.template
diff --git a/third_party/WebKit/Source/core/inspector/InstrumentingAgents_h.template b/third_party/WebKit/Source/core/inspector/InstrumentingAgents_h.template
new file mode 100644
index 0000000000000000000000000000000000000000..1a90db1c1117188c5a2c7f80722acfed967259df
--- /dev/null
+++ b/third_party/WebKit/Source/core/inspector/InstrumentingAgents_h.template
@@ -0,0 +1,46 @@
+// 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 InstrumentingAgents_h
+#define InstrumentingAgents_h
+
+#include "core/CoreExport.h"
+#include "platform/heap/HeapAllocator.h"
+
+namespace blink {
+
+{% for agent in agents %}
+class {{ agent | agent_name_to_class }};
+{% endfor %}
+
+class CORE_EXPORT InstrumentingAgents : public GarbageCollected<InstrumentingAgents> {
+ WTF_MAKE_NONCOPYABLE(InstrumentingAgents);
+
+ public:
+ InstrumentingAgents();
+ DECLARE_TRACE();
+
+{% for agent in agents %}
+{% set class_name = agent | agent_name_to_class %}
+{% set getter_name = class_name | to_lower_case %}
+ bool has{{class_name}}s() const { return m_has{{class_name}}s; }
+ const HeapHashSet<Member<{{class_name}}>>& {{getter_name}}s() const { return m_{{getter_name}}s; }
+ void add{{class_name}}({{class_name}}* agent);
+ void remove{{class_name}}({{class_name}}* agent);
+
+{% endfor %}
+ private:
+{% for agent in agents %}
+{% set class_name = agent | agent_name_to_class %}
+{% set getter_name = class_name | to_lower_case %}
+ HeapHashSet<Member<{{class_name}}>> m_{{getter_name}}s;
+ bool m_has{{class_name}}s = false;
+{% endfor %}
+};
+
+} // namespace blink
+
+#endif // !defined(InstrumentingAgents_h)

Powered by Google App Engine
This is Rietveld 408576698