| Index: net/quic/chromium/quic_stream_factory.cc
|
| diff --git a/net/quic/chromium/quic_stream_factory.cc b/net/quic/chromium/quic_stream_factory.cc
|
| index bee0b0ef2f7976f5bc3893aeadf3f1a700bd4da5..f8837e19ed0c42d5277e80efd52a76e254a85176 100644
|
| --- a/net/quic/chromium/quic_stream_factory.cc
|
| +++ b/net/quic/chromium/quic_stream_factory.cc
|
| @@ -19,6 +19,9 @@
|
| #include "base/strings/string_util.h"
|
| #include "base/strings/stringprintf.h"
|
| #include "base/threading/thread_task_runner_handle.h"
|
| +#include "base/trace_event/memory_allocator_dump.h"
|
| +#include "base/trace_event/memory_usage_estimator.h"
|
| +#include "base/trace_event/process_memory_dump.h"
|
| #include "base/trace_event/trace_event.h"
|
| #include "base/values.h"
|
| #include "crypto/openssl_util.h"
|
| @@ -897,6 +900,24 @@ void QuicStreamFactory::set_quic_server_info_factory(
|
| quic_server_info_factory_.reset(quic_server_info_factory);
|
| }
|
|
|
| +void QuicStreamFactory::DumpMemoryStats(
|
| + base::trace_event::ProcessMemoryDump* pmd,
|
| + const std::string& parent_absolute_name) const {
|
| + if (all_sessions_.empty())
|
| + return;
|
| + base::trace_event::MemoryAllocatorDump* factory_dump =
|
| + pmd->CreateAllocatorDump(parent_absolute_name + "/quic_stream_factory");
|
| + size_t memory_estimate =
|
| + base::trace_event::EstimateMemoryUsage(all_sessions_);
|
| + factory_dump->AddScalar(base::trace_event::MemoryAllocatorDump::kNameSize,
|
| + base::trace_event::MemoryAllocatorDump::kUnitsBytes,
|
| + memory_estimate);
|
| + factory_dump->AddScalar(
|
| + base::trace_event::MemoryAllocatorDump::kNameObjectCount,
|
| + base::trace_event::MemoryAllocatorDump::kUnitsObjects,
|
| + all_sessions_.size());
|
| +}
|
| +
|
| bool QuicStreamFactory::CanUseExistingSession(const QuicServerId& server_id,
|
| const HostPortPair& destination) {
|
| // TODO(zhongyi): delete active_sessions_.empty() checks once the
|
| @@ -1047,6 +1068,11 @@ bool QuicStreamFactory::QuicSessionKey::operator==(
|
| server_id_ == other.server_id_;
|
| }
|
|
|
| +size_t QuicStreamFactory::QuicSessionKey::EstimateMemoryUsage() const {
|
| + // Return 0 because QuicSessionKey is very small.
|
| + return 0;
|
| +}
|
| +
|
| void QuicStreamFactory::CreateAuxilaryJob(const QuicSessionKey& key,
|
| int cert_verify_flags,
|
| const NetLogWithSource& net_log) {
|
|
|