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/transport.h

Issue 1345913004: Replace readable with receiving where receiving means receiving anything (stun ping, response or da… (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Address comments Created 5 years, 3 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/base/port_unittest.cc ('k') | webrtc/p2p/base/transport.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/p2p/base/transport.h
diff --git a/webrtc/p2p/base/transport.h b/webrtc/p2p/base/transport.h
index 553965595302e216e610a9bcca76df0dc9342ac8..72a089501e6007d51c61be121efbef1e1178fa25 100644
--- a/webrtc/p2p/base/transport.h
+++ b/webrtc/p2p/base/transport.h
@@ -54,7 +54,7 @@ class TransportChannelImpl;
typedef std::vector<Candidate> Candidates;
-// For "writable", "readable", and "receiving", we need to differentiate between
+// For "writable" and "receiving", we need to differentiate between
// none, all, and some.
enum TransportState {
TRANSPORT_STATE_NONE = 0,
@@ -63,10 +63,9 @@ enum TransportState {
};
// When checking transport state, we need to differentiate between
-// "readable", "writable", or "receiving" check.
+// "writable" or "receiving" check.
enum TransportStateType {
- TRANSPORT_READABLE_STATE = 0,
- TRANSPORT_WRITABLE_STATE,
+ TRANSPORT_WRITABLE_STATE = 0,
TRANSPORT_RECEIVING_STATE
};
@@ -76,7 +75,7 @@ struct ConnectionInfo {
ConnectionInfo()
: best_connection(false),
writable(false),
- readable(false),
+ receiving(false),
timeout(false),
new_connection(false),
rtt(0),
@@ -90,7 +89,7 @@ struct ConnectionInfo {
bool best_connection; // Is this the best connection we have?
bool writable; // Has this connection received a STUN response?
- bool readable; // Has this connection received a STUN request?
+ bool receiving; // Has this connection received anything?
bool timeout; // Has this connection timed out?
bool new_connection; // Is this a newly created connection?
size_t rtt; // The STUN RTT for this connection.
@@ -156,25 +155,16 @@ class Transport : public rtc::MessageHandler,
// Returns the port allocator object for this transport.
PortAllocator* port_allocator() { return allocator_; }
- // Returns the readable and states of this manager. These bits are the ORs
+ // Returns the states of this manager. These bits are the ORs
// of the corresponding bits on the managed channels. Each time one of these
// states changes, a signal is raised.
- // TODO: Replace uses of readable() and writable() with
- // any_channels_readable() and any_channels_writable().
- bool readable() const { return any_channels_readable(); }
+ // TODO(honghaiz): Replace uses of writable() with any_channels_writable().
bool writable() const { return any_channels_writable(); }
bool was_writable() const { return was_writable_; }
- bool any_channels_readable() const {
- return (readable_ == TRANSPORT_STATE_SOME ||
- readable_ == TRANSPORT_STATE_ALL);
- }
bool any_channels_writable() const {
return (writable_ == TRANSPORT_STATE_SOME ||
writable_ == TRANSPORT_STATE_ALL);
}
- bool all_channels_readable() const {
- return (readable_ == TRANSPORT_STATE_ALL);
- }
bool all_channels_writable() const {
return (writable_ == TRANSPORT_STATE_ALL);
}
@@ -183,7 +173,6 @@ class Transport : public rtc::MessageHandler,
receiving_ == TRANSPORT_STATE_ALL);
}
- sigslot::signal1<Transport*> SignalReadableState;
sigslot::signal1<Transport*> SignalWritableState;
sigslot::signal1<Transport*> SignalReceivingState;
sigslot::signal1<Transport*> SignalCompleted;
@@ -374,8 +363,7 @@ class Transport : public rtc::MessageHandler,
// Candidate component => ChannelMapEntry
typedef std::map<int, ChannelMapEntry> ChannelMap;
- // Called when the state of a channel changes.
- void OnChannelReadableState(TransportChannel* channel);
+ // Called when the write state of a channel changes.
void OnChannelWritableState(TransportChannel* channel);
// Called when the receiving state of a channel changes.
@@ -409,7 +397,6 @@ class Transport : public rtc::MessageHandler,
void ResetChannels_w();
void DestroyAllChannels_w();
void OnRemoteCandidate_w(const Candidate& candidate);
- void OnChannelReadableState_s();
void OnChannelWritableState_s();
void OnChannelReceivingState_s();
void OnChannelRequestSignaling_s();
« no previous file with comments | « webrtc/p2p/base/port_unittest.cc ('k') | webrtc/p2p/base/transport.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698