diff options
Diffstat (limited to 'third_party/libwebrtc/pc/connection_context.h')
-rw-r--r-- | third_party/libwebrtc/pc/connection_context.h | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/third_party/libwebrtc/pc/connection_context.h b/third_party/libwebrtc/pc/connection_context.h index 399e7c2b45..893a3b0e52 100644 --- a/third_party/libwebrtc/pc/connection_context.h +++ b/third_party/libwebrtc/pc/connection_context.h @@ -15,6 +15,7 @@ #include <string> #include "api/call/call_factory_interface.h" +#include "api/environment/environment.h" #include "api/field_trials_view.h" #include "api/media_stream_interface.h" #include "api/peer_connection_interface.h" @@ -39,8 +40,6 @@ class UniqueRandomIdGenerator; namespace webrtc { -class RtcEventLog; - // This class contains resources needed by PeerConnection and associated // objects. A reference to this object is passed to each PeerConnection. The // methods on this object are assumed not to change the state in any way that @@ -54,6 +53,7 @@ class ConnectionContext final // The Dependencies class allows simple management of all new dependencies // being added to the ConnectionContext. static rtc::scoped_refptr<ConnectionContext> Create( + const Environment& env, PeerConnectionFactoryDependencies* dependencies); // This class is not copyable or movable. @@ -76,11 +76,16 @@ class ConnectionContext final rtc::Thread* network_thread() { return network_thread_; } const rtc::Thread* network_thread() const { return network_thread_; } + // Environment associated with the PeerConnectionFactory. + // Note: environments are different for different PeerConnections, + // but they are not supposed to change after creating the PeerConnection. + const Environment& env() const { return env_; } + // Field trials associated with the PeerConnectionFactory. // Note: that there can be different field trials for different // PeerConnections (but they are not supposed change after creating the // PeerConnection). - const FieldTrialsView& field_trials() const { return *trials_.get(); } + const FieldTrialsView& field_trials() const { return env_.field_trials(); } // Accessors only used from the PeerConnectionFactory class rtc::NetworkManager* default_network_manager() { @@ -91,7 +96,7 @@ class ConnectionContext final RTC_DCHECK_RUN_ON(signaling_thread_); return default_socket_factory_.get(); } - CallFactoryInterface* call_factory() { + MediaFactory* call_factory() { RTC_DCHECK_RUN_ON(worker_thread()); return call_factory_.get(); } @@ -106,7 +111,8 @@ class ConnectionContext final void set_use_rtx(bool use_rtx) { use_rtx_ = use_rtx; } protected: - explicit ConnectionContext(PeerConnectionFactoryDependencies* dependencies); + ConnectionContext(const Environment& env, + PeerConnectionFactoryDependencies* dependencies); friend class rtc::RefCountedNonVirtual<ConnectionContext>; ~ConnectionContext(); @@ -122,8 +128,7 @@ class ConnectionContext final AlwaysValidPointer<rtc::Thread> const worker_thread_; rtc::Thread* const signaling_thread_; - // Accessed both on signaling thread and worker thread. - std::unique_ptr<FieldTrialsView> const trials_; + const Environment env_; // This object is const over the lifetime of the ConnectionContext, and is // only altered in the destructor. @@ -138,7 +143,7 @@ class ConnectionContext final RTC_GUARDED_BY(signaling_thread_); std::unique_ptr<rtc::NetworkManager> default_network_manager_ RTC_GUARDED_BY(signaling_thread_); - std::unique_ptr<webrtc::CallFactoryInterface> const call_factory_ + std::unique_ptr<MediaFactory> const call_factory_ RTC_GUARDED_BY(worker_thread()); std::unique_ptr<rtc::PacketSocketFactory> default_socket_factory_ |