summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorjar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-30 07:31:45 +0000
committerjar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-30 07:31:45 +0000
commit75b7920402c6f834376a18aa1927b223c6e3eadb (patch)
treec0a770a9b85fcb09fb988ba2ff0c2eef8b994b98 /chrome
parentd3d98bc21e6fe0ea6aa0186194347a1f5e4d7be8 (diff)
downloadchromium_src-75b7920402c6f834376a18aa1927b223c6e3eadb.zip
chromium_src-75b7920402c6f834376a18aa1927b223c6e3eadb.tar.gz
chromium_src-75b7920402c6f834376a18aa1927b223c6e3eadb.tar.bz2
Provide a quick and dirty way to reset about:objects data
To make it easier to use the about:object profiling facility, I put in a quick/dirty way to reset all profile stats to 0 (as if there were no births, deaths, etc.). This code is only activated under debug builds (or if a developer inists in a private build). These stats don't impact semantics of the browser, so the hackish approach to clearing the data counts can't instigate a crash, and it makes it much easier to look at changes in the stats. While changing the code, I also added a lot of comments, and did a few minor cleanups items. I also officially added about:tasks as a replacement for about:objects, as this is really how the service is used in Chrome. r=mbelshe Review URL: http://codereview.chromium.org/100297 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35372 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/browser_about_handler.cc18
1 files changed, 10 insertions, 8 deletions
diff --git a/chrome/browser/browser_about_handler.cc b/chrome/browser/browser_about_handler.cc
index 320af0c..1b8a556 100644
--- a/chrome/browser/browser_about_handler.cc
+++ b/chrome/browser/browser_about_handler.cc
@@ -77,19 +77,19 @@ void AboutTcmallocRendererCallback(base::ProcessId pid, std::string output) {
namespace {
-// The paths used for the about pages.
+// The (alphabetized) paths used for the about pages.
+const char kCreditsPath[] = "credits";
const char kDnsPath[] = "dns";
const char kHistogramsPath[] = "histograms";
-const char kObjectsPath[] = "objects";
const char kMemoryRedirectPath[] = "memory-redirect";
const char kMemoryPath[] = "memory";
-const char kTcmallocPath[] = "tcmalloc";
const char kPluginsPath[] = "plugins";
const char kStatsPath[] = "stats";
-const char kVersionPath[] = "version";
-const char kCreditsPath[] = "credits";
-const char kTermsPath[] = "terms";
const char kSyncPath[] = "sync";
+const char kTasksPath[] = "tasks";
+const char kTcmallocPath[] = "tcmalloc";
+const char kTermsPath[] = "terms";
+const char kVersionPath[] = "version";
#if defined(OS_CHROMEOS)
const char kOSCreditsPath[] = "os-credits";
@@ -325,7 +325,7 @@ void AboutMemory(AboutSource* source, int request_id) {
handler->StartFetch();
}
-std::string AboutObjects(const std::string& query) {
+static std::string AboutObjects(const std::string& query) {
std::string data;
tracked_objects::ThreadData::WriteHTML(query, &data);
return data;
@@ -675,8 +675,10 @@ void AboutSource::StartDataRequest(const std::string& path_raw,
return;
} else if (path == kMemoryRedirectPath) {
response = GetAboutMemoryRedirectResponse();
- } else if (path == kObjectsPath) {
+#ifdef TRACK_ALL_TASK_OBJECTS
+ } else if (path == kTasksPath) {
response = AboutObjects(info);
+#endif
} else if (path == kPluginsPath) {
response = AboutPlugins();
} else if (path == kStatsPath) {