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

Unified Diff: base/tracked_objects.cc

Issue 7215034: Apply CSP to chrome: and about: pages (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 6 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
Index: base/tracked_objects.cc
===================================================================
--- base/tracked_objects.cc (revision 90431)
+++ base/tracked_objects.cc (working copy)
@@ -131,44 +131,12 @@
return registry;
}
-// Do mininimal fixups for searching function names.
-static std::string UnescapeQuery(const std::string& query) {
- std::string result;
- for (size_t i = 0; i < query.size(); i++) {
- char next = query[i];
- if ('%' == next && i + 2 < query.size()) {
- std::string hex = query.substr(i + 1, 2);
- char replacement = '\0';
- // Only bother with "<", ">", and " ".
- if (LowerCaseEqualsASCII(hex, "3c"))
- replacement ='<';
- else if (LowerCaseEqualsASCII(hex, "3e"))
- replacement = '>';
- else if (hex == "20")
- replacement = ' ';
- if (replacement) {
- next = replacement;
- i += 2;
- }
- }
- result.push_back(next);
- }
- return result;
-}
-
// static
void ThreadData::WriteHTML(const std::string& query, std::string* output) {
if (!ThreadData::IsActive())
return; // Not yet initialized.
DCHECK(ThreadData::current());
-
- output->append("<html><head><title>About Tasks");
- std::string escaped_query = UnescapeQuery(query);
- if (!escaped_query.empty())
- output->append(" - " + escaped_query);
- output->append("</title></head><body><pre>");
-
DataCollector collected_data; // Gather data.
collected_data.AddListOfLivingObjects(); // Add births that are still alive.
@@ -177,7 +145,7 @@
// Create filtering and sort comparison object.
Comparator comparator;
- comparator.ParseQuery(escaped_query);
+ comparator.ParseQuery(query);
// Filter out acceptable (matching) instances.
DataCollector::Collection match_array;
@@ -222,7 +190,6 @@
"If you wish to monitor Renderer events, be sure to run in --single-process"
" mode.";
output->append(help_string);
- output->append("</body></html>");
}
// static

Powered by Google App Engine
This is Rietveld 408576698