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

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

Issue 2541093003: Instrument SSL sockets using MemoryDumpProvider (Closed)
Patch Set: Fix flaky test 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
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/trace_event/memory_allocator_dump.h" 12 #include "base/trace_event/memory_allocator_dump.h"
13 #include "base/trace_event/memory_dump_manager.h" 13 #include "base/trace_event/memory_dump_manager.h"
14 #include "base/trace_event/process_memory_dump.h" 14 #include "base/trace_event/process_memory_dump.h"
15 #include "net/cookies/cookie_store.h" 15 #include "net/cookies/cookie_store.h"
16 #include "net/dns/host_resolver.h" 16 #include "net/dns/host_resolver.h"
17 #include "net/http/http_transaction_factory.h" 17 #include "net/http/http_transaction_factory.h"
18 #include "net/socket/ssl_client_socket_impl.h"
18 #include "net/url_request/http_user_agent_settings.h" 19 #include "net/url_request/http_user_agent_settings.h"
19 #include "net/url_request/url_request.h" 20 #include "net/url_request/url_request.h"
20 21
21 namespace net { 22 namespace net {
22 23
23 URLRequestContext::URLRequestContext() 24 URLRequestContext::URLRequestContext()
24 : net_log_(nullptr), 25 : net_log_(nullptr),
25 host_resolver_(nullptr), 26 host_resolver_(nullptr),
26 cert_verifier_(nullptr), 27 cert_verifier_(nullptr),
27 channel_id_service_(nullptr), 28 channel_id_service_(nullptr),
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 bool URLRequestContext::OnMemoryDump( 121 bool URLRequestContext::OnMemoryDump(
121 const base::trace_event::MemoryDumpArgs& args, 122 const base::trace_event::MemoryDumpArgs& args,
122 base::trace_event::ProcessMemoryDump* pmd) { 123 base::trace_event::ProcessMemoryDump* pmd) {
123 if (name_.empty()) 124 if (name_.empty())
124 name_ = "unknown"; 125 name_ = "unknown";
125 base::trace_event::MemoryAllocatorDump* dump = pmd->CreateAllocatorDump( 126 base::trace_event::MemoryAllocatorDump* dump = pmd->CreateAllocatorDump(
126 base::StringPrintf("net/url_request_context/%s_%p", name_.c_str(), this)); 127 base::StringPrintf("net/url_request_context/%s_%p", name_.c_str(), this));
127 dump->AddScalar(base::trace_event::MemoryAllocatorDump::kNameObjectCount, 128 dump->AddScalar(base::trace_event::MemoryAllocatorDump::kNameObjectCount,
128 base::trace_event::MemoryAllocatorDump::kUnitsObjects, 129 base::trace_event::MemoryAllocatorDump::kUnitsObjects,
129 url_requests_->size()); 130 url_requests_->size());
131 HttpTransactionFactory* transaction_factory = http_transaction_factory();
132 if (transaction_factory) {
133 HttpNetworkSession* network_session = transaction_factory->GetSession();
134 if (network_session)
135 network_session->DumpMemoryStats(pmd, dump->absolute_name());
136 }
137 SSLClientSocketImpl::DumpSSLClientSessionMemoryStats(pmd);
130 return true; 138 return true;
131 } 139 }
132 140
133 } // namespace net 141 } // namespace net
OLDNEW
« no previous file with comments | « net/ssl/ssl_client_session_cache_unittest.cc ('k') | net/url_request/url_request_context_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698