summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authormbelshe@google.com <mbelshe@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-27 19:56:54 +0000
committermbelshe@google.com <mbelshe@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-27 19:56:54 +0000
commit4500a724f92aafd3dddd18f33500e3551e45893f (patch)
treeec4e580744def01790ca342326c0ad0024c1e088 /chrome
parent0d6eb91cae5b6b72db209f3f7dcf2cae7810619c (diff)
downloadchromium_src-4500a724f92aafd3dddd18f33500e3551e45893f.zip
chromium_src-4500a724f92aafd3dddd18f33500e3551e45893f.tar.gz
chromium_src-4500a724f92aafd3dddd18f33500e3551e45893f.tar.bz2
Hide StatsTable behind --enable-stats-table.
Review URL: http://codereview.chromium.org/49045 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12690 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/app/chrome_dll_main.cc12
-rw-r--r--chrome/browser/plugin_process_host.cc1
-rw-r--r--chrome/browser/renderer_host/browser_render_process_host.cc1
-rw-r--r--chrome/common/chrome_switches.cc3
-rw-r--r--chrome/common/chrome_switches.h1
5 files changed, 13 insertions, 5 deletions
diff --git a/chrome/app/chrome_dll_main.cc b/chrome/app/chrome_dll_main.cc
index 1ef0dd0..26e8936 100644
--- a/chrome/app/chrome_dll_main.cc
+++ b/chrome/app/chrome_dll_main.cc
@@ -304,11 +304,13 @@ int ChromeMain(int argc, const char** argv) {
// of the process. It is not cleaned up.
// TODO(port): we probably need to shut this down correctly to avoid
// leaking shared memory regions on posix platforms.
- std::string statsfile =
- StringPrintf("%s-%d", chrome::kStatsFilename, browser_pid);
- StatsTable *stats_table = new StatsTable(statsfile,
- chrome::kStatsMaxThreads, chrome::kStatsMaxCounters);
- StatsTable::set_current(stats_table);
+ if (parsed_command_line.HasSwitch(switches::kEnableStatsTable)) {
+ std::string statsfile =
+ StringPrintf("%s-%d", chrome::kStatsFilename, browser_pid);
+ StatsTable *stats_table = new StatsTable(statsfile,
+ chrome::kStatsMaxThreads, chrome::kStatsMaxCounters);
+ StatsTable::set_current(stats_table);
+ }
StatsScope<StatsCounterTimer>
startup_timer(chrome::Counters::chrome_main());
diff --git a/chrome/browser/plugin_process_host.cc b/chrome/browser/plugin_process_host.cc
index 890a387..e7a7f30 100644
--- a/chrome/browser/plugin_process_host.cc
+++ b/chrome/browser/plugin_process_host.cc
@@ -431,6 +431,7 @@ bool PluginProcessHost::Init(const WebPluginInfo& info,
switches::kSilentDumpOnDCHECK,
switches::kMemoryProfiling,
switches::kUseLowFragHeapCrt,
+ switches::kEnableStatsTable,
};
for (size_t i = 0; i < arraysize(switch_names); ++i) {
diff --git a/chrome/browser/renderer_host/browser_render_process_host.cc b/chrome/browser/renderer_host/browser_render_process_host.cc
index e8bb8b7b..4d6d917 100644
--- a/chrome/browser/renderer_host/browser_render_process_host.cc
+++ b/chrome/browser/renderer_host/browser_render_process_host.cc
@@ -266,6 +266,7 @@ bool BrowserRenderProcessHost::Init() {
switches::kUseLowFragHeapCrt,
switches::kEnableVideo,
switches::kEnableWebWorkers,
+ switches::kEnableStatsTable,
};
for (size_t i = 0; i < arraysize(switch_names); ++i) {
diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc
index 9cd098f..c32cbb5 100644
--- a/chrome/common/chrome_switches.cc
+++ b/chrome/common/chrome_switches.cc
@@ -408,4 +408,7 @@ const wchar_t kViewsGtk[] = L"views-gtk";
// Enables the bookmark menu.
const wchar_t kBookmarkMenu[] = L"bookmark-menu";
+// Enables StatsTable, logging statistics to a global named shared memory table.
+const wchar_t kEnableStatsTable[] = L"enable-stats-table";
+
} // namespace switches
diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h
index c094937..8b51a7d 100644
--- a/chrome/common/chrome_switches.h
+++ b/chrome/common/chrome_switches.h
@@ -159,6 +159,7 @@ extern const wchar_t kEnableWebWorkers[];
extern const wchar_t kViewsGtk[];
extern const wchar_t kBookmarkMenu[];
+extern const wchar_t kEnableStatsTable[];
} // namespace switches