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

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

Issue 2667293003: [OBSOLETE][memory-infra] Whitelist net dump providers in field trials (Closed)
Patch Set: fix comment. 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
« no previous file with comments | « net/http/http_network_session.cc ('k') | no next file » | 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/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"
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 CHECK(false) << "Leaked " << num_requests << " URLRequest(s). First URL: " 120 CHECK(false) << "Leaked " << num_requests << " URLRequest(s). First URL: "
121 << request->url().spec().c_str() << "."; 121 << request->url().spec().c_str() << ".";
122 } 122 }
123 } 123 }
124 124
125 bool URLRequestContext::OnMemoryDump( 125 bool URLRequestContext::OnMemoryDump(
126 const base::trace_event::MemoryDumpArgs& args, 126 const base::trace_event::MemoryDumpArgs& args,
127 base::trace_event::ProcessMemoryDump* pmd) { 127 base::trace_event::ProcessMemoryDump* pmd) {
128 if (name_.empty()) 128 if (name_.empty())
129 name_ = "unknown"; 129 name_ = "unknown";
130 base::trace_event::MemoryAllocatorDump* dump = pmd->CreateAllocatorDump( 130
131 base::StringPrintf("net/url_request_context/%s_%p", name_.c_str(), this)); 131 SSLClientSocketImpl::DumpSSLClientSessionMemoryStats(pmd);
132 dump->AddScalar(base::trace_event::MemoryAllocatorDump::kNameObjectCount, 132
133 base::trace_event::MemoryAllocatorDump::kUnitsObjects, 133 // The details about the url request context name are not added in BACKGROUND
134 url_requests_->size()); 134 // mode dumps.
135 std::string dump_name;
136 if (args.level_of_detail !=
137 base::trace_event::MemoryDumpLevelOfDetail::BACKGROUND) {
138 dump_name = base::StringPrintf("net/url_request_context/%s_%p",
Primiano Tucci (use gerrit) 2017/02/03 03:18:50 don't you have to do this outside of the if? other
ssid 2017/02/03 03:27:56 I am intentionally passing empty dump name here so
139 name_.c_str(), this);
140 base::trace_event::MemoryAllocatorDump* dump =
141 pmd->CreateAllocatorDump(dump_name);
142 dump->AddScalar(base::trace_event::MemoryAllocatorDump::kNameObjectCount,
143 base::trace_event::MemoryAllocatorDump::kUnitsObjects,
144 url_requests_->size());
145 }
135 HttpTransactionFactory* transaction_factory = http_transaction_factory(); 146 HttpTransactionFactory* transaction_factory = http_transaction_factory();
136 if (transaction_factory) { 147 if (transaction_factory) {
137 HttpNetworkSession* network_session = transaction_factory->GetSession(); 148 HttpNetworkSession* network_session = transaction_factory->GetSession();
138 if (network_session) 149 if (network_session)
139 network_session->DumpMemoryStats(pmd, dump->absolute_name()); 150 network_session->DumpMemoryStats(pmd, dump_name);
140 } 151 }
141 SSLClientSocketImpl::DumpSSLClientSessionMemoryStats(pmd);
Primiano Tucci (use gerrit) 2017/02/03 03:18:50 just checking, is this removal intended or just ac
ssid 2017/02/03 03:27:56 I moved it up since it is a static function call.
142 if (sdch_manager_) 152 if (sdch_manager_)
143 sdch_manager_->DumpMemoryStats(pmd, dump->absolute_name()); 153 sdch_manager_->DumpMemoryStats(pmd, dump_name);
144 return true; 154 return true;
145 } 155 }
146 156
147 } // namespace net 157 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_network_session.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698