| Index: net/http/http_stream_factory_impl.cc
|
| diff --git a/net/http/http_stream_factory_impl.cc b/net/http/http_stream_factory_impl.cc
|
| index 577a990853ae6ac0e4d83987152c46b7873ee019..d872c5896e4a4bd9ce95a10f5f21ae4412ee7cda 100644
|
| --- a/net/http/http_stream_factory_impl.cc
|
| +++ b/net/http/http_stream_factory_impl.cc
|
| @@ -25,6 +25,10 @@
|
| #include "url/scheme_host_port.h"
|
| #include "url/url_constants.h"
|
|
|
| +#include "base/strings/stringprintf.h"
|
| +#include "base/trace_event/memory_allocator_dump.h"
|
| +#include "base/trace_event/process_memory_dump.h"
|
| +
|
| namespace net {
|
|
|
| namespace {
|
| @@ -302,4 +306,48 @@ bool HttpStreamFactoryImpl::ProxyServerSupportsPriorities(
|
| scheme_host_port);
|
| }
|
|
|
| +void HttpStreamFactoryImpl::DumpMemoryStats(
|
| + base::trace_event::ProcessMemoryDump* pmd,
|
| + const std::string& parent_absolute_name) const {
|
| +
|
| + std::string name = base::StringPrintf("%s/factory", parent_absolute_name.c_str());
|
| + base::trace_event::MemoryAllocatorDump* factory =
|
| + pmd->CreateAllocatorDump(name);
|
| + factory->AddScalar(base::trace_event::MemoryAllocatorDump::kNameObjectCount,
|
| + base::trace_event::MemoryAllocatorDump::kUnitsObjects,
|
| + job_controller_set_.size());
|
| +
|
| + int i =0;
|
| + for (const auto& it : job_controller_set_) {
|
| + i++;
|
| + base::trace_event::MemoryAllocatorDump* f =
|
| + pmd->CreateAllocatorDump(base::StringPrintf("%s/%d", name.c_str(), i));
|
| +
|
| + f->AddString("request", "",
|
| + it->request_ == nullptr ? "null" : "non-null");
|
| + f->AddString("main", "",
|
| + it->main_job_.get() == nullptr ? "null" : "non-null");
|
| + f->AddString(
|
| + "alternative job", "",
|
| + it->alternative_job_.get() == nullptr ? "null" : "non-null");
|
| + f->AddString(
|
| + "is_preconnect_", "",
|
| + it->is_preconnect_ ? "true" : "false");
|
| + f->AddString(
|
| + "main_job_is_blocked", "",
|
| + it->main_job_is_blocked_ ? "true" : "false");
|
| + f->AddString(
|
| + "alt job failed", "",
|
| + it->alternative_job_failed_ ? "true" : "false");
|
| + if (it->main_job_) {
|
| + f->AddString("main_job state", "",
|
| + it->main_job_->state());
|
| + }
|
| + f->AddString("is_quic", "", it->is_quic_ ? "true" : "false");
|
| + f->AddString("reuse_quic", "", it->reusing_quic_ ? "true" : "false");
|
| + f->AddString("is_spdy", "", it->is_spdy_ ? "true" : "false");
|
| + }
|
| +
|
| +}
|
| +
|
| } // namespace net
|
|
|