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

Unified Diff: webrtc/p2p/base/faketransportcontroller.h

Issue 2099563004: Start ICE connectivity checks as soon as the first pair is pingable. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Start pinging when we first have a connection AND ICE credentials. Created 4 years, 6 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/faketransportcontroller.h
diff --git a/webrtc/p2p/base/faketransportcontroller.h b/webrtc/p2p/base/faketransportcontroller.h
index 59b618a0030c84fdbbeece9483f6a4e7bc68a8ea..457ddb5f20e0d31eca10862e8e58d9695850eac1 100644
--- a/webrtc/p2p/base/faketransportcontroller.h
+++ b/webrtc/p2p/base/faketransportcontroller.h
@@ -111,12 +111,6 @@ class FakeTransportChannel : public TransportChannelImpl,
return true;
}
- void Connect() override {
- if (state_ == STATE_INIT) {
- state_ = STATE_CONNECTING;
- }
- }
-
void MaybeStartGathering() override {
if (gathering_state_ == kIceGatheringNew) {
gathering_state_ = kIceGatheringGathering;
@@ -145,7 +139,7 @@ class FakeTransportChannel : public TransportChannelImpl,
// If |asymmetric| is true this method only affects this FakeTransportChannel.
// If false, it affects |dest| as well.
void SetDestination(FakeTransportChannel* dest, bool asymmetric = false) {
- if (state_ == STATE_CONNECTING && dest) {
+ if (state_ == STATE_INIT && dest) {
// This simulates the delivery of candidates.
dest_ = dest;
if (local_cert_ && dest_->local_cert_) {
@@ -160,7 +154,7 @@ class FakeTransportChannel : public TransportChannelImpl,
} else if (state_ == STATE_CONNECTED && !dest) {
// Simulates loss of connectivity, by asymmetrically forgetting dest_.
dest_ = nullptr;
- state_ = STATE_CONNECTING;
+ state_ = STATE_INIT;
set_writable(false);
}
}
@@ -314,7 +308,7 @@ class FakeTransportChannel : public TransportChannelImpl,
}
}
- enum State { STATE_INIT, STATE_CONNECTING, STATE_CONNECTED };
+ enum State { STATE_INIT, STATE_CONNECTED };
FakeTransportChannel* dest_ = nullptr;
State state_ = STATE_INIT;
bool async_ = false;
@@ -580,7 +574,6 @@ class FakeTransportController : public TransportController {
transport->SetLocalTransportDescription(faketransport_desc,
cricket::CA_OFFER, nullptr);
}
- transport->ConnectChannels();
transport->MaybeStartGathering();
}
}

Powered by Google App Engine
This is Rietveld 408576698