1*d9f75844SAndroid Build Coastguard Worker /* 2*d9f75844SAndroid Build Coastguard Worker * Copyright 2020 The WebRTC project authors. All Rights Reserved. 3*d9f75844SAndroid Build Coastguard Worker * 4*d9f75844SAndroid Build Coastguard Worker * Use of this source code is governed by a BSD-style license 5*d9f75844SAndroid Build Coastguard Worker * that can be found in the LICENSE file in the root of the source 6*d9f75844SAndroid Build Coastguard Worker * tree. An additional intellectual property rights grant can be found 7*d9f75844SAndroid Build Coastguard Worker * in the file PATENTS. All contributing project authors may 8*d9f75844SAndroid Build Coastguard Worker * be found in the AUTHORS file in the root of the source tree. 9*d9f75844SAndroid Build Coastguard Worker */ 10*d9f75844SAndroid Build Coastguard Worker 11*d9f75844SAndroid Build Coastguard Worker #ifndef PC_PEER_CONNECTION_MESSAGE_HANDLER_H_ 12*d9f75844SAndroid Build Coastguard Worker #define PC_PEER_CONNECTION_MESSAGE_HANDLER_H_ 13*d9f75844SAndroid Build Coastguard Worker 14*d9f75844SAndroid Build Coastguard Worker #include <functional> 15*d9f75844SAndroid Build Coastguard Worker 16*d9f75844SAndroid Build Coastguard Worker #include "api/jsep.h" 17*d9f75844SAndroid Build Coastguard Worker #include "api/legacy_stats_types.h" 18*d9f75844SAndroid Build Coastguard Worker #include "api/media_stream_interface.h" 19*d9f75844SAndroid Build Coastguard Worker #include "api/peer_connection_interface.h" 20*d9f75844SAndroid Build Coastguard Worker #include "api/rtc_error.h" 21*d9f75844SAndroid Build Coastguard Worker #include "api/task_queue/pending_task_safety_flag.h" 22*d9f75844SAndroid Build Coastguard Worker #include "api/task_queue/task_queue_base.h" 23*d9f75844SAndroid Build Coastguard Worker #include "pc/legacy_stats_collector_interface.h" 24*d9f75844SAndroid Build Coastguard Worker 25*d9f75844SAndroid Build Coastguard Worker namespace webrtc { 26*d9f75844SAndroid Build Coastguard Worker 27*d9f75844SAndroid Build Coastguard Worker class PeerConnectionMessageHandler { 28*d9f75844SAndroid Build Coastguard Worker public: PeerConnectionMessageHandler(rtc::Thread * signaling_thread)29*d9f75844SAndroid Build Coastguard Worker explicit PeerConnectionMessageHandler(rtc::Thread* signaling_thread) 30*d9f75844SAndroid Build Coastguard Worker : signaling_thread_(signaling_thread) {} 31*d9f75844SAndroid Build Coastguard Worker ~PeerConnectionMessageHandler() = default; 32*d9f75844SAndroid Build Coastguard Worker 33*d9f75844SAndroid Build Coastguard Worker void PostSetSessionDescriptionSuccess( 34*d9f75844SAndroid Build Coastguard Worker SetSessionDescriptionObserver* observer); 35*d9f75844SAndroid Build Coastguard Worker void PostSetSessionDescriptionFailure(SetSessionDescriptionObserver* observer, 36*d9f75844SAndroid Build Coastguard Worker RTCError&& error); 37*d9f75844SAndroid Build Coastguard Worker void PostCreateSessionDescriptionFailure( 38*d9f75844SAndroid Build Coastguard Worker CreateSessionDescriptionObserver* observer, 39*d9f75844SAndroid Build Coastguard Worker RTCError error); 40*d9f75844SAndroid Build Coastguard Worker void PostGetStats(StatsObserver* observer, 41*d9f75844SAndroid Build Coastguard Worker LegacyStatsCollectorInterface* legacy_stats, 42*d9f75844SAndroid Build Coastguard Worker MediaStreamTrackInterface* track); 43*d9f75844SAndroid Build Coastguard Worker void RequestUsagePatternReport(std::function<void()>, int delay_ms); 44*d9f75844SAndroid Build Coastguard Worker 45*d9f75844SAndroid Build Coastguard Worker private: 46*d9f75844SAndroid Build Coastguard Worker ScopedTaskSafety safety_; 47*d9f75844SAndroid Build Coastguard Worker TaskQueueBase* const signaling_thread_; 48*d9f75844SAndroid Build Coastguard Worker }; 49*d9f75844SAndroid Build Coastguard Worker 50*d9f75844SAndroid Build Coastguard Worker } // namespace webrtc 51*d9f75844SAndroid Build Coastguard Worker 52*d9f75844SAndroid Build Coastguard Worker #endif // PC_PEER_CONNECTION_MESSAGE_HANDLER_H_ 53