Skip to content
This repository was archived by the owner on Oct 25, 2024. It is now read-only.

Commit b298f74

Browse files
Sam ZackrissonCommit Bot
authored andcommitted
Revert "Replace sigslot usages with robocaller library."
This reverts commit 40261c3. Reason for revert: Breaks downstream project Original change's description: > Replace sigslot usages with robocaller library. > > - Replace all the top level signals from jsep_transport_controller. > - There are still sigslot usages in this file so keep the inheritance > and that is the reason for not having a binary size gain in this CL. > > Bug: webrtc:11943 > Change-Id: I249d3b9710783aef70ba273e082ceeafe3056898 > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/185540 > Commit-Queue: Lahiru Ginnaliya Gamathige <[email protected]> > Reviewed-by: Mirko Bonadei <[email protected]> > Reviewed-by: Karl Wiberg <[email protected]> > Cr-Commit-Position: refs/heads/master@{#32321} [email protected],[email protected],[email protected] Change-Id: Icf438f87c3d95940d858db3cc5848b23abb82fc4 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:11943 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186844 Reviewed-by: Sam Zackrisson <[email protected]> Commit-Queue: Sam Zackrisson <[email protected]> Cr-Commit-Position: refs/heads/master@{#32324}
1 parent fa29279 commit b298f74

11 files changed

+60
-103
lines changed

p2p/BUILD.gn

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ rtc_library("rtc_p2p") {
9797
"../logging:ice_log",
9898
"../rtc_base",
9999
"../rtc_base:checks",
100-
"../rtc_base:robo_caller",
101100
"../rtc_base:rtc_numerics",
102101
"../rtc_base/experiments:field_trial_parser",
103102
"../rtc_base/synchronization:sequence_checker",

p2p/base/dtls_transport.cc

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
#include "rtc_base/checks.h"
2424
#include "rtc_base/dscp.h"
2525
#include "rtc_base/logging.h"
26-
#include "rtc_base/robo_caller.h"
2726
#include "rtc_base/rtc_certificate.h"
2827
#include "rtc_base/ssl_stream_adapter.h"
2928
#include "rtc_base/stream.h"
@@ -359,8 +358,8 @@ bool DtlsTransport::SetupDtls() {
359358
dtls_->SetMaxProtocolVersion(ssl_max_version_);
360359
dtls_->SetServerRole(*dtls_role_);
361360
dtls_->SignalEvent.connect(this, &DtlsTransport::OnDtlsEvent);
362-
dtls_->SignalSSLHandshakeError.AddReceiver(
363-
[this](rtc::SSLHandshakeError e) { OnDtlsHandshakeError(e); });
361+
dtls_->SignalSSLHandshakeError.connect(this,
362+
&DtlsTransport::OnDtlsHandshakeError);
364363
if (remote_fingerprint_value_.size() &&
365364
!dtls_->SetPeerCertificateDigest(
366365
remote_fingerprint_algorithm_,
@@ -821,7 +820,7 @@ void DtlsTransport::set_dtls_state(DtlsTransportState state) {
821820
}
822821

823822
void DtlsTransport::OnDtlsHandshakeError(rtc::SSLHandshakeError error) {
824-
SignalDtlsHandshakeError.Send(error);
823+
SignalDtlsHandshakeError(error);
825824
}
826825

827826
void DtlsTransport::ConfigureHandshakeTimeout() {

p2p/base/dtls_transport_internal.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
#include "p2p/base/ice_transport_internal.h"
2424
#include "p2p/base/packet_transport_internal.h"
2525
#include "rtc_base/constructor_magic.h"
26-
#include "rtc_base/robo_caller.h"
2726
#include "rtc_base/ssl_certificate.h"
2827
#include "rtc_base/ssl_fingerprint.h"
2928
#include "rtc_base/ssl_stream_adapter.h"
@@ -116,7 +115,7 @@ class DtlsTransportInternal : public rtc::PacketTransportInternal {
116115
sigslot::signal2<DtlsTransportInternal*, DtlsTransportState> SignalDtlsState;
117116

118117
// Emitted whenever the Dtls handshake failed on some transport channel.
119-
webrtc::RoboCaller<rtc::SSLHandshakeError> SignalDtlsHandshakeError;
118+
sigslot::signal1<rtc::SSLHandshakeError> SignalDtlsHandshakeError;
120119

121120
protected:
122121
DtlsTransportInternal();

pc/jsep_transport_controller.cc

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -462,8 +462,8 @@ JsepTransportController::CreateDtlsTransport(
462462
this, &JsepTransportController::OnTransportWritableState_n);
463463
dtls->SignalReceivingState.connect(
464464
this, &JsepTransportController::OnTransportReceivingState_n);
465-
dtls->SignalDtlsHandshakeError.AddReceiver(
466-
[this](rtc::SSLHandshakeError error) { OnDtlsHandshakeError(error); });
465+
dtls->SignalDtlsHandshakeError.connect(
466+
this, &JsepTransportController::OnDtlsHandshakeError);
467467
dtls->ice_transport()->SignalGatheringState.connect(
468468
this, &JsepTransportController::OnTransportGatheringState_n);
469469
dtls->ice_transport()->SignalCandidateGathered.connect(
@@ -1154,8 +1154,7 @@ void JsepTransportController::OnTransportCandidateGathered_n(
11541154
std::string transport_name = transport->transport_name();
11551155
invoker_.AsyncInvoke<void>(
11561156
RTC_FROM_HERE, signaling_thread_, [this, transport_name, candidate] {
1157-
SignalIceCandidatesGathered.Send(
1158-
transport_name, std::vector<cricket::Candidate>{candidate});
1157+
SignalIceCandidatesGathered(transport_name, {candidate});
11591158
});
11601159
}
11611160

@@ -1164,21 +1163,20 @@ void JsepTransportController::OnTransportCandidateError_n(
11641163
const cricket::IceCandidateErrorEvent& event) {
11651164
RTC_DCHECK(network_thread_->IsCurrent());
11661165

1167-
invoker_.AsyncInvoke<void>(RTC_FROM_HERE, signaling_thread_, [this, event] {
1168-
SignalIceCandidateError.Send(event);
1169-
});
1166+
invoker_.AsyncInvoke<void>(RTC_FROM_HERE, signaling_thread_,
1167+
[this, event] { SignalIceCandidateError(event); });
11701168
}
11711169
void JsepTransportController::OnTransportCandidatesRemoved_n(
11721170
cricket::IceTransportInternal* transport,
11731171
const cricket::Candidates& candidates) {
11741172
invoker_.AsyncInvoke<void>(
11751173
RTC_FROM_HERE, signaling_thread_,
1176-
[this, candidates] { SignalIceCandidatesRemoved.Send(candidates); });
1174+
[this, candidates] { SignalIceCandidatesRemoved(candidates); });
11771175
}
11781176
void JsepTransportController::OnTransportCandidatePairChanged_n(
11791177
const cricket::CandidatePairChangeEvent& event) {
11801178
invoker_.AsyncInvoke<void>(RTC_FROM_HERE, signaling_thread_, [this, event] {
1181-
SignalIceCandidatePairChanged.Send(event);
1179+
SignalIceCandidatePairChanged(event);
11821180
});
11831181
}
11841182

@@ -1319,14 +1317,14 @@ void JsepTransportController::UpdateAggregateStates_n() {
13191317
PeerConnectionInterface::kIceConnectionCompleted) {
13201318
// Ensure that we never skip over the "connected" state.
13211319
invoker_.AsyncInvoke<void>(RTC_FROM_HERE, signaling_thread_, [this] {
1322-
SignalStandardizedIceConnectionState.Send(
1320+
SignalStandardizedIceConnectionState(
13231321
PeerConnectionInterface::kIceConnectionConnected);
13241322
});
13251323
}
13261324
standardized_ice_connection_state_ = new_ice_connection_state;
13271325
invoker_.AsyncInvoke<void>(
13281326
RTC_FROM_HERE, signaling_thread_, [this, new_ice_connection_state] {
1329-
SignalStandardizedIceConnectionState.Send(new_ice_connection_state);
1327+
SignalStandardizedIceConnectionState(new_ice_connection_state);
13301328
});
13311329
}
13321330

@@ -1380,7 +1378,7 @@ void JsepTransportController::UpdateAggregateStates_n() {
13801378
combined_connection_state_ = new_combined_state;
13811379
invoker_.AsyncInvoke<void>(RTC_FROM_HERE, signaling_thread_,
13821380
[this, new_combined_state] {
1383-
SignalConnectionState.Send(new_combined_state);
1381+
SignalConnectionState(new_combined_state);
13841382
});
13851383
}
13861384

@@ -1394,10 +1392,10 @@ void JsepTransportController::UpdateAggregateStates_n() {
13941392
}
13951393
if (ice_gathering_state_ != new_gathering_state) {
13961394
ice_gathering_state_ = new_gathering_state;
1397-
invoker_.AsyncInvoke<void>(
1398-
RTC_FROM_HERE, signaling_thread_, [this, new_gathering_state] {
1399-
SignalIceGatheringState.Send(new_gathering_state);
1400-
});
1395+
invoker_.AsyncInvoke<void>(RTC_FROM_HERE, signaling_thread_,
1396+
[this, new_gathering_state] {
1397+
SignalIceGatheringState(new_gathering_state);
1398+
});
14011399
}
14021400
}
14031401

@@ -1410,7 +1408,7 @@ void JsepTransportController::OnRtcpPacketReceived_n(
14101408

14111409
void JsepTransportController::OnDtlsHandshakeError(
14121410
rtc::SSLHandshakeError error) {
1413-
SignalDtlsHandshakeError.Send(error);
1411+
SignalDtlsHandshakeError(error);
14141412
}
14151413

14161414
} // namespace webrtc

pc/jsep_transport_controller.h

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -200,29 +200,31 @@ class JsepTransportController : public sigslot::has_slots<> {
200200
// Else => connecting
201201
RoboCaller<cricket::IceConnectionState> SignalIceConnectionState;
202202

203-
RoboCaller<PeerConnectionInterface::PeerConnectionState>
203+
sigslot::signal1<PeerConnectionInterface::PeerConnectionState>
204204
SignalConnectionState;
205205

206-
RoboCaller<PeerConnectionInterface::IceConnectionState>
206+
sigslot::signal1<PeerConnectionInterface::IceConnectionState>
207207
SignalStandardizedIceConnectionState;
208208

209209
// If all transports done gathering => complete,
210210
// Else if any are gathering => gathering,
211211
// Else => new
212-
RoboCaller<cricket::IceGatheringState> SignalIceGatheringState;
212+
sigslot::signal1<cricket::IceGatheringState> SignalIceGatheringState;
213213

214-
// [mid, candidates]
215-
RoboCaller<const std::string&, const std::vector<cricket::Candidate>&>
214+
// (mid, candidates)
215+
sigslot::signal2<const std::string&, const std::vector<cricket::Candidate>&>
216216
SignalIceCandidatesGathered;
217217

218-
RoboCaller<const cricket::IceCandidateErrorEvent&> SignalIceCandidateError;
218+
sigslot::signal1<const cricket::IceCandidateErrorEvent&>
219+
SignalIceCandidateError;
219220

220-
RoboCaller<const std::vector<cricket::Candidate>&> SignalIceCandidatesRemoved;
221+
sigslot::signal1<const std::vector<cricket::Candidate>&>
222+
SignalIceCandidatesRemoved;
221223

222-
RoboCaller<const cricket::CandidatePairChangeEvent&>
224+
sigslot::signal1<const cricket::CandidatePairChangeEvent&>
223225
SignalIceCandidatePairChanged;
224226

225-
RoboCaller<rtc::SSLHandshakeError> SignalDtlsHandshakeError;
227+
sigslot::signal1<rtc::SSLHandshakeError> SignalDtlsHandshakeError;
226228

227229
private:
228230
RTCError ApplyDescription_n(bool local,

pc/jsep_transport_controller_unittest.cc

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -93,24 +93,14 @@ class JsepTransportControllerTest : public JsepTransportController::Observer,
9393
[this](cricket::IceConnectionState s) {
9494
JsepTransportControllerTest::OnConnectionState(s);
9595
});
96-
transport_controller_->SignalConnectionState.AddReceiver(
97-
[this](PeerConnectionInterface::PeerConnectionState s) {
98-
JsepTransportControllerTest::OnCombinedConnectionState(s);
99-
});
100-
transport_controller_->SignalStandardizedIceConnectionState.AddReceiver(
101-
[this](PeerConnectionInterface::IceConnectionState s) {
102-
JsepTransportControllerTest::OnStandardizedIceConnectionState(s);
103-
});
104-
transport_controller_->SignalIceGatheringState.AddReceiver(
105-
[this](cricket::IceGatheringState s) {
106-
JsepTransportControllerTest::OnGatheringState(s);
107-
});
108-
transport_controller_->SignalIceCandidatesGathered.AddReceiver(
109-
[this](const std::string& transport,
110-
const std::vector<cricket::Candidate>& candidates) {
111-
JsepTransportControllerTest::OnCandidatesGathered(transport,
112-
candidates);
113-
});
96+
transport_controller_->SignalStandardizedIceConnectionState.connect(
97+
this, &JsepTransportControllerTest::OnStandardizedIceConnectionState);
98+
transport_controller_->SignalConnectionState.connect(
99+
this, &JsepTransportControllerTest::OnCombinedConnectionState);
100+
transport_controller_->SignalIceGatheringState.connect(
101+
this, &JsepTransportControllerTest::OnGatheringState);
102+
transport_controller_->SignalIceCandidatesGathered.connect(
103+
this, &JsepTransportControllerTest::OnCandidatesGathered);
114104
}
115105

116106
std::unique_ptr<cricket::SessionDescription>

pc/peer_connection.cc

Lines changed: 17 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -545,52 +545,28 @@ bool PeerConnection::Initialize(
545545
transport_controller_.reset(new JsepTransportController(
546546
signaling_thread(), network_thread(), port_allocator_.get(),
547547
async_resolver_factory_.get(), config));
548+
transport_controller_->SignalStandardizedIceConnectionState.connect(
549+
this, &PeerConnection::SetStandardizedIceConnectionState);
550+
transport_controller_->SignalConnectionState.connect(
551+
this, &PeerConnection::SetConnectionState);
552+
transport_controller_->SignalIceGatheringState.connect(
553+
this, &PeerConnection::OnTransportControllerGatheringState);
554+
transport_controller_->SignalIceCandidatesGathered.connect(
555+
this, &PeerConnection::OnTransportControllerCandidatesGathered);
556+
transport_controller_->SignalIceCandidateError.connect(
557+
this, &PeerConnection::OnTransportControllerCandidateError);
558+
transport_controller_->SignalIceCandidatesRemoved.connect(
559+
this, &PeerConnection::OnTransportControllerCandidatesRemoved);
560+
transport_controller_->SignalDtlsHandshakeError.connect(
561+
this, &PeerConnection::OnTransportControllerDtlsHandshakeError);
562+
transport_controller_->SignalIceCandidatePairChanged.connect(
563+
this, &PeerConnection::OnTransportControllerCandidateChanged);
564+
548565
transport_controller_->SignalIceConnectionState.AddReceiver(
549566
[this](cricket::IceConnectionState s) {
550567
RTC_DCHECK_RUN_ON(signaling_thread());
551568
OnTransportControllerConnectionState(s);
552569
});
553-
transport_controller_->SignalConnectionState.AddReceiver(
554-
[this](PeerConnectionInterface::PeerConnectionState s) {
555-
RTC_DCHECK_RUN_ON(signaling_thread());
556-
SetConnectionState(s);
557-
});
558-
transport_controller_->SignalStandardizedIceConnectionState.AddReceiver(
559-
[this](PeerConnectionInterface::IceConnectionState s) {
560-
RTC_DCHECK_RUN_ON(signaling_thread());
561-
SetStandardizedIceConnectionState(s);
562-
});
563-
transport_controller_->SignalIceGatheringState.AddReceiver(
564-
[this](cricket::IceGatheringState s) {
565-
RTC_DCHECK_RUN_ON(signaling_thread());
566-
OnTransportControllerGatheringState(s);
567-
});
568-
transport_controller_->SignalIceCandidatesGathered.AddReceiver(
569-
[this](const std::string& transport,
570-
const std::vector<cricket::Candidate>& candidates) {
571-
RTC_DCHECK_RUN_ON(signaling_thread());
572-
OnTransportControllerCandidatesGathered(transport, candidates);
573-
});
574-
transport_controller_->SignalIceCandidateError.AddReceiver(
575-
[this](const cricket::IceCandidateErrorEvent& event) {
576-
RTC_DCHECK_RUN_ON(signaling_thread());
577-
OnTransportControllerCandidateError(event);
578-
});
579-
transport_controller_->SignalIceCandidatesRemoved.AddReceiver(
580-
[this](const std::vector<cricket::Candidate>& c) {
581-
RTC_DCHECK_RUN_ON(signaling_thread());
582-
OnTransportControllerCandidatesRemoved(c);
583-
});
584-
transport_controller_->SignalIceCandidatePairChanged.AddReceiver(
585-
[this](const cricket::CandidatePairChangeEvent& event) {
586-
RTC_DCHECK_RUN_ON(signaling_thread());
587-
OnTransportControllerCandidateChanged(event);
588-
});
589-
transport_controller_->SignalDtlsHandshakeError.AddReceiver(
590-
[this](rtc::SSLHandshakeError event) {
591-
RTC_DCHECK_RUN_ON(signaling_thread());
592-
OnTransportControllerDtlsHandshakeError(event);
593-
});
594570

595571
stats_.reset(new StatsCollector(this));
596572
stats_collector_ = RTCStatsCollector::Create(this);

rtc_base/BUILD.gn

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -819,7 +819,6 @@ rtc_library("rtc_base") {
819819
deps = [
820820
":checks",
821821
":deprecation",
822-
":robo_caller",
823822
":rtc_task_queue",
824823
":stringutils",
825824
"../api:array_view",

rtc_base/openssl_stream_adapter.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
#include "rtc_base/openssl_adapter.h"
3434
#include "rtc_base/openssl_digest.h"
3535
#include "rtc_base/openssl_identity.h"
36-
#include "rtc_base/robo_caller.h"
3736
#include "rtc_base/ssl_certificate.h"
3837
#include "rtc_base/stream.h"
3938
#include "rtc_base/task_utils/to_queued_task.h"
@@ -931,7 +930,7 @@ int OpenSSLStreamAdapter::ContinueSSL() {
931930
}
932931
RTC_DLOG(LS_VERBOSE) << " -- error " << code << ", " << err_code << ", "
933932
<< ERR_GET_REASON(err_code);
934-
SignalSSLHandshakeError.Send(ssl_handshake_err);
933+
SignalSSLHandshakeError(ssl_handshake_err);
935934
return (ssl_error != 0) ? ssl_error : -1;
936935
}
937936

rtc_base/ssl_stream_adapter.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919

2020
#include "absl/memory/memory.h"
2121
#include "rtc_base/deprecation.h"
22-
#include "rtc_base/robo_caller.h"
2322
#include "rtc_base/ssl_certificate.h"
2423
#include "rtc_base/ssl_identity.h"
2524
#include "rtc_base/stream.h"
25+
#include "rtc_base/third_party/sigslot/sigslot.h"
2626

2727
namespace rtc {
2828

@@ -268,7 +268,7 @@ class SSLStreamAdapter : public StreamAdapterInterface {
268268
// authentication.
269269
bool GetClientAuthEnabled() const { return client_auth_enabled_; }
270270

271-
webrtc::RoboCaller<SSLHandshakeError> SignalSSLHandshakeError;
271+
sigslot::signal1<SSLHandshakeError> SignalSSLHandshakeError;
272272

273273
private:
274274
// If true (default), the client is required to provide a certificate during

0 commit comments

Comments
 (0)