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

Unified Diff: third_party/WebKit/Source/platform/probe/templates/InstrumentingProbesImpl.cpp.tmpl

Issue 2790973002: [instrumentation] Introduce JSON5 config files for probe generator. (Closed)
Patch Set: add missing config files 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/platform/probe/templates/InstrumentingProbesImpl.cpp.tmpl
diff --git a/third_party/WebKit/Source/platform/probe/templates/InstrumentingProbesImpl.cpp.tmpl b/third_party/WebKit/Source/platform/probe/templates/InstrumentingProbesImpl.cpp.tmpl
deleted file mode 100644
index b8a466f4f4175fb8dc977d3996ada004ededeb17..0000000000000000000000000000000000000000
--- a/third_party/WebKit/Source/platform/probe/templates/InstrumentingProbesImpl.cpp.tmpl
+++ /dev/null
@@ -1,116 +0,0 @@
-// 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.
-
-
-{% set sink_class = (name | to_singular) + "Sink" %}
-{% for file in files %}
-#include "{{file.name}}Inl.h"
-{% endfor %}
-#include "{{sink_class}}.h"
-{% for agent in agents %}
-{% set class_name = agent | agent_name_to_class %}
-{% if class_name == "PerformanceMonitor" %}
-#include "core/frame/PerformanceMonitor.h"
-{% elif class_name.startswith("Platform") %}
-#include "platform/probe/{{class_name}}.h"
-{% else %}
-#include "core/inspector/{{class_name}}.h"
-{% endif %}
-{% endfor %}
-
-namespace blink {
-
-{{sink_class}}::{{sink_class}}() {}
-
-{% for agent in agents %}
-{% set class_name = agent | agent_name_to_class %}
-{% set getter_name = class_name | to_lower_case %}
-void {{sink_class}}::add{{class_name}}({{class_name}}* agent) {
- m_{{getter_name}}s.insert(agent);
- m_has{{class_name}}s = true;
-}
-
-void {{sink_class}}::remove{{class_name}}({{class_name}}* agent) {
- m_{{getter_name}}s.erase(agent);
- m_has{{class_name}}s = !m_{{getter_name}}s.isEmpty();
-}
-
-{% endfor -%}
-
-DEFINE_TRACE({{sink_class}})
-{
-{% for agent in agents %}
-{% set getter_name = agent | agent_name_to_class | to_lower_case %}
- visitor->trace(m_{{getter_name}}s);
-{% endfor %}
-}
-
-namespace probe {
-{% macro params_list(probe) -%}
-{%- for param in probe.params %}
-{{param.type}} {{param.name}}
-{%- if not loop.last %}, {% endif -%}
-{%- endfor -%}
-{%- endmacro %}
-
-{% macro probe_body(probe, common_name) %}
-{% set agent_probe_name = common_name or probe.name %}
- {{sink_class}}* sink = to{{sink_class}}({{probe.params[0].name}});
- if (!sink)
- return {{probe.default_return_value}};
-{% for param in probe.params %}
-{% if param.is_prp %}
- RefPtr<{{param.inner_type}}> {{param.value}} = {{param.name}};
-{% endif %}
-{% endfor %}
-{% set maybe_return = "return " if probe.returns_value else "" %}
-{% for agent in probe.agents %}
-{% set class_name = agent | agent_name_to_class %}
- if (sink->has{{class_name}}s()) {
- for ({{class_name}}* agent : sink->{{ class_name | to_lower_case }}s())
- {{maybe_return}}agent->{{agent_probe_name}}({{caller()}});
- }
-{% endfor %}
-{% if probe.default_return_value %}
- return {{probe.default_return_value}};
-{% endif %}
-{% endmacro -%}
-
-{% for file in files %}
-{% for probe in file.declarations %}
-{% if probe.is_scoped %}
-{{probe.name}}::{{probe.name}}({{ params_list(probe) }}) :
-{% for param in probe.params %}
- {{param.name}}({{param.name}})
-{%- if not loop.last %},
-{% endif %}
-{% endfor %} {
-{% call probe_body(probe, "will") %}*this{% endcall %}
-}
-
-{{probe.name}}::~{{probe.name}}() {
-{% call probe_body(probe, "did") %}*this{% endcall %}
-}
-
-{% else -%}
-
-CORE_EXPORT {{probe.return_type}} {{probe.name}}({{ params_list(probe) }}) {
-{% call probe_body(probe, "") %}
-{%- for param in probe.params %}
-{%- if not loop.first or "Keep" in param.options -%}
-{{param.value}}
-{%- if not loop.last %}, {% endif -%}
-{%- endif -%}
-{%- endfor %}
-{%- endcall %}
-}
-
-{% endif %}
-{% endfor %}
-{% endfor %}
-
-} // namespace probe
-} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698