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

Side by Side Diff: net/spdy/spdy_session_pool.cc

Issue 2565523002: Instrument SpdySessionPool using MemoryDumpProvider (Closed)
Patch Set: Address comments Created 4 years 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 unified diff | Download patch
« no previous file with comments | « net/spdy/spdy_session_pool.h ('k') | net/spdy/spdy_session_pool_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/metrics/histogram_macros.h" 10 #include "base/metrics/histogram_macros.h"
11 #include "base/profiler/scoped_tracker.h" 11 #include "base/profiler/scoped_tracker.h"
12 #include "base/stl_util.h" 12 #include "base/stl_util.h"
13 #include "base/strings/stringprintf.h"
14 #include "base/trace_event/memory_allocator_dump.h"
15 #include "base/trace_event/process_memory_dump.h"
13 #include "base/trace_event/trace_event.h" 16 #include "base/trace_event/trace_event.h"
14 #include "base/values.h" 17 #include "base/values.h"
15 #include "net/base/address_list.h" 18 #include "net/base/address_list.h"
16 #include "net/base/trace_constants.h" 19 #include "net/base/trace_constants.h"
17 #include "net/http/http_network_session.h" 20 #include "net/http/http_network_session.h"
18 #include "net/http/http_server_properties.h" 21 #include "net/http/http_server_properties.h"
19 #include "net/log/net_log_event_type.h" 22 #include "net/log/net_log_event_type.h"
20 #include "net/log/net_log_source.h" 23 #include "net/log/net_log_source.h"
21 #include "net/log/net_log_with_source.h" 24 #include "net/log/net_log_with_source.h"
22 #include "net/spdy/spdy_session.h" 25 #include "net/spdy/spdy_session.h"
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 } 359 }
357 360
358 void SpdySessionPool::OnSSLConfigChanged() { 361 void SpdySessionPool::OnSSLConfigChanged() {
359 CloseCurrentSessions(ERR_NETWORK_CHANGED); 362 CloseCurrentSessions(ERR_NETWORK_CHANGED);
360 } 363 }
361 364
362 void SpdySessionPool::OnCertDBChanged(const X509Certificate* cert) { 365 void SpdySessionPool::OnCertDBChanged(const X509Certificate* cert) {
363 CloseCurrentSessions(ERR_CERT_DATABASE_CHANGED); 366 CloseCurrentSessions(ERR_CERT_DATABASE_CHANGED);
364 } 367 }
365 368
369 void SpdySessionPool::DumpMemoryStats(
370 base::trace_event::ProcessMemoryDump* pmd,
371 const std::string& parent_dump_absolute_name) const {
372 std::string dump_name = base::StringPrintf("%s/spdy_session_pool",
373 parent_dump_absolute_name.c_str());
374 pmd->CreateAllocatorDump(dump_name);
375 for (const auto& session : sessions_) {
376 session->DumpMemoryStats(pmd, dump_name);
377 }
378 }
379
366 bool SpdySessionPool::IsSessionAvailable( 380 bool SpdySessionPool::IsSessionAvailable(
367 const base::WeakPtr<SpdySession>& session) const { 381 const base::WeakPtr<SpdySession>& session) const {
368 for (AvailableSessionMap::const_iterator it = available_sessions_.begin(); 382 for (AvailableSessionMap::const_iterator it = available_sessions_.begin();
369 it != available_sessions_.end(); ++it) { 383 it != available_sessions_.end(); ++it) {
370 if (it->second.get() == session.get()) 384 if (it->second.get() == session.get())
371 return true; 385 return true;
372 } 386 }
373 return false; 387 return false;
374 } 388 }
375 389
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 443
430 if (idle_only && (*it)->is_active()) 444 if (idle_only && (*it)->is_active())
431 continue; 445 continue;
432 446
433 (*it)->CloseSessionOnError(error, description); 447 (*it)->CloseSessionOnError(error, description);
434 DCHECK(!IsSessionAvailable(*it)); 448 DCHECK(!IsSessionAvailable(*it));
435 } 449 }
436 } 450 }
437 451
438 } // namespace net 452 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/spdy_session_pool.h ('k') | net/spdy/spdy_session_pool_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698