sdk: Support embedder-provided policy approving consumer connections
ChromeOS needs a way to deny (system) consumer connections when a
specific enterprise policy is set.
This patch adds a TracingPolicy object to InitTracingArgs which is
notified for each new consumer session, allowing the embedder to deny
them. Since Chrome can only check for this policy on a specific
thread, the approval can be asynchronous.
To support this, the SDK's ConsumerImpl object is created before the
service consumer connection is initialized. This works fine, because
subsequent interactions with the object already have to consider a
delayed service connection.
Bug: 183391449
Change-Id: Ibe70e01a69bb8cfe0447e986647a499de90c5012
diff --git a/BUILD b/BUILD
index 1699bdb..80fb3be 100644
--- a/BUILD
+++ b/BUILD
@@ -508,6 +508,7 @@
filegroup(
name = "include_perfetto_tracing_tracing",
srcs = [
+ "include/perfetto/tracing/backend_type.h",
"include/perfetto/tracing/buffer_exhausted_policy.h",
"include/perfetto/tracing/console_interceptor.h",
"include/perfetto/tracing/data_source.h",
@@ -535,6 +536,7 @@
"include/perfetto/tracing/traced_value_forward.h",
"include/perfetto/tracing/tracing.h",
"include/perfetto/tracing/tracing_backend.h",
+ "include/perfetto/tracing/tracing_policy.h",
"include/perfetto/tracing/track.h",
"include/perfetto/tracing/track_event.h",
"include/perfetto/tracing/track_event_category_registry.h",
@@ -1625,6 +1627,7 @@
"src/tracing/platform.cc",
"src/tracing/traced_value.cc",
"src/tracing/tracing.cc",
+ "src/tracing/tracing_policy.cc",
"src/tracing/track.cc",
"src/tracing/track_event_category_registry.cc",
"src/tracing/track_event_legacy.cc",