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

Unified Diff: talk/media/sctp/sctpdataengine.h

Issue 1266033005: Added send-thresholding and fixed text packet dumping. Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years, 4 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 | talk/media/sctp/sctpdataengine.cc » ('j') | talk/media/sctp/sctpdataengine.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: talk/media/sctp/sctpdataengine.h
diff --git a/talk/media/sctp/sctpdataengine.h b/talk/media/sctp/sctpdataengine.h
index 86bfa37a48c10dca4c3f5b0cad9a330d27aea10e..d72a1003f405d927bb8d043b80fb996e1347416a 100644
--- a/talk/media/sctp/sctpdataengine.h
+++ b/talk/media/sctp/sctpdataengine.h
@@ -29,6 +29,7 @@
#define TALK_MEDIA_SCTP_SCTPDATAENGINE_H_
#include <errno.h>
+#include <map>
#include <string>
#include <vector>
@@ -190,6 +191,13 @@ class SctpDataMediaChannel : public DataMediaChannel,
const std::string& debug_name() const { return debug_name_; }
private:
+ // Maps sockets back to their SctpDataMediaChannels. For usrsctp
+ // send-threshold callbacks, we only get the socket* on invocation, but
+ // need to find the SctpDataMediaChannels. We can get that through the
+ // library, but would cost us an allocation/free each time the callback is
+ // invoked.
+ typedef std::map<struct socket*, SctpDataMediaChannel*> SocketChannelMap;
+ static SocketChannelMap sock_channel_map_;
pthatcher1 2015/08/05 21:42:55 Instead of being a static member of the SctpDataMe
lally1 2015/08/18 20:38:56 That makes a lot of sense, but the SctpDataMediaCh
pthatcher1 2015/08/18 21:51:52 We could add SctpDataMediaChannel::SignalDestroyed
sockaddr_conn GetSctpSockAddr(int port);
// Creates the socket and connects. Sets sending_ to true.
@@ -222,6 +230,8 @@ class SctpDataMediaChannel : public DataMediaChannel,
void OnStreamResetEvent(const struct sctp_stream_reset_event* evt);
+ static int SendThresholdCallback(struct socket* sock, uint32_t sb_free);
+
// Responsible for marshalling incoming data to the channels listeners, and
// outgoing data to the network interface.
rtc::Thread* worker_thread_;
« no previous file with comments | « no previous file | talk/media/sctp/sctpdataengine.cc » ('j') | talk/media/sctp/sctpdataengine.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698