tracing: remove non-pure-virtual overloads for arctracingservice

Now that ag/26150293 and ag/26150292 landed, we don't need to
maintain API compat with arctracingservice's test.

Bug: 321196572
Change-Id: I0bcc207778a2653f92bd44b56f7dafb0f8c11ddb
diff --git a/include/perfetto/ext/tracing/core/tracing_service.h b/include/perfetto/ext/tracing/core/tracing_service.h
index 9a49c52..5921943 100644
--- a/include/perfetto/ext/tracing/core/tracing_service.h
+++ b/include/perfetto/ext/tracing/core/tracing_service.h
@@ -194,11 +194,10 @@
   // existing tracing session. Will invoke Consumer::OnSessionCloned().
   // If TracingSessionID == kBugreportSessionId (0xff...ff) the session with the
   // highest bugreport score is cloned (if any exists).
-  // TODO(primiano): make pure virtual after various 3way patches.
   struct CloneSessionArgs {
     bool skip_trace_filter = false;
   };
-  virtual void CloneSession(TracingSessionID, CloneSessionArgs);
+  virtual void CloneSession(TracingSessionID, CloneSessionArgs) = 0;
 
   // Requests all data sources to flush their data immediately and invokes the
   // passed callback once all of them have acked the flush (in which case
@@ -208,15 +207,15 @@
   // if that one is not set (or is set to 0), kDefaultFlushTimeoutMs (5s) is
   // used.
   using FlushCallback = std::function<void(bool /*success*/)>;
-  virtual void Flush(uint32_t timeout_ms, FlushCallback callback, FlushFlags);
+  virtual void Flush(uint32_t timeout_ms,
+                     FlushCallback callback,
+                     FlushFlags) = 0;
 
-  // The only caller of this method is arctraceservice's PerfettoClient.
-  // Everything else in the codebase uses the 3-arg Flush() above.
-  // TODO(primiano): remove the overload without FlushFlags once
-  // arctraceservice moves away from this interface. arctraceservice lives in
-  // the internal repo and changes to this interface require multi-side patches.
-  // Inernally this calls Flush(timeout, callback, FlushFlags(0)).
-  virtual void Flush(uint32_t timeout_ms, FlushCallback callback);
+  // This is required for legacy out-of-repo clients like arctraceservice which
+  // use the 2-version parameter.
+  inline void Flush(uint32_t timeout_ms, FlushCallback callback) {
+    Flush(timeout_ms, std::move(callback), FlushFlags());
+  }
 
   // Tracing data will be delivered invoking Consumer::OnTraceData().
   virtual void ReadBuffers() = 0;
@@ -249,9 +248,7 @@
   using QueryServiceStateCallback =
       std::function<void(bool success, const TracingServiceState&)>;
   virtual void QueryServiceState(QueryServiceStateArgs,
-                                 QueryServiceStateCallback);
-  // TODO(primiano): remove this overload once arctraceservice is updated.
-  virtual void QueryServiceState(QueryServiceStateCallback);
+                                 QueryServiceStateCallback) = 0;
 
   // Used for feature detection. Makes sense only when the consumer and the
   // service talk over IPC and can be from different versions.
diff --git a/src/tracing/core/virtual_destructors.cc b/src/tracing/core/virtual_destructors.cc
index d210463..9b3d250 100644
--- a/src/tracing/core/virtual_destructors.cc
+++ b/src/tracing/core/virtual_destructors.cc
@@ -39,30 +39,6 @@
 SharedMemoryArbiter::~SharedMemoryArbiter() = default;
 
 // TODO(primiano): make pure virtual after various 3way patches.
-void ConsumerEndpoint::CloneSession(TracingSessionID, CloneSessionArgs) {}
 void Consumer::OnSessionCloned(const OnSessionClonedArgs&) {}
 
-void ConsumerEndpoint::Flush(uint32_t, FlushCallback, FlushFlags) {
-  // In the perfetto codebase, this 3-arg Flush is always overridden and this
-  // FATAL is never reached. The only case where this is used is in
-  // arctraceservice's PerfettoClient_test.cpp. That test mocks the old
-  // 2-arg version of Flush but doesn't actually invoke the 3-arg version.
-  PERFETTO_FATAL("ConsumerEndpoint::Flush(3) not implemented");
-}
-
-void ConsumerEndpoint::Flush(uint32_t timeout_ms, FlushCallback callback) {
-  // This 2-arg version of Flush() is invoked by arctraceservice's
-  // PerfettoClient::Flush().
-  Flush(timeout_ms, std::move(callback), FlushFlags(0));
-}
-
-void ConsumerEndpoint::QueryServiceState(QueryServiceStateArgs,
-                                         QueryServiceStateCallback cb) {
-  cb(/*success=*/false, TracingServiceState());
-}
-
-void ConsumerEndpoint::QueryServiceState(QueryServiceStateCallback cb) {
-  QueryServiceState({}, std::move(cb));
-}
-
 }  // namespace perfetto