| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "net/spdy/spdy_session_pool.h" | 5 #include "net/spdy/spdy_session_pool.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 void SpdySessionPool::DumpMemoryStats( | 375 void SpdySessionPool::DumpMemoryStats( |
| 376 base::trace_event::ProcessMemoryDump* pmd, | 376 base::trace_event::ProcessMemoryDump* pmd, |
| 377 const std::string& parent_dump_absolute_name) const { | 377 const std::string& parent_dump_absolute_name) const { |
| 378 if (sessions_.empty()) | 378 if (sessions_.empty()) |
| 379 return; | 379 return; |
| 380 size_t total_size = 0; | 380 size_t total_size = 0; |
| 381 size_t buffer_size = 0; | 381 size_t buffer_size = 0; |
| 382 size_t cert_count = 0; | 382 size_t cert_count = 0; |
| 383 size_t serialized_cert_size = 0; | 383 size_t serialized_cert_size = 0; |
| 384 size_t num_active_sessions = 0; | 384 size_t num_active_sessions = 0; |
| 385 for (const auto& session : sessions_) { | 385 for (auto* session : sessions_) { |
| 386 StreamSocket::SocketMemoryStats stats; | 386 StreamSocket::SocketMemoryStats stats; |
| 387 bool is_session_active = false; | 387 bool is_session_active = false; |
| 388 total_size += session->DumpMemoryStats(&stats, &is_session_active); | 388 total_size += session->DumpMemoryStats(&stats, &is_session_active); |
| 389 buffer_size += stats.buffer_size; | 389 buffer_size += stats.buffer_size; |
| 390 cert_count += stats.cert_count; | 390 cert_count += stats.cert_count; |
| 391 serialized_cert_size += stats.serialized_cert_size; | 391 serialized_cert_size += stats.serialized_cert_size; |
| 392 if (is_session_active) | 392 if (is_session_active) |
| 393 num_active_sessions++; | 393 num_active_sessions++; |
| 394 } | 394 } |
| 395 total_size += SpdyEstimateMemoryUsage(ObtainHpackHuffmanTable()) + | 395 total_size += SpdyEstimateMemoryUsage(ObtainHpackHuffmanTable()) + |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 483 | 483 |
| 484 if (idle_only && (*it)->is_active()) | 484 if (idle_only && (*it)->is_active()) |
| 485 continue; | 485 continue; |
| 486 | 486 |
| 487 (*it)->CloseSessionOnError(error, description); | 487 (*it)->CloseSessionOnError(error, description); |
| 488 DCHECK(!IsSessionAvailable(*it)); | 488 DCHECK(!IsSessionAvailable(*it)); |
| 489 } | 489 } |
| 490 } | 490 } |
| 491 | 491 |
| 492 } // namespace net | 492 } // namespace net |
| OLD | NEW |