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

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..d2f2711409018d7f579eb473a4279601f98330ab 100644
--- a/content/browser/renderer_host/p2p/socket_host_tcp.cc
+++ b/content/browser/renderer_host/p2p/socket_host_tcp.cc
@@ -49,7 +49,7 @@ P2PSocketHostTcpBase::P2PSocketHostTcpBase(
int socket_id,
P2PSocketType type,
net::URLRequestContextGetter* url_context)
- : P2PSocketHost(message_sender, socket_id),
+ : P2PSocketHost(message_sender, socket_id, P2PSocketHost::TCP),
write_pending_(false),
connected_(false),
type_(type),
@@ -361,8 +361,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 +403,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) {
« no previous file with comments | « content/browser/renderer_host/p2p/socket_host.cc ('k') | content/browser/renderer_host/p2p/socket_host_tcp_server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698