[tracing] Use TracedProto in //content.
Use the new ability to write typed messages into the untyped and untyped
into typed to eliminate WriteIntoTrace(TracedValue) /
WriteIntoTrace(TracedProto) duplicated methods in //content.
After this patch, all key //content types listed below now have
corresponding proto messages (with DebugAnnotation support) and
WriteIntoTrace(TracedValue) methods have been removed:
- BrowserContext
- BrowsingContextState
- FrameTreeNode
- NavigationRequest
- RenderFrameHost
- RenderFrameProxyHost
- RenderViewHost
- SiteInstance
- SiteInstanceGroup
- GlobalRenderFrameHostId
This patch also adds a few `const` qualifiers to the appropriate methods
in //content to ensure that all WriteIntoTrace methods can be marked as
const.
[email protected]
Bug: 1137154
Change-Id: I306e7619f594e2a02ca24183720714f234661ff4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3540169
Reviewed-by: Rakina Zata Amni <[email protected]>
Reviewed-by: Alex Ilin <[email protected]>
Commit-Queue: Alexander Timin <[email protected]>
Cr-Commit-Position: refs/heads/main@{#984436}
diff --git a/content/browser/renderer_host/global_routing_id.cc b/content/browser/renderer_host/global_routing_id.cc
new file mode 100644
index 0000000..faace1bd
--- /dev/null
+++ b/content/browser/renderer_host/global_routing_id.cc
@@ -0,0 +1,18 @@
+// Copyright 2022 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.
+
+#include "content/public/browser/global_routing_id.h"
+
+#include "base/trace_event/typed_macros.h"
+#include "base/tracing/protos/chrome_track_event.pbzero.h"
+
+namespace content {
+
+void GlobalRenderFrameHostId::WriteIntoTrace(
+ perfetto::TracedProto<TraceProto> proto) const {
+ proto->set_process_id(child_id);
+ proto->set_routing_id(frame_routing_id);
+}
+
+} // namespace content