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

Side by Side Diff: net/url_request/url_request_context.cc

Issue 2661333002: Track SimpleCache memory usage in net/ MemoryDumpProvider (Closed)
Patch Set: address comments Created 3 years, 10 months 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
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/url_request/url_request_context.h" 5 #include "net/url_request/url_request_context.h"
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/debug/alias.h" 8 #include "base/debug/alias.h"
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
11 #include "base/strings/stringprintf.h" 11 #include "base/strings/stringprintf.h"
12 #include "base/threading/thread_task_runner_handle.h" 12 #include "base/threading/thread_task_runner_handle.h"
13 #include "base/trace_event/memory_allocator_dump.h" 13 #include "base/trace_event/memory_allocator_dump.h"
14 #include "base/trace_event/memory_dump_manager.h" 14 #include "base/trace_event/memory_dump_manager.h"
15 #include "base/trace_event/process_memory_dump.h" 15 #include "base/trace_event/process_memory_dump.h"
16 #include "net/base/sdch_manager.h" 16 #include "net/base/sdch_manager.h"
17 #include "net/cookies/cookie_store.h" 17 #include "net/cookies/cookie_store.h"
18 #include "net/dns/host_resolver.h" 18 #include "net/dns/host_resolver.h"
19 #include "net/http/http_cache.h"
19 #include "net/http/http_transaction_factory.h" 20 #include "net/http/http_transaction_factory.h"
20 #include "net/socket/ssl_client_socket_impl.h" 21 #include "net/socket/ssl_client_socket_impl.h"
21 #include "net/url_request/http_user_agent_settings.h" 22 #include "net/url_request/http_user_agent_settings.h"
22 #include "net/url_request/url_request.h" 23 #include "net/url_request/url_request.h"
23 24
24 namespace net { 25 namespace net {
25 26
26 URLRequestContext::URLRequestContext() 27 URLRequestContext::URLRequestContext()
27 : net_log_(nullptr), 28 : net_log_(nullptr),
28 host_resolver_(nullptr), 29 host_resolver_(nullptr),
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 base::trace_event::MemoryAllocatorDump* dump = pmd->CreateAllocatorDump( 141 base::trace_event::MemoryAllocatorDump* dump = pmd->CreateAllocatorDump(
141 base::StringPrintf("net/url_request_context/%s_%p", name_.c_str(), this)); 142 base::StringPrintf("net/url_request_context/%s_%p", name_.c_str(), this));
142 dump->AddScalar(base::trace_event::MemoryAllocatorDump::kNameObjectCount, 143 dump->AddScalar(base::trace_event::MemoryAllocatorDump::kNameObjectCount,
143 base::trace_event::MemoryAllocatorDump::kUnitsObjects, 144 base::trace_event::MemoryAllocatorDump::kUnitsObjects,
144 url_requests_->size()); 145 url_requests_->size());
145 HttpTransactionFactory* transaction_factory = http_transaction_factory(); 146 HttpTransactionFactory* transaction_factory = http_transaction_factory();
146 if (transaction_factory) { 147 if (transaction_factory) {
147 HttpNetworkSession* network_session = transaction_factory->GetSession(); 148 HttpNetworkSession* network_session = transaction_factory->GetSession();
148 if (network_session) 149 if (network_session)
149 network_session->DumpMemoryStats(pmd, dump->absolute_name()); 150 network_session->DumpMemoryStats(pmd, dump->absolute_name());
151 HttpCache* http_cache = transaction_factory->GetCache();
152 if (http_cache)
153 http_cache->DumpMemoryStats(pmd, dump->absolute_name());
150 } 154 }
151 SSLClientSocketImpl::DumpSSLClientSessionMemoryStats(pmd); 155 SSLClientSocketImpl::DumpSSLClientSessionMemoryStats(pmd);
152 if (sdch_manager_) 156 if (sdch_manager_)
153 sdch_manager_->DumpMemoryStats(pmd, dump->absolute_name()); 157 sdch_manager_->DumpMemoryStats(pmd, dump->absolute_name());
154 return true; 158 return true;
155 } 159 }
156 160
157 } // namespace net 161 } // namespace net
OLDNEW
« net/disk_cache/simple/simple_backend_impl.cc ('K') | « net/http/mock_http_cache.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698