Delete deprecated StartRtcEventLog override with PlatformFile
Bug: webrtc:6463
Change-Id: I57c2372a232d72b054d8e3e4f423e11b3fb22430
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/134460
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Reviewed-by: Elad Alon <eladalon@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28131}
diff --git a/pc/peer_connection.cc b/pc/peer_connection.cc
index d0698d8..dcb6c8a 100644
--- a/pc/peer_connection.cc
+++ b/pc/peer_connection.cc
@@ -54,7 +54,6 @@
#include "rtc_base/bind.h"
#include "rtc_base/checks.h"
#include "rtc_base/logging.h"
-#include "rtc_base/numerics/safe_conversions.h"
#include "rtc_base/string_encode.h"
#include "rtc_base/strings/string_builder.h"
#include "rtc_base/trace_event.h"
@@ -3756,21 +3755,6 @@
return nullptr;
}
-bool PeerConnection::StartRtcEventLog(rtc::PlatformFile file,
- int64_t max_size_bytes) {
- // TODO(eladalon): It would be better to not allow negative values into PC.
- const size_t max_size = (max_size_bytes < 0)
- ? RtcEventLog::kUnlimitedOutput
- : rtc::saturated_cast<size_t>(max_size_bytes);
- int64_t output_period_ms = webrtc::RtcEventLog::kImmediateOutput;
- if (field_trial::IsEnabled("WebRTC-RtcEventLogNewFormat")) {
- output_period_ms = 5000;
- }
- return StartRtcEventLog(
- absl::make_unique<RtcEventLogOutputFile>(file, max_size),
- output_period_ms);
-}
-
bool PeerConnection::StartRtcEventLog(std::unique_ptr<RtcEventLogOutput> output,
int64_t output_period_ms) {
// TODO(eladalon): In C++14, this can be done with a lambda.
@@ -3788,8 +3772,11 @@
bool PeerConnection::StartRtcEventLog(
std::unique_ptr<RtcEventLogOutput> output) {
- return StartRtcEventLog(std::move(output),
- webrtc::RtcEventLog::kImmediateOutput);
+ int64_t output_period_ms = webrtc::RtcEventLog::kImmediateOutput;
+ if (field_trial::IsEnabled("WebRTC-RtcEventLogNewFormat")) {
+ output_period_ms = 5000;
+ }
+ return StartRtcEventLog(std::move(output), output_period_ms);
}
void PeerConnection::StopRtcEventLog() {
diff --git a/pc/peer_connection.h b/pc/peer_connection.h
index 7287b7c..d2fb768 100644
--- a/pc/peer_connection.h
+++ b/pc/peer_connection.h
@@ -209,8 +209,6 @@
rtc::scoped_refptr<SctpTransportInterface> GetSctpTransport() const override;
- RTC_DEPRECATED bool StartRtcEventLog(rtc::PlatformFile file,
- int64_t max_size_bytes) override;
bool StartRtcEventLog(std::unique_ptr<RtcEventLogOutput> output,
int64_t output_period_ms) override;
bool StartRtcEventLog(std::unique_ptr<RtcEventLogOutput> output) override;
diff --git a/pc/peer_connection_interface_unittest.cc b/pc/peer_connection_interface_unittest.cc
index 9bf3306..4549912 100644
--- a/pc/peer_connection_interface_unittest.cc
+++ b/pc/peer_connection_interface_unittest.cc
@@ -3445,30 +3445,6 @@
// Tests that it won't crash when calling StartRtcEventLog or StopRtcEventLog
// after the PeerConnection is closed.
-// This version tests the StartRtcEventLog version that receives a file.
-TEST_P(PeerConnectionInterfaceTest,
- StartAndStopLoggingToFileAfterPeerConnectionClosed) {
- CreatePeerConnection();
- // The RtcEventLog will be reset when the PeerConnection is closed.
- pc_->Close();
-
- auto test_info = ::testing::UnitTest::GetInstance()->current_test_info();
- std::string filename = webrtc::test::OutputPath() +
- test_info->test_case_name() + test_info->name();
- rtc::PlatformFile file = rtc::CreatePlatformFile(filename);
-
- constexpr int64_t max_size_bytes = 1024;
-
- EXPECT_FALSE(pc_->StartRtcEventLog(file, max_size_bytes));
- pc_->StopRtcEventLog();
-
- // Cleanup.
- rtc::ClosePlatformFile(file);
- rtc::RemoveFile(filename);
-}
-
-// Tests that it won't crash when calling StartRtcEventLog or StopRtcEventLog
-// after the PeerConnection is closed.
// This version tests the StartRtcEventLog version that receives an object
// of type |RtcEventLogOutput|.
TEST_P(PeerConnectionInterfaceTest,
diff --git a/pc/test/fake_peer_connection_base.h b/pc/test/fake_peer_connection_base.h
index f67b305..67890cb 100644
--- a/pc/test/fake_peer_connection_base.h
+++ b/pc/test/fake_peer_connection_base.h
@@ -209,11 +209,6 @@
return IceGatheringState::kIceGatheringNew;
}
- bool StartRtcEventLog(rtc::PlatformFile file,
- int64_t max_size_bytes) override {
- return false;
- }
-
bool StartRtcEventLog(std::unique_ptr<RtcEventLogOutput> output,
int64_t output_period_ms) override {
return false;