WebRTC-DeprecateGlobalFieldTrialString/Enabled/ - part 16/inf

This cl/ adds the feature actually injecting a FieldTrialsView into
PeerConnectionFactory, or into a PeerConnection or both.

The field trials used for a PeerConnection is those specified in
PeerConnectionDependencies. Otherwise will those from
PeerConnectionFactoryDependencies be used (and until we're finished with
this conversion, the global string fallback is used as last resort).

Note that it is currently not possible to create 2 FieldTrials
objects concurrently...due to global string,
so this cl/ is mostly (but entirely) for show, i.e one _can_
realistically inject them into a PeerConnectionFactory.


Bug: webrtc:10335
Change-Id: Id2e60525f48a1f8293c1dd0be771e3ed03790963
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/258134
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Jonas Oreland <jonaso@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#36578}
diff --git a/pc/peer_connection_internal.h b/pc/peer_connection_internal.h
index 66897ee..762f9b1 100644
--- a/pc/peer_connection_internal.h
+++ b/pc/peer_connection_internal.h
@@ -123,6 +123,8 @@
   virtual void TeardownDataChannelTransport_n() = 0;
   virtual void SetSctpDataMid(const std::string& mid) = 0;
   virtual void ResetSctpDataMid() = 0;
+
+  virtual const FieldTrialsView& trials() const = 0;
 };
 
 // Functions defined in this class are called by other objects,
@@ -178,8 +180,6 @@
   virtual void NoteDataAddedEvent() {}
   // Handler for the "channel closed" signal
   virtual void OnSctpDataChannelClosed(DataChannelInterface* channel) {}
-
-  virtual const FieldTrialsView& trials() = 0;
 };
 
 }  // namespace webrtc