Commit 3fb6ca11 authored by Dan Elphick's avatar Dan Elphick Committed by Commit Bot

Make WebContentsImpl Loading event show up in perfetto

Changes WebContentsImpl Loading trace event to be a nestable trace event
which means that it will show up in perfetto which doesn't support
non-nested async events.

Bug: 1142477
Change-Id: Ic8a279b5b0c99a02d0cde0a05ffcd45bfef2c827
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2494863
Commit-Queue: Dan Elphick <delphick@chromium.org>
Auto-Submit: Dan Elphick <delphick@chromium.org>
Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#820826}
parent 8c9bd303
...@@ -6237,14 +6237,14 @@ void WebContentsImpl::LoadingStateChanged(bool to_different_document, ...@@ -6237,14 +6237,14 @@ void WebContentsImpl::LoadingStateChanged(bool to_different_document,
std::string url = (details ? details->url.possibly_invalid_spec() : "NULL"); std::string url = (details ? details->url.possibly_invalid_spec() : "NULL");
if (is_loading) { if (is_loading) {
TRACE_EVENT_ASYNC_BEGIN2("browser,navigation", "WebContentsImpl Loading", TRACE_EVENT_NESTABLE_ASYNC_BEGIN2(
this, "URL", url, "Main FrameTreeNode id", "browser,navigation", "WebContentsImpl Loading", this, "URL", url,
GetFrameTree()->root()->frame_tree_node_id()); "Main FrameTreeNode id", GetFrameTree()->root()->frame_tree_node_id());
observers_.ForEachObserver( observers_.ForEachObserver(
[&](WebContentsObserver* observer) { observer->DidStartLoading(); }); [&](WebContentsObserver* observer) { observer->DidStartLoading(); });
} else { } else {
TRACE_EVENT_ASYNC_END1("browser,navigation", "WebContentsImpl Loading", TRACE_EVENT_NESTABLE_ASYNC_END1(
this, "URL", url); "browser,navigation", "WebContentsImpl Loading", this, "URL", url);
observers_.ForEachObserver( observers_.ForEachObserver(
[&](WebContentsObserver* observer) { observer->DidStopLoading(); }); [&](WebContentsObserver* observer) { observer->DidStopLoading(); });
} }
......
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