Commit b5a259f0 authored by Karel Král's avatar Karel Král Committed by Commit Bot

Reland "Add tracing support for mojo handle kinds"

This is a reland of 19a1e60d

Original change's description:
> Add tracing support for mojo handle kinds
>
> Support tracing of mojo handle and remote/receiver kinds. Thus provide
> more precise debugging information for developers. Also avoid
> generating fallback literals for base::trace_event::ValueToString.
>
> Bug: 1103623
> Change-Id: Ib01e79f7ae0aba64cabda3aea87cc1d1aed3b921
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2356005
> Commit-Queue: Karel Král <karelkral@google.com>
> Reviewed-by: Ken Rockot <rockot@google.com>
> Reviewed-by: Alexander Timin <altimin@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#798588}

Fix crbug.com/1117192 by not tracing interface kinds as these have
incompatible API (either have is_bound or is_valid).

Bug: 1103623
Change-Id: Id126e143e478054e1aacc9f3fa48df3f9dbf113f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2368556Reviewed-by: default avatarKen Rockot <rockot@google.com>
Reviewed-by: default avatarAlexander Timin <altimin@chromium.org>
Commit-Queue: Karel Král <karelkral@google.com>
Cr-Commit-Position: refs/heads/master@{#801309}
parent 4fc4a8fc
......@@ -362,6 +362,26 @@ def _WriteInputParamForTracingImpl(generator, kind, cpp_parameter_name,
for line in _WrapIfNullable(loop_generator):
yield line
return
if (mojom.IsInterfaceRequestKind(kind)
or mojom.IsAssociatedInterfaceRequestKind(kind)):
yield output_context.AddSingleValue('Boolean',
cpp_parameter_name + '.is_pending()')
return
if (mojom.IsAnyHandleOrInterfaceKind(kind)
and not mojom.IsInterfaceKind(kind)):
yield output_context.AddSingleValue('Boolean',
cpp_parameter_name + '.is_valid()')
return
""" The case |mojom.IsInterfaceKind(kind)| is not covered.
|mojom.IsInterfaceKind(kind) == True| for the following types:
|mojo::InterfacePtrInfo|, |mojo::InterfacePtr|.
There is |mojo::InterfacePtrInfo::is_valid|,
but not |mojo::InterfacePtrInfo::is_bound|.
There is |mojo::InterfacePtr::is_bound|,
but not |mojo::InterfacePtr::is_valid|.
Both |mojo::InterfacePtrInfo| and |mojo::InterfacePtr| are deprecated.
"""
yield output_context.AddSingleValue('String', _TraceEventToString())
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment