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

Unified Diff: base/trace_event/memory_infra_background_whitelist.cc

Issue 2772283003: Make url_request_context dumps include context names (Closed)
Patch Set: Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | net/base/sdch_manager_unittest.cc » ('j') | net/url_request/url_request_context.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/trace_event/memory_infra_background_whitelist.cc
diff --git a/base/trace_event/memory_infra_background_whitelist.cc b/base/trace_event/memory_infra_background_whitelist.cc
index ae74322040f45043af0183f8fda5b32223910170..348c3b06ac8f468fc674a4a3b257a8e7dab8ebfa 100644
--- a/base/trace_event/memory_infra_background_whitelist.cc
+++ b/base/trace_event/memory_infra_background_whitelist.cc
@@ -9,6 +9,8 @@
#include <string>
+#include "base/strings/string_util.h"
+
namespace base {
namespace trace_event {
namespace {
@@ -69,10 +71,12 @@ const char* const kAllocatorDumpNameWhitelist[] = {
"net/http_network_session_0x?/stream_factory",
"net/sdch_manager_0x?",
"net/ssl_session_cache",
- "net/url_request_context_0x?",
- "net/url_request_context_0x?/http_cache",
- "net/url_request_context_0x?/http_network_session",
- "net/url_request_context_0x?/sdch_manager",
+ "net/url_request_context",
+ "net/url_request_context/%s",
+ "net/url_request_context/%s/0x?",
ssid 2017/03/27 18:43:15 I'd say just add all the strings here instead of s
xunjieli 2017/03/27 19:24:55 Done. Though it feels a bit verbose to list all th
ssid 2017/03/27 20:15:11 Ahh, sorry I see why you did this now. I thought i
xunjieli 2017/03/27 20:27:14 Done.
+ "net/url_request_context/%s/0x?/http_cache",
+ "net/url_request_context/%s/0x?/http_network_session",
+ "net/url_request_context/%s/0x?/sdch_manager",
"web_cache/Image_resources",
"web_cache/CSS stylesheet_resources",
"web_cache/Script_resources",
@@ -178,6 +182,18 @@ bool IsMemoryAllocatorDumpNameWhitelisted(const std::string& name) {
}
}
+ std::string url_request_context_prefix = "url_request_context/";
+ size_t pos = stripped_str.find(url_request_context_prefix);
+ if (pos != std::string::npos) {
+ const std::string names[] = {"system", "proxy", "app_request",
ssid 2017/03/27 20:26:02 nit: /s/std::string/const char* const/ s/names/kRe
xunjieli 2017/03/28 01:04:56 Done.
+ "main", "extensions", "safe_browsing",
+ "unknown"};
+ for (const auto& name : names) {
+ base::ReplaceSubstringsAfterOffset(
+ &stripped_str, pos + url_request_context_prefix.length(), name, "%s");
+ }
+ }
+
for (size_t i = 0; g_allocator_dump_name_whitelist[i] != nullptr; ++i) {
if (stripped_str == g_allocator_dump_name_whitelist[i]) {
return true;
« no previous file with comments | « no previous file | net/base/sdch_manager_unittest.cc » ('j') | net/url_request/url_request_context.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698