Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(98)

Unified Diff: webrtc/p2p/base/transportcontroller.cc

Issue 1648813004: Remove candidates when doing continual gathering (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/p2p/base/transportcontroller.cc
diff --git a/webrtc/p2p/base/transportcontroller.cc b/webrtc/p2p/base/transportcontroller.cc
index 053388eeb8130d30fec9a6fb5a21e94ec54a8b0a..d535f9214520a80bae104d5460dca5df11c466ac 100644
--- a/webrtc/p2p/base/transportcontroller.cc
+++ b/webrtc/p2p/base/transportcontroller.cc
@@ -127,6 +127,15 @@ bool TransportController::AddRemoteCandidates(const std::string& transport_name,
transport_name, candidates, err));
}
+bool TransportController::RemoveRemoteCandidates(
+ const std::string& transport_name,
+ const Candidates& candidates,
+ std::string* err) {
+ return worker_thread_->Invoke<bool>(
+ rtc::Bind(&TransportController::RemoveRemoteCandidates_w, this,
+ transport_name, candidates, err));
+}
+
bool TransportController::ReadyForRemoteCandidates(
const std::string& transport_name) {
return worker_thread_->Invoke<bool>(rtc::Bind(
@@ -162,6 +171,8 @@ TransportChannel* TransportController::CreateTransportChannel_w(
this, &TransportController::OnChannelGatheringState_w);
channel->SignalCandidateGathered.connect(
this, &TransportController::OnChannelCandidateGathered_w);
+ channel->SignalCandidatesRemoved.connect(
+ this, &TransportController::OnChannelCandidatesRemoved_w);
channel->SignalRoleConflict.connect(
this, &TransportController::OnChannelRoleConflict_w);
channel->SignalConnectionRemoved.connect(
@@ -460,6 +471,22 @@ bool TransportController::AddRemoteCandidates_w(
return transport->AddRemoteCandidates(candidates, err);
}
+bool TransportController::RemoveRemoteCandidates_w(
+ const std::string& transport_name,
+ const Candidates& candidates,
+ std::string* err) {
+ RTC_DCHECK(worker_thread()->IsCurrent());
+
+ Transport* transport = GetTransport_w(transport_name);
+ if (!transport) {
+ // If we didn't find a transport, that's not an error;
+ // it could have been deleted as a result of bundling.
+ return true;
+ }
+
+ return transport->RemoveRemoteCandidates(candidates, err);
+}
+
bool TransportController::ReadyForRemoteCandidates_w(
const std::string& transport_name) {
RTC_DCHECK(worker_thread()->IsCurrent());
@@ -518,6 +545,22 @@ void TransportController::OnChannelCandidateGathered_w(
signaling_thread_->Post(this, MSG_CANDIDATESGATHERED, data);
}
+void TransportController::OnChannelCandidatesRemoved_w(
+ TransportChannelImpl* channel,
+ const Candidates& candidates) {
+ invoker_.AsyncInvoke<void>(
+ signaling_thread_,
+ rtc::Bind(&TransportController::OnChannelCandidatesRemoved, this,
+ channel->transport_name(), candidates));
+}
+
+void TransportController::OnChannelCandidatesRemoved(
+ const std::string& transport_name,
+ const Candidates& candidates) {
+ RTC_DCHECK(signaling_thread_->IsCurrent());
+ SignalCandidatesRemoved(transport_name, candidates);
+}
+
void TransportController::OnChannelRoleConflict_w(
TransportChannelImpl* channel) {
RTC_DCHECK(worker_thread_->IsCurrent());
« webrtc/p2p/base/dtlstransportchannel.h ('K') | « webrtc/p2p/base/transportcontroller.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698