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

Unified Diff: content/browser/renderer_host/p2p/socket_host_tcp.cc

Issue 677473002: Implement UMA and internal data structure for tracking EWOULDBLOCK. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
Index: content/browser/renderer_host/p2p/socket_host_tcp.cc
diff --git a/content/browser/renderer_host/p2p/socket_host_tcp.cc b/content/browser/renderer_host/p2p/socket_host_tcp.cc
index 1ee1627b5d72d9f1175415c1db67b61052b5aa25..05db881fe23b8fc386b536a586ebaeeaefa3f488 100644
--- a/content/browser/renderer_host/p2p/socket_host_tcp.cc
+++ b/content/browser/renderer_host/p2p/socket_host_tcp.cc
@@ -54,6 +54,7 @@ P2PSocketHostTcpBase::P2PSocketHostTcpBase(
connected_(false),
type_(type),
url_context_(url_context) {
+ protocol_type_ = P2PSocketHost::TCP;
}
P2PSocketHostTcpBase::~P2PSocketHostTcpBase() {
@@ -361,8 +362,11 @@ void P2PSocketHostTcpBase::Send(const net::IPEndPoint& to,
void P2PSocketHostTcpBase::WriteOrQueue(
scoped_refptr<net::DrainableIOBuffer>& buffer) {
+ IncrementTotalSentPackets();
if (write_buffer_.get()) {
write_queue_.push(buffer);
+ IncrementDelayedPackets();
+ IncrementDelayedBytes(buffer->size());
return;
}
@@ -400,6 +404,8 @@ void P2PSocketHostTcpBase::HandleWriteResult(int result) {
} else {
write_buffer_ = write_queue_.front();
write_queue_.pop();
+ // Update how many bytes are still waiting to be sent.
+ DecrementDelayedBytes(write_buffer_->size());
}
}
} else if (result == net::ERR_IO_PENDING) {

Powered by Google App Engine
This is Rietveld 408576698