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

Unified Diff: net/socket/client_socket_pool_base.cc

Issue 2414883005: TEMP DO NOT LAND (Closed)
Patch Set: tmp Created 4 years, 1 month 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 | « net/socket/client_socket_pool_base.h ('k') | net/socket/client_socket_pool_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/client_socket_pool_base.cc
diff --git a/net/socket/client_socket_pool_base.cc b/net/socket/client_socket_pool_base.cc
index 4e88c745acfe97a4d9ce1f47d05b309df42905c5..837c151dce356f446a6c144306494d88e76c591c 100644
--- a/net/socket/client_socket_pool_base.cc
+++ b/net/socket/client_socket_pool_base.cc
@@ -23,6 +23,10 @@
#include "net/log/net_log_event_type.h"
#include "net/log/net_log_source.h"
+#include "base/trace_event/memory_allocator_dump.h"
+#include "base/trace_event/process_memory_dump.h"
+#include "base/strings/stringprintf.h"
+
using base::TimeDelta;
namespace net {
@@ -651,6 +655,25 @@ ClientSocketPoolBaseHelper::GetInfoAsValue(const std::string& name,
return dict;
}
+void ClientSocketPoolBaseHelper::PopulateAllocatorDump(
+ base::trace_event::MemoryAllocatorDump* dump) const {
+ base::trace_event::MemoryAllocatorDump* socket_pool_dump =
+ dump->process_memory_dump()->CreateAllocatorDump(base::StringPrintf(
+ "%s/socket_pool", dump->absolute_name().c_str()));
+ size_t socket_count = 0;
+ for (GroupMap::const_iterator it = group_map_.begin(); it != group_map_.end();
+ ++it) {
+ const std::list<IdleSocket> sockets = it->second->idle_sockets();
+ for (auto socket : sockets) {
+ socket.socket->PopulateAllocatorDump(socket_pool_dump);
+ }
+ ++socket_count;
+ }
+ socket_pool_dump->AddScalar(
+ "count", base::trace_event::MemoryAllocatorDump::kUnitsObjects,
+ socket_count);
+}
+
bool ClientSocketPoolBaseHelper::IdleSocket::IsUsable() const {
if (socket->WasEverUsed())
return socket->IsConnectedAndIdle();
« no previous file with comments | « net/socket/client_socket_pool_base.h ('k') | net/socket/client_socket_pool_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698