Remove MockRemoteBitrateObserver (unused)
BUG=None
Review-Url: https://codereview.webrtc.org/2731523002
Cr-Original-Commit-Position: refs/heads/master@{#17060}
Cr-Mirrored-From: https://chromium.googlesource.com/external/webrtc
Cr-Mirrored-Commit: fb1fa44d704e9f1dbec7408773c1b0d1a2398e02
diff --git a/audio/audio_send_stream_unittest.cc b/audio/audio_send_stream_unittest.cc
index b1a2401..1a838d8 100644
--- a/audio/audio_send_stream_unittest.cc
+++ b/audio/audio_send_stream_unittest.cc
@@ -21,7 +21,6 @@
#include "webrtc/modules/congestion_controller/include/congestion_controller.h"
#include "webrtc/modules/congestion_controller/include/mock/mock_congestion_controller.h"
#include "webrtc/modules/pacing/paced_sender.h"
-#include "webrtc/modules/remote_bitrate_estimator/include/mock/mock_remote_bitrate_estimator.h"
#include "webrtc/modules/rtp_rtcp/mocks/mock_rtcp_rtt_stats.h"
#include "webrtc/test/gtest.h"
#include "webrtc/test/mock_voe_channel_proxy.h"
@@ -75,7 +74,7 @@
stream_config_(nullptr),
congestion_controller_(&simulated_clock_,
&bitrate_observer_,
- &remote_bitrate_observer_,
+ nullptr,
&event_log_,
&packet_router_),
bitrate_allocator_(&limit_observer_),
@@ -248,7 +247,6 @@
AudioSendStream::Config stream_config_;
testing::StrictMock<MockVoEChannelProxy>* channel_proxy_ = nullptr;
testing::NiceMock<MockCongestionObserver> bitrate_observer_;
- testing::NiceMock<MockRemoteBitrateObserver> remote_bitrate_observer_;
MockAudioProcessing audio_processing_;
MockTransmitMixer transmit_mixer_;
AudioProcessing::AudioProcessingStatistics audio_processing_stats_;
diff --git a/modules/remote_bitrate_estimator/BUILD.gn b/modules/remote_bitrate_estimator/BUILD.gn
index adfa60c..f4c338a 100644
--- a/modules/remote_bitrate_estimator/BUILD.gn
+++ b/modules/remote_bitrate_estimator/BUILD.gn
@@ -146,7 +146,6 @@
testonly = true
sources = [
"aimd_rate_control_unittest.cc",
- "include/mock/mock_remote_bitrate_estimator.h",
"include/mock/mock_remote_bitrate_observer.h",
"inter_arrival_unittest.cc",
"overuse_detector_unittest.cc",
diff --git a/modules/remote_bitrate_estimator/include/mock/mock_remote_bitrate_estimator.h b/modules/remote_bitrate_estimator/include/mock/mock_remote_bitrate_estimator.h
deleted file mode 100644
index 8ef645b..0000000
--- a/modules/remote_bitrate_estimator/include/mock/mock_remote_bitrate_estimator.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
- *
- * Use of this source code is governed by a BSD-style license
- * that can be found in the LICENSE file in the root of the source
- * tree. An additional intellectual property rights grant can be found
- * in the file PATENTS. All contributing project authors may
- * be found in the AUTHORS file in the root of the source tree.
- */
-
-#ifndef WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_INCLUDE_MOCK_MOCK_REMOTE_BITRATE_ESTIMATOR_H_
-#define WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_INCLUDE_MOCK_MOCK_REMOTE_BITRATE_ESTIMATOR_H_
-
-#include <vector>
-
-#include "webrtc/modules/remote_bitrate_estimator/include/remote_bitrate_estimator.h"
-#include "webrtc/test/gmock.h"
-
-namespace webrtc {
-
-class MockRemoteBitrateObserver : public RemoteBitrateObserver {
- public:
- MOCK_METHOD2(OnReceiveBitrateChanged,
- void(const std::vector<uint32_t>& ssrcs, uint32_t bitrate));
-};
-
-class MockRemoteBitrateEstimator : public RemoteBitrateEstimator {
- public:
- MOCK_METHOD3(IncomingPacket, void(int64_t, size_t, const RTPHeader&));
- MOCK_METHOD1(RemoveStream, void(uint32_t));
- MOCK_CONST_METHOD2(LatestEstimate, bool(std::vector<uint32_t>*, uint32_t*));
-
- // From CallStatsObserver;
- MOCK_METHOD2(OnRttUpdate, void(int64_t, int64_t));
-
- // From Module.
- MOCK_METHOD0(TimeUntilNextProcess, int64_t());
- MOCK_METHOD0(Process, void());
- MOCK_METHOD1(SetMinBitrate, void(int));
-};
-
-} // namespace webrtc
-
-#endif // WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_INCLUDE_MOCK_MOCK_REMOTE_BITRATE_ESTIMATOR_H_
diff --git a/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.cc b/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.cc
index 094bf0d..7b4cc2b 100644
--- a/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.cc
+++ b/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.cc
@@ -57,7 +57,6 @@
last_process_time_(-1),
process_interval_ms_(kProcessIntervalMs),
uma_recorded_(false) {
- assert(observer_);
LOG(LS_INFO) << "RemoteBitrateEstimatorSingleStream: Instantiating.";
}
@@ -201,7 +200,8 @@
RTC_DCHECK_GT(process_interval_ms_, 0);
std::vector<uint32_t> ssrcs;
GetSsrcs(&ssrcs);
- observer_->OnReceiveBitrateChanged(ssrcs, target_bitrate);
+ if (observer_)
+ observer_->OnReceiveBitrateChanged(ssrcs, target_bitrate);
}
}
diff --git a/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.h b/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.h
index 31d7962..b893f56 100644
--- a/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.h
+++ b/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.h
@@ -56,12 +56,12 @@
// otherwise creates it.
AimdRateControl* GetRemoteRate() EXCLUSIVE_LOCKS_REQUIRED(crit_sect_.get());
- Clock* clock_;
+ Clock* const clock_;
SsrcOveruseEstimatorMap overuse_detectors_ GUARDED_BY(crit_sect_.get());
RateStatistics incoming_bitrate_ GUARDED_BY(crit_sect_.get());
uint32_t last_valid_incoming_bitrate_ GUARDED_BY(crit_sect_.get());
std::unique_ptr<AimdRateControl> remote_rate_ GUARDED_BY(crit_sect_.get());
- RemoteBitrateObserver* observer_ GUARDED_BY(crit_sect_.get());
+ RemoteBitrateObserver* const observer_ GUARDED_BY(crit_sect_.get());
std::unique_ptr<CriticalSectionWrapper> crit_sect_;
int64_t last_process_time_;
int64_t process_interval_ms_ GUARDED_BY(crit_sect_.get());