Changeset 261447 in webkit
- Timestamp:
- May 9, 2020 5:05:59 PM (4 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r261443 r261447 1 2020-05-09 Jer Noble <jer.noble@apple.com> 2 3 REGRESSION(r258493): CRASH running fast/mediastream/RTCPeerConnection tests 4 https://bugs.webkit.org/show_bug.cgi?id=211666 5 <rdar://problem/63055644> 6 7 Reviewed by Eric Carlson. 8 9 MockMediaStreamTrack advertises that it's a webrtc::VideoTrackInterface, but doesn't inherit from 10 that interface, leading to a crash when its pointer is cast to webrtc::VideoTrackInterface and a 11 virtual method called on the resulting pointer. Since it's only used in one place, and since there's 12 an existing mock webrtc::VideoTrackInterface object in that same file, remove MockMediaStreamTrack 13 and replace the one place it's used with MockLibWebRTCVideoTrack. 14 15 * testing/MockLibWebRTCPeerConnection.h: 16 (WebCore::MockMediaStreamTrack::state const): Deleted. 17 1 18 2020-05-09 David Kilzer <ddkilzer@apple.com> 2 19 -
trunk/Source/WebCore/testing/MockLibWebRTCPeerConnection.h
r259345 r261447 130 130 bool set_enabled(bool enabled) final { m_enabled = enabled; return true; } 131 131 132 bool m_enabled ;132 bool m_enabled { true }; 133 133 std::string m_id; 134 134 rtc::scoped_refptr<webrtc::VideoTrackSourceInterface> m_source; … … 190 190 }; 191 191 192 class MockMediaStreamTrack : public webrtc::MediaStreamTrackInterface {193 public:194 MockMediaStreamTrack() = default;195 private:196 std::string kind() const final { return "video"; }197 std::string id() const final { return "mymocktrack"; }198 bool enabled() const final { return true; }199 bool set_enabled(bool) final { return true; }200 TrackState state() const { return TrackState::kLive; }201 void RegisterObserver(webrtc::ObserverInterface*) final { }202 void UnregisterObserver(webrtc::ObserverInterface*) final { }203 };204 205 192 class MockRtpReceiver : public webrtc::RtpReceiverInterface { 206 193 private: … … 214 201 { 215 202 if (!m_track) 216 const_cast<MockRtpReceiver*>(this)->m_track = new rtc::RefCountedObject<Mock MediaStreamTrack>();203 const_cast<MockRtpReceiver*>(this)->m_track = new rtc::RefCountedObject<MockLibWebRTCVideoTrack>("", nullptr); 217 204 return m_track; 218 205 }
Note: See TracChangeset
for help on using the changeset viewer.