summaryrefslogtreecommitdiffstats
path: root/content/renderer/p2p/socket_client.h
diff options
context:
space:
mode:
authorsergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-06 06:59:42 +0000
committersergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-06 06:59:42 +0000
commitd9285f690a7f8f5aa0c082276a0ebbbf41dcbe86 (patch)
tree7b83b4841d8d100d0626cbb7b2f2595c86d38da8 /content/renderer/p2p/socket_client.h
parentfdb1dced7ad62f957087f3f55fe6ed6f1c2524d7 (diff)
downloadchromium_src-d9285f690a7f8f5aa0c082276a0ebbbf41dcbe86.zip
chromium_src-d9285f690a7f8f5aa0c082276a0ebbbf41dcbe86.tar.gz
chromium_src-d9285f690a7f8f5aa0c082276a0ebbbf41dcbe86.tar.bz2
Fix IpcPacketSocketFactory to return EWOULDBLOCK when network interface is congested.
PeerConnection implementation in libjingle will need to handle the case when a network interface is congested, so it needs to be notified when send buffers are full. This CL adds send result notification message that is sent to the renderer process after each message is sent. Sockets created using IpcPacketSocketFactory will be returning EWOULDBLOCK when Send() buffers are full instead of dropping the packet silently. BUG=226158 Review URL: https://chromiumcodereview.appspot.com/13584008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@192721 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/renderer/p2p/socket_client.h')
-rw-r--r--content/renderer/p2p/socket_client.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/content/renderer/p2p/socket_client.h b/content/renderer/p2p/socket_client.h
index d74107f..fd8537e 100644
--- a/content/renderer/p2p/socket_client.h
+++ b/content/renderer/p2p/socket_client.h
@@ -27,7 +27,8 @@ class P2PSocketDispatcher;
// thread which is specified in Init().
class P2PSocketClient : public base::RefCountedThreadSafe<P2PSocketClient> {
public:
- // Delegate is called on the the same thread on the delegate thread.
+ // Delegate is called on the the same thread on which P2PSocketCLient is
+ // created.
class Delegate {
public:
virtual ~Delegate() { }
@@ -35,6 +36,7 @@ class P2PSocketClient : public base::RefCountedThreadSafe<P2PSocketClient> {
virtual void OnOpen(const net::IPEndPoint& address) = 0;
virtual void OnIncomingTcpConnection(const net::IPEndPoint& address,
P2PSocketClient* client) = 0;
+ virtual void OnSendComplete() = 0;
virtual void OnError() = 0;
virtual void OnDataReceived(const net::IPEndPoint& address,
const std::vector<char>& data) = 0;
@@ -80,6 +82,8 @@ class P2PSocketClient : public base::RefCountedThreadSafe<P2PSocketClient> {
// Message handlers that run on IPC thread.
void OnSocketCreated(const net::IPEndPoint& address);
void OnIncomingTcpConnection(const net::IPEndPoint& address);
+ void OnSendComplete(int packet_id);
+ void OnSendComplete();
void OnError();
void OnDataReceived(const net::IPEndPoint& address,
const std::vector<char>& data);
@@ -89,6 +93,7 @@ class P2PSocketClient : public base::RefCountedThreadSafe<P2PSocketClient> {
void DeliverOnIncomingTcpConnection(
const net::IPEndPoint& address,
scoped_refptr<P2PSocketClient> new_client);
+ void DeliverOnSendComplete();
void DeliverOnError();
void DeliverOnDataReceived(const net::IPEndPoint& address,
const std::vector<char>& data);