diff --git a/api/peer_connection_interface.cc b/api/peer_connection_interface.cc index 9368fe98c6..78e3fc06fb 100644 --- a/api/peer_connection_interface.cc +++ b/api/peer_connection_interface.cc @@ -129,12 +129,6 @@ PeerConnectionInterface::GetConfiguration() { return PeerConnectionInterface::RTCConfiguration(); } -bool PeerConnectionInterface::SetConfiguration( - const PeerConnectionInterface::RTCConfiguration& config, - RTCError* error) { - return false; -} - RTCError PeerConnectionInterface::SetConfiguration( const PeerConnectionInterface::RTCConfiguration& config) { return RTCError(); diff --git a/api/peer_connection_interface.h b/api/peer_connection_interface.h index 2d5e314c9c..124d12ad8c 100644 --- a/api/peer_connection_interface.h +++ b/api/peer_connection_interface.h @@ -1008,12 +1008,6 @@ class RTC_EXPORT PeerConnectionInterface : public rtc::RefCountInterface { // - INVALID_PARAMETER if a TURN server is missing |username| or |password|. // - INTERNAL_ERROR if an unexpected error occurred. // - // TODO(nisse): Deprecated, migrate to the method with an RTCError return - // value, then delete this one. - virtual bool SetConfiguration( - const PeerConnectionInterface::RTCConfiguration& config, - RTCError* error); - // TODO(nisse): Make this pure virtual once all Chrome subclasses of // PeerConnectionInterface implement it. virtual RTCError SetConfiguration( diff --git a/api/peer_connection_proxy.h b/api/peer_connection_proxy.h index f7651dcfc7..e88190647e 100644 --- a/api/peer_connection_proxy.h +++ b/api/peer_connection_proxy.h @@ -108,10 +108,6 @@ PROXY_METHOD2(void, std::unique_ptr, rtc::scoped_refptr) PROXY_METHOD0(PeerConnectionInterface::RTCConfiguration, GetConfiguration) -PROXY_METHOD2(bool, - SetConfiguration, - const PeerConnectionInterface::RTCConfiguration&, - RTCError*) PROXY_METHOD1(RTCError, SetConfiguration, const PeerConnectionInterface::RTCConfiguration&) diff --git a/api/test/mock_peerconnectioninterface.h b/api/test/mock_peerconnectioninterface.h index 1b75cdea55..80a5baa474 100644 --- a/api/test/mock_peerconnectioninterface.h +++ b/api/test/mock_peerconnectioninterface.h @@ -107,9 +107,6 @@ class MockPeerConnectionInterface void(std::unique_ptr, rtc::scoped_refptr)); MOCK_METHOD0(GetConfiguration, PeerConnectionInterface::RTCConfiguration()); - MOCK_METHOD2(SetConfiguration, - bool(const PeerConnectionInterface::RTCConfiguration&, - RTCError*)); MOCK_METHOD1(SetConfiguration, RTCError(const PeerConnectionInterface::RTCConfiguration&)); MOCK_METHOD1(AddIceCandidate, bool(const IceCandidateInterface*)); diff --git a/pc/peer_connection.cc b/pc/peer_connection.cc index 96fdd6c788..47825dc98b 100644 --- a/pc/peer_connection.cc +++ b/pc/peer_connection.cc @@ -3490,16 +3490,6 @@ PeerConnectionInterface::RTCConfiguration PeerConnection::GetConfiguration() { return configuration_; } -bool PeerConnection::SetConfiguration(const RTCConfiguration& configuration, - RTCError* error) { - RTCError result = SetConfiguration(configuration); - bool success = result.ok(); - if (error) { - *error = std::move(result); - } - return success; -} - RTCError PeerConnection::SetConfiguration( const RTCConfiguration& configuration) { RTC_DCHECK_RUN_ON(signaling_thread()); diff --git a/pc/peer_connection.h b/pc/peer_connection.h index 3328a921ef..550a9ee449 100644 --- a/pc/peer_connection.h +++ b/pc/peer_connection.h @@ -209,9 +209,6 @@ class PeerConnection : public PeerConnectionInternal, rtc::scoped_refptr observer) override; PeerConnectionInterface::RTCConfiguration GetConfiguration() override; - bool SetConfiguration( - const PeerConnectionInterface::RTCConfiguration& configuration, - RTCError* error) override; RTCError SetConfiguration( const PeerConnectionInterface::RTCConfiguration& configuration) override; bool AddIceCandidate(const IceCandidateInterface* candidate) override; diff --git a/pc/peer_connection_end_to_end_unittest.cc b/pc/peer_connection_end_to_end_unittest.cc index 4cd59c8b2e..d9feb7d022 100644 --- a/pc/peer_connection_end_to_end_unittest.cc +++ b/pc/peer_connection_end_to_end_unittest.cc @@ -759,8 +759,7 @@ TEST_P(PeerConnectionEndToEndTest, CanRestartIce) { auto config = caller_->pc()->GetConfiguration(); ASSERT_NE(PeerConnectionInterface::kRelay, config.type); config.type = PeerConnectionInterface::kRelay; - webrtc::RTCError error; - ASSERT_TRUE(caller_->pc()->SetConfiguration(config, &error)); + ASSERT_TRUE(caller_->pc()->SetConfiguration(config).ok()); // When solving https://crbug.com/webrtc/10504, all we need to check // is that we do not crash. We should also be testing that restart happens. } diff --git a/pc/peer_connection_interface_unittest.cc b/pc/peer_connection_interface_unittest.cc index f389787a26..f9c40c2f8d 100644 --- a/pc/peer_connection_interface_unittest.cc +++ b/pc/peer_connection_interface_unittest.cc @@ -2639,8 +2639,8 @@ TEST_P(PeerConnectionInterfaceTest, bad_server.username = "foo"; config.servers.push_back(bad_server); RTCError error; - EXPECT_FALSE(pc_->SetConfiguration(config, &error)); - EXPECT_EQ(RTCErrorType::INVALID_PARAMETER, error.type()); + EXPECT_EQ(pc_->SetConfiguration(config).type(), + RTCErrorType::INVALID_PARAMETER); } // Test that PeerConnection::Close changes the states to closed and all remote diff --git a/pc/test/fake_peer_connection_base.h b/pc/test/fake_peer_connection_base.h index 6cab901893..55c162fc5e 100644 --- a/pc/test/fake_peer_connection_base.h +++ b/pc/test/fake_peer_connection_base.h @@ -165,11 +165,6 @@ class FakePeerConnectionBase : public PeerConnectionInternal { RTCConfiguration GetConfiguration() override { return RTCConfiguration(); } - bool SetConfiguration(const PeerConnectionInterface::RTCConfiguration& config, - RTCError* error) override { - return false; - } - RTCError SetConfiguration( const PeerConnectionInterface::RTCConfiguration& config) override { return RTCError();