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

Unified Diff: third_party/WebKit/Source/build/scripts/templates/InstrumentingProbesImpl.cpp.tmpl

Issue 2797253005: Revert of [instrumentation] Turn inspector override "probes" return values into output parameters. (Closed)
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/build/scripts/templates/InstrumentingProbesImpl.cpp.tmpl
diff --git a/third_party/WebKit/Source/build/scripts/templates/InstrumentingProbesImpl.cpp.tmpl b/third_party/WebKit/Source/build/scripts/templates/InstrumentingProbesImpl.cpp.tmpl
index 4db548ba08474aa54cfac9ede855112640466c9c..d6f15e9f98a5ee78528b27a6a95b62a41065247a 100644
--- a/third_party/WebKit/Source/build/scripts/templates/InstrumentingProbesImpl.cpp.tmpl
+++ b/third_party/WebKit/Source/build/scripts/templates/InstrumentingProbesImpl.cpp.tmpl
@@ -53,19 +53,23 @@
{% set agent_probe_name = common_name or probe.name %}
{{sink_class}}* sink = to{{sink_class}}({{probe.params[0].name}});
if (!sink)
- return;
+ 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())
- agent->{{agent_probe_name}}({{caller()}});
+ {{maybe_return}}agent->{{agent_probe_name}}({{caller()}});
}
{% endfor %}
+{% if probe.default_return_value %}
+ return {{probe.default_return_value}};
+{% endif %}
{% endmacro -%}
{% for file in files %}
@@ -86,7 +90,7 @@
{% else -%}
-CORE_EXPORT void {{probe.name}}({{ params_list(probe) }}) {
+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 -%}

Powered by Google App Engine
This is Rietveld 408576698