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

Unified Diff: webrtc/p2p/client/basicportallocator.cc

Issue 1992253005: Removing PORTALLOCATOR_ENABLE_SHAKER. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 7 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
« no previous file with comments | « webrtc/p2p/client/basicportallocator.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/p2p/client/basicportallocator.cc
diff --git a/webrtc/p2p/client/basicportallocator.cc b/webrtc/p2p/client/basicportallocator.cc
index 143b036183777875730387f85736ed71ad90e3db..bf61bc88fc9612074b6eaa5e387b026645027eb2 100644
--- a/webrtc/p2p/client/basicportallocator.cc
+++ b/webrtc/p2p/client/basicportallocator.cc
@@ -36,7 +36,6 @@ enum {
MSG_CONFIG_READY,
MSG_ALLOCATE,
MSG_ALLOCATION_PHASE,
- MSG_SHAKE,
MSG_SEQUENCEOBJECTS_CREATED,
MSG_CONFIG_STOP,
};
@@ -48,14 +47,6 @@ const int PHASE_SSLTCP = 3;
const int kNumPhases = 4;
-const int SHAKE_MIN_DELAY = 45 * 1000; // 45 seconds
-const int SHAKE_MAX_DELAY = 90 * 1000; // 90 seconds
-
-int ShakeDelay() {
- int range = SHAKE_MAX_DELAY - SHAKE_MIN_DELAY + 1;
- return SHAKE_MIN_DELAY + CreateRandomId() % range;
-}
-
} // namespace
namespace cricket {
@@ -186,9 +177,6 @@ void BasicPortAllocatorSession::StartGettingPorts() {
running_ = true;
network_thread_->Post(this, MSG_CONFIG_START);
-
- if (flags() & PORTALLOCATOR_ENABLE_SHAKER)
- network_thread_->PostDelayed(ShakeDelay(), this, MSG_SHAKE);
}
void BasicPortAllocatorSession::StopGettingPorts() {
@@ -265,21 +253,14 @@ void BasicPortAllocatorSession::OnMessage(rtc::Message *message) {
ASSERT(rtc::Thread::Current() == network_thread_);
GetPortConfigurations();
break;
-
case MSG_CONFIG_READY:
ASSERT(rtc::Thread::Current() == network_thread_);
OnConfigReady(static_cast<PortConfiguration*>(message->pdata));
break;
-
case MSG_ALLOCATE:
ASSERT(rtc::Thread::Current() == network_thread_);
OnAllocate();
break;
-
- case MSG_SHAKE:
- ASSERT(rtc::Thread::Current() == network_thread_);
- OnShake();
- break;
case MSG_SEQUENCEOBJECTS_CREATED:
ASSERT(rtc::Thread::Current() == network_thread_);
OnAllocationSequenceObjectsCreated();
@@ -713,36 +694,6 @@ void BasicPortAllocatorSession::OnPortDestroyed(
ASSERT(false);
}
-void BasicPortAllocatorSession::OnShake() {
- LOG(INFO) << ">>>>> SHAKE <<<<< >>>>> SHAKE <<<<< >>>>> SHAKE <<<<<";
-
- std::vector<Port*> ports;
- std::vector<Connection*> connections;
-
- for (size_t i = 0; i < ports_.size(); ++i) {
- if (ports_[i].ready())
- ports.push_back(ports_[i].port());
- }
-
- for (size_t i = 0; i < ports.size(); ++i) {
- Port::AddressMap::const_iterator iter;
- for (iter = ports[i]->connections().begin();
- iter != ports[i]->connections().end();
- ++iter) {
- connections.push_back(iter->second);
- }
- }
-
- LOG(INFO) << ">>>>> Destroying " << ports.size() << " ports and "
- << connections.size() << " connections";
-
- for (size_t i = 0; i < connections.size(); ++i)
- connections[i]->Destroy();
-
- if (running_ || (ports.size() > 0) || (connections.size() > 0))
- network_thread_->PostDelayed(ShakeDelay(), this, MSG_SHAKE);
-}
-
BasicPortAllocatorSession::PortData* BasicPortAllocatorSession::FindPort(
Port* port) {
for (std::vector<PortData>::iterator it = ports_.begin();
« no previous file with comments | « webrtc/p2p/client/basicportallocator.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698