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

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

Issue 1406423008: Stop a session when a new connection becomes writable. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Removing the state variable has_stopped_sessions_ Created 5 years, 2 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 | « no previous file | webrtc/p2p/base/p2ptransportchannel.cc » ('j') | webrtc/p2p/base/p2ptransportchannel.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/p2p/base/p2ptransportchannel.h
diff --git a/webrtc/p2p/base/p2ptransportchannel.h b/webrtc/p2p/base/p2ptransportchannel.h
index 9efb96c42d091759b28d5c25b21a96ab52228359..f3211e4a537ba4415371085a562778cd3830644d 100644
--- a/webrtc/p2p/base/p2ptransportchannel.h
+++ b/webrtc/p2p/base/p2ptransportchannel.h
@@ -161,12 +161,15 @@ class P2PTransportChannel : public TransportChannelImpl,
// Public for unit tests.
const std::vector<Connection*>& connections() const { return connections_; }
- private:
- rtc::Thread* thread() { return worker_thread_; }
+ // Public for unit tests.
PortAllocatorSession* allocator_session() {
return allocator_sessions_.back();
}
+ private:
+ rtc::Thread* thread() { return worker_thread_; }
+ bool IsGettingPorts() { return allocator_session()->IsGettingPorts(); }
+
// A transport channel is weak if the current best connection is either
// not receiving or not writable, or if there is no best connection at all.
bool weak() const;
@@ -178,6 +181,7 @@ class P2PTransportChannel : public TransportChannelImpl,
void HandleWritable();
void HandleNotWritable();
void HandleAllTimedOut();
+ void MaybeStopPortAllocatorSessions();
Connection* GetBestConnectionOnNetwork(rtc::Network* network) const;
bool CreateConnections(const Candidate& remote_candidate,
@@ -239,7 +243,6 @@ class P2PTransportChannel : public TransportChannelImpl,
Connection* pending_best_connection_;
std::vector<RemoteCandidate> remote_candidates_;
bool sort_dirty_; // indicates whether another sort is needed right now
- bool was_writable_;
bool had_connection_ = false; // if connections_ has ever been nonempty
typedef std::map<rtc::Socket::Option, int> OptionMap;
OptionMap options_;
« no previous file with comments | « no previous file | webrtc/p2p/base/p2ptransportchannel.cc » ('j') | webrtc/p2p/base/p2ptransportchannel.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698