summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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