WebrtcEnvironmentWrapper.h (1893B)
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 /* vim: set ts=2 et sw=2 tw=80: */ 3 /* This Source Code Form is subject to the terms of the Mozilla Public 4 * License, v. 2.0. If a copy of the MPL was not distributed with this 5 * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ 6 7 #ifndef DOM_MEDIA_WEBRTC_LIBWEBRTCGLUE_WEBRTCENVIRONMENTWRAPPER_H_ 8 #define DOM_MEDIA_WEBRTC_LIBWEBRTCGLUE_WEBRTCENVIRONMENTWRAPPER_H_ 9 10 #include "SystemTime.h" 11 #include "domstubs.h" 12 #include "jsapi/PeerConnectionCtx.h" // for MozTrialsConfig 13 #include "nsISupportsImpl.h" 14 15 // libwebrtc includes 16 #include "api/environment/environment.h" 17 #include "api/rtc_event_log/rtc_event_log.h" 18 19 namespace mozilla { 20 21 class WebrtcEnvironmentWrapper { 22 public: 23 static RefPtr<WebrtcEnvironmentWrapper> Create( 24 const dom::RTCStatsTimestampMaker& aTimestampMaker); 25 26 NS_INLINE_DECL_THREADSAFE_REFCOUNTING(WebrtcEnvironmentWrapper) 27 28 WebrtcEnvironmentWrapper(const WebrtcEnvironmentWrapper&) = delete; 29 WebrtcEnvironmentWrapper& operator=(const WebrtcEnvironmentWrapper&) = delete; 30 WebrtcEnvironmentWrapper(WebrtcEnvironmentWrapper&&) = delete; 31 WebrtcEnvironmentWrapper& operator=(WebrtcEnvironmentWrapper&&) = delete; 32 33 const webrtc::Environment& Environment() const { return mEnv; } 34 35 protected: 36 virtual ~WebrtcEnvironmentWrapper() = default; 37 38 WebrtcEnvironmentWrapper( 39 UniquePtr<webrtc::RtcEventLog>&& aEventLog, 40 UniquePtr<webrtc::TaskQueueFactory>&& aTaskQueueFactory, 41 UniquePtr<webrtc::FieldTrialsView>&& aTrials, 42 const dom::RTCStatsTimestampMaker& aTimestampMaker); 43 44 const UniquePtr<webrtc::RtcEventLog> mEventLog; 45 const UniquePtr<webrtc::TaskQueueFactory> mTaskQueueFactory; 46 const UniquePtr<webrtc::FieldTrialsView> mTrials; 47 RTCStatsTimestampMakerRealtimeClock mClock; 48 webrtc::Environment mEnv; 49 }; 50 51 } // namespace mozilla 52 53 #endif