diff --git a/p2p/BUILD.gn b/p2p/BUILD.gn index 9223f865b4..ec007b0440 100644 --- a/p2p/BUILD.gn +++ b/p2p/BUILD.gn @@ -64,8 +64,6 @@ rtc_static_library("rtc_p2p") { "base/tcpport.cc", "base/tcpport.h", "base/transport.h", - "base/transportcontroller.cc", - "base/transportcontroller.h", "base/transportdescription.cc", "base/transportdescription.h", "base/transportdescriptionfactory.cc", @@ -147,7 +145,6 @@ if (rtc_include_tests) { "base/fakeicetransport.h", "base/fakepackettransport.h", "base/fakeportallocator.h", - "base/faketransportcontroller.h", "base/mockicetransport.h", "base/testrelayserver.h", "base/teststunserver.h", @@ -189,7 +186,6 @@ if (rtc_include_tests) { "base/stunrequest_unittest.cc", "base/stunserver_unittest.cc", "base/tcpport_unittest.cc", - "base/transportcontroller_unittest.cc", "base/transportdescriptionfactory_unittest.cc", "base/turnport_unittest.cc", "base/turnserver_unittest.cc", diff --git a/pc/BUILD.gn b/pc/BUILD.gn index fa182fa811..cf0179ac45 100644 --- a/pc/BUILD.gn +++ b/pc/BUILD.gn @@ -55,6 +55,8 @@ rtc_static_library("rtc_pc_base") { "srtpsession.h", "srtptransport.cc", "srtptransport.h", + "transportcontroller.cc", + "transportcontroller.h", "voicechannel.h", ] @@ -269,6 +271,7 @@ if (rtc_include_tests) { "srtpsession_unittest.cc", "srtptestutil.h", "srtptransport_unittest.cc", + "transportcontroller_unittest.cc", ] include_dirs = [ "//third_party/libsrtp/srtp" ] @@ -286,6 +289,7 @@ if (rtc_include_tests) { deps = [ ":libjingle_peerconnection", + ":pc_test_utils", ":rtc_pc", "../api:array_view", "../logging:rtc_event_log_api", @@ -318,6 +322,7 @@ if (rtc_include_tests) { "test/fakedatachannelprovider.h", "test/fakeperiodicvideocapturer.h", "test/fakertccertificategenerator.h", + "test/faketransportcontroller.h", "test/fakevideotrackrenderer.h", "test/fakevideotracksource.h", "test/mock_datachannel.h", @@ -332,6 +337,7 @@ if (rtc_include_tests) { deps = [ ":libjingle_peerconnection", + ":rtc_pc_base", "..:webrtc_common", "../api:libjingle_peerconnection_test_api", "../api:rtc_stats_api", diff --git a/pc/channel.h b/pc/channel.h index 613597b990..d9b149cb87 100644 --- a/pc/channel.h +++ b/pc/channel.h @@ -27,13 +27,13 @@ #include "media/base/videosourceinterface.h" #include "p2p/base/dtlstransportinternal.h" #include "p2p/base/packettransportinternal.h" -#include "p2p/base/transportcontroller.h" #include "p2p/client/socketmonitor.h" #include "pc/audiomonitor.h" #include "pc/mediamonitor.h" #include "pc/mediasession.h" #include "pc/rtcpmuxfilter.h" #include "pc/srtpfilter.h" +#include "pc/transportcontroller.h" #include "rtc_base/asyncinvoker.h" #include "rtc_base/asyncudpsocket.h" #include "rtc_base/criticalsection.h" diff --git a/pc/channelmanager_unittest.cc b/pc/channelmanager_unittest.cc index 55fc7ff6c3..be83e99be6 100644 --- a/pc/channelmanager_unittest.cc +++ b/pc/channelmanager_unittest.cc @@ -15,8 +15,8 @@ #include "media/base/fakevideocapturer.h" #include "media/base/testutils.h" #include "media/engine/fakewebrtccall.h" -#include "p2p/base/faketransportcontroller.h" #include "pc/channelmanager.h" +#include "pc/test/faketransportcontroller.h" #include "rtc_base/gunit.h" #include "rtc_base/logging.h" #include "rtc_base/thread.h" diff --git a/pc/rtpsenderreceiver_unittest.cc b/pc/rtpsenderreceiver_unittest.cc index 5b0b59ec0a..f29b416cc5 100644 --- a/pc/rtpsenderreceiver_unittest.cc +++ b/pc/rtpsenderreceiver_unittest.cc @@ -14,7 +14,6 @@ #include "media/base/fakemediaengine.h" #include "media/engine/fakewebrtccall.h" -#include "p2p/base/faketransportcontroller.h" #include "pc/audiotrack.h" #include "pc/channelmanager.h" #include "pc/localaudiosource.h" @@ -23,6 +22,7 @@ #include "pc/rtpreceiver.h" #include "pc/rtpsender.h" #include "pc/streamcollection.h" +#include "pc/test/faketransportcontroller.h" #include "pc/test/fakevideotracksource.h" #include "pc/videotrack.h" #include "pc/videotracksource.h" diff --git a/p2p/base/faketransportcontroller.h b/pc/test/faketransportcontroller.h similarity index 97% rename from p2p/base/faketransportcontroller.h rename to pc/test/faketransportcontroller.h index f795ce8e70..e17956769f 100644 --- a/p2p/base/faketransportcontroller.h +++ b/pc/test/faketransportcontroller.h @@ -8,8 +8,8 @@ * be found in the AUTHORS file in the root of the source tree. */ -#ifndef P2P_BASE_FAKETRANSPORTCONTROLLER_H_ -#define P2P_BASE_FAKETRANSPORTCONTROLLER_H_ +#ifndef PC_TEST_FAKETRANSPORTCONTROLLER_H_ +#define PC_TEST_FAKETRANSPORTCONTROLLER_H_ #include #include @@ -17,7 +17,7 @@ #include "p2p/base/fakedtlstransport.h" #include "p2p/base/fakeicetransport.h" -#include "p2p/base/transportcontroller.h" +#include "pc/transportcontroller.h" #include "rtc_base/bind.h" #include "rtc_base/sslfingerprint.h" #include "rtc_base/thread.h" @@ -156,4 +156,4 @@ class FakeTransportController : public TransportController { } // namespace cricket -#endif // P2P_BASE_FAKETRANSPORTCONTROLLER_H_ +#endif // PC_TEST_FAKETRANSPORTCONTROLLER_H_ diff --git a/p2p/base/transportcontroller.cc b/pc/transportcontroller.cc similarity index 99% rename from p2p/base/transportcontroller.cc rename to pc/transportcontroller.cc index 12ea94fcd4..b7909ad0bf 100644 --- a/p2p/base/transportcontroller.cc +++ b/pc/transportcontroller.cc @@ -8,7 +8,7 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "p2p/base/transportcontroller.h" +#include "pc/transportcontroller.h" #include #include @@ -36,7 +36,7 @@ struct CandidatesData : public rtc::MessageData { cricket::Candidates candidates; }; -} // namespace { +} // namespace namespace cricket { @@ -840,9 +840,8 @@ void TransportController::UpdateAggregateStates_n() { bool all_done_gathering = !channels_.empty(); for (const auto& channel : channels_) { any_receiving = any_receiving || channel->dtls()->receiving(); - any_failed = any_failed || - channel->dtls()->ice_transport()->GetState() == - IceTransportState::STATE_FAILED; + any_failed = any_failed || channel->dtls()->ice_transport()->GetState() == + IceTransportState::STATE_FAILED; all_connected = all_connected && channel->dtls()->writable(); all_completed = all_completed && channel->dtls()->writable() && diff --git a/p2p/base/transportcontroller.h b/pc/transportcontroller.h similarity index 98% rename from p2p/base/transportcontroller.h rename to pc/transportcontroller.h index b7c38f3a07..f8cfc0c2ef 100644 --- a/p2p/base/transportcontroller.h +++ b/pc/transportcontroller.h @@ -8,8 +8,8 @@ * be found in the AUTHORS file in the root of the source tree. */ -#ifndef P2P_BASE_TRANSPORTCONTROLLER_H_ -#define P2P_BASE_TRANSPORTCONTROLLER_H_ +#ifndef PC_TRANSPORTCONTROLLER_H_ +#define PC_TRANSPORTCONTROLLER_H_ #include #include @@ -29,10 +29,11 @@ namespace rtc { class Thread; class PacketTransportInternal; -} +} // namespace rtc + namespace webrtc { class MetricsObserverInterface; -} +} // namespace webrtc namespace cricket { @@ -276,4 +277,4 @@ class TransportController : public sigslot::has_slots<>, } // namespace cricket -#endif // P2P_BASE_TRANSPORTCONTROLLER_H_ +#endif // PC_TRANSPORTCONTROLLER_H_ diff --git a/p2p/base/transportcontroller_unittest.cc b/pc/transportcontroller_unittest.cc similarity index 99% rename from p2p/base/transportcontroller_unittest.cc rename to pc/transportcontroller_unittest.cc index 2c70a84bd2..32dc1b1496 100644 --- a/p2p/base/transportcontroller_unittest.cc +++ b/pc/transportcontroller_unittest.cc @@ -13,10 +13,10 @@ #include "p2p/base/dtlstransport.h" #include "p2p/base/fakeportallocator.h" -#include "p2p/base/faketransportcontroller.h" #include "p2p/base/p2ptransportchannel.h" #include "p2p/base/portallocator.h" -#include "p2p/base/transportcontroller.h" +#include "pc/test/faketransportcontroller.h" +#include "pc/transportcontroller.h" #include "rtc_base/fakesslidentity.h" #include "rtc_base/gunit.h" #include "rtc_base/helpers.h" @@ -906,4 +906,4 @@ TEST_F(TransportControllerTest, NeedsIceRestart) { EXPECT_TRUE(transport_controller_->NeedsIceRestart("video")); } -} // namespace cricket { +} // namespace cricket diff --git a/pc/webrtcsession.h b/pc/webrtcsession.h index 7e8d5e4779..44b64b8a36 100644 --- a/pc/webrtcsession.h +++ b/pc/webrtcsession.h @@ -21,9 +21,9 @@ #include "api/statstypes.h" #include "call/call.h" #include "p2p/base/candidate.h" -#include "p2p/base/transportcontroller.h" #include "pc/datachannel.h" #include "pc/mediasession.h" +#include "pc/transportcontroller.h" #include "rtc_base/constructormagic.h" #include "rtc_base/sigslot.h" #include "rtc_base/sslidentity.h"