Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(115)

Side by Side Diff: content/shell/test_runner/mock_webrtc_peer_connection_handler.h

Issue 2951713002: RTCPeerConnection.addTrack and removeTrack added (behind flag) (Closed)
Patch Set: Addressed deadbeef's comments Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_SHELL_TEST_RUNNER_MOCK_WEBRTC_PEER_CONNECTION_HANDLER_H_ 5 #ifndef CONTENT_SHELL_TEST_RUNNER_MOCK_WEBRTC_PEER_CONNECTION_HANDLER_H_
6 #define CONTENT_SHELL_TEST_RUNNER_MOCK_WEBRTC_PEER_CONNECTION_HANDLER_H_ 6 #define CONTENT_SHELL_TEST_RUNNER_MOCK_WEBRTC_PEER_CONNECTION_HANDLER_H_
7 7
8 #include <map> 8 #include <map>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 const blink::WebRTCICECandidate& ice_candidate) override; 58 const blink::WebRTCICECandidate& ice_candidate) override;
59 bool AddStream(const blink::WebMediaStream& stream, 59 bool AddStream(const blink::WebMediaStream& stream,
60 const blink::WebMediaConstraints& constraints) override; 60 const blink::WebMediaConstraints& constraints) override;
61 void RemoveStream(const blink::WebMediaStream& stream) override; 61 void RemoveStream(const blink::WebMediaStream& stream) override;
62 void GetStats(const blink::WebRTCStatsRequest& request) override; 62 void GetStats(const blink::WebRTCStatsRequest& request) override;
63 void GetStats(std::unique_ptr<blink::WebRTCStatsReportCallback>) override; 63 void GetStats(std::unique_ptr<blink::WebRTCStatsReportCallback>) override;
64 blink::WebVector<std::unique_ptr<blink::WebRTCRtpSender>> GetSenders() 64 blink::WebVector<std::unique_ptr<blink::WebRTCRtpSender>> GetSenders()
65 override; 65 override;
66 blink::WebVector<std::unique_ptr<blink::WebRTCRtpReceiver>> GetReceivers() 66 blink::WebVector<std::unique_ptr<blink::WebRTCRtpReceiver>> GetReceivers()
67 override; 67 override;
68 std::unique_ptr<blink::WebRTCRtpSender> AddTrack(
69 const blink::WebMediaStreamTrack& web_track,
70 const blink::WebVector<blink::WebMediaStream>& web_streams) override;
71 bool RemoveTrack(blink::WebRTCRtpSender* web_sender) override;
68 blink::WebRTCDataChannelHandler* CreateDataChannel( 72 blink::WebRTCDataChannelHandler* CreateDataChannel(
69 const blink::WebString& label, 73 const blink::WebString& label,
70 const blink::WebRTCDataChannelInit& init) override; 74 const blink::WebRTCDataChannelInit& init) override;
71 blink::WebRTCDTMFSenderHandler* CreateDTMFSender( 75 blink::WebRTCDTMFSenderHandler* CreateDTMFSender(
72 const blink::WebMediaStreamTrack& track) override; 76 const blink::WebMediaStreamTrack& track) override;
73 void Stop() override; 77 void Stop() override;
74 78
75 private: 79 private:
76 MockWebRTCPeerConnectionHandler(); 80 MockWebRTCPeerConnectionHandler();
77 81
(...skipping 16 matching lines...) Expand all
94 98
95 blink::WebRTCPeerConnectionHandlerClient* client_; 99 blink::WebRTCPeerConnectionHandlerClient* client_;
96 bool stopped_; 100 bool stopped_;
97 blink::WebRTCSessionDescription local_description_; 101 blink::WebRTCSessionDescription local_description_;
98 blink::WebRTCSessionDescription remote_description_; 102 blink::WebRTCSessionDescription remote_description_;
99 int stream_count_; 103 int stream_count_;
100 TestInterfaces* interfaces_; 104 TestInterfaces* interfaces_;
101 typedef std::map<std::string, blink::WebMediaStream> StreamMap; 105 typedef std::map<std::string, blink::WebMediaStream> StreamMap;
102 StreamMap local_streams_; 106 StreamMap local_streams_;
103 StreamMap remote_streams_; 107 StreamMap remote_streams_;
108 // Tracks added with |addTrack|, not including tracks of |local_streams_|.
109 std::map<std::string, blink::WebMediaStreamTrack> tracks_;
104 std::map<std::string, uintptr_t> id_by_track_; 110 std::map<std::string, uintptr_t> id_by_track_;
105 111
106 base::WeakPtrFactory<MockWebRTCPeerConnectionHandler> weak_factory_; 112 base::WeakPtrFactory<MockWebRTCPeerConnectionHandler> weak_factory_;
107 113
108 DISALLOW_COPY_AND_ASSIGN(MockWebRTCPeerConnectionHandler); 114 DISALLOW_COPY_AND_ASSIGN(MockWebRTCPeerConnectionHandler);
109 }; 115 };
110 116
111 } // namespace test_runner 117 } // namespace test_runner
112 118
113 #endif // CONTENT_SHELL_TEST_RUNNER_MOCK_WEBRTC_PEER_CONNECTION_HANDLER_H_ 119 #endif // CONTENT_SHELL_TEST_RUNNER_MOCK_WEBRTC_PEER_CONNECTION_HANDLER_H_
OLDNEW
« no previous file with comments | « content/renderer/media/webrtc/rtc_rtp_sender.cc ('k') | content/shell/test_runner/mock_webrtc_peer_connection_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698