From 994ebb47024e7bf7e65039384a48a9854011d283 Mon Sep 17 00:00:00 2001 From: tommi Date: Fri, 17 Mar 2017 04:01:30 -0700 Subject: [PATCH] Provide default impl of TimeUntilNextProcess in MockRtpRtcp instead of mocking. This method isn't currently mocked or required by any test, so the safe thing is to return a reasonably large value from the implementation to avoid busy loops. BUG=webrtc:7187 TBR=mflodman@webrtc.org Review-Url: https://codereview.webrtc.org/2744233002 Cr-Commit-Position: refs/heads/master@{#17284} --- webrtc/modules/rtp_rtcp/mocks/mock_rtp_rtcp.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/webrtc/modules/rtp_rtcp/mocks/mock_rtp_rtcp.h b/webrtc/modules/rtp_rtcp/mocks/mock_rtp_rtcp.h index e8c6eac000..c9ea49d478 100644 --- a/webrtc/modules/rtp_rtcp/mocks/mock_rtp_rtcp.h +++ b/webrtc/modules/rtp_rtcp/mocks/mock_rtp_rtcp.h @@ -15,6 +15,7 @@ #include #include +#include "webrtc/base/checks.h" #include "webrtc/base/optional.h" #include "webrtc/modules/include/module.h" #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp.h" @@ -194,7 +195,6 @@ class MockRtpRtcp : public RtpRtcp { const FecProtectionParams& key_params)); MOCK_METHOD1(SetKeyFrameRequestMethod, int32_t(KeyFrameRequestMethod method)); MOCK_METHOD0(RequestKeyFrame, int32_t()); - MOCK_METHOD0(TimeUntilNextProcess, int64_t()); MOCK_METHOD0(Process, void()); MOCK_METHOD1(RegisterSendFrameCountObserver, void(FrameCountObserver*)); MOCK_CONST_METHOD0(GetSendFrameCountObserver, FrameCountObserver*(void)); @@ -205,6 +205,12 @@ class MockRtpRtcp : public RtpRtcp { MOCK_METHOD1(SetVideoBitrateAllocation, void(const BitrateAllocation&)); // Members. unsigned int remote_ssrc_; + + private: + // Mocking this method is currently not required and having a default + // implementation like MOCK_METHOD0(TimeUntilNextProcess, int64_t()) + // can be dangerous since it can cause a tight loop on a process thread. + virtual int64_t TimeUntilNextProcess() { return 0xffffffff; } }; } // namespace webrtc