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

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: 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 51979df8d8e1fe8a277368ea0684f36dbbb89d6b..73036310d66d23e92c9a7f5077466aec78238dc8 100644
--- a/webrtc/p2p/base/p2ptransportchannel.h
+++ b/webrtc/p2p/base/p2ptransportchannel.h
@@ -156,12 +156,15 @@ class P2PTransportChannel : public TransportChannelImpl,
// Public for unit tests.
Connection* FindNextPingableConnection();
- private:
- rtc::Thread* thread() { return worker_thread_; }
+ // Helper method used only in unit tests.
PortAllocatorSession* allocator_session() {
return allocator_sessions_.back();
}
+ private:
+ rtc::Thread* thread() { return worker_thread_; }
+
+
// 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;
@@ -173,6 +176,7 @@ class P2PTransportChannel : public TransportChannelImpl,
void HandleWritable();
void HandleNotWritable();
void HandleAllTimedOut();
+ void MaybeStopSessions();
Connection* GetBestConnectionOnNetwork(rtc::Network* network) const;
bool CreateConnections(const Candidate& remote_candidate,
@@ -234,7 +238,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_;
@@ -252,6 +255,9 @@ class P2PTransportChannel : public TransportChannelImpl,
int receiving_timeout_;
uint32_t last_ping_sent_ms_ = 0;
bool gather_continually_ = false;
+ // Whether a new session has been started to get ports and it is not
+ // stopped yet.
+ bool is_getting_ports_ = false;
RTC_DISALLOW_COPY_AND_ASSIGN(P2PTransportChannel);
};
« 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