summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordavemoore@chromium.org <davemoore@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-13 15:44:04 +0000
committerdavemoore@chromium.org <davemoore@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-13 15:44:04 +0000
commitdd17e9ebd1f1d5e3c3599edbf33b22efe1346d92 (patch)
tree31fe0b9a4195c80270257ad9466556117ed035b3
parent3697547ae0042bc61d4d575afaefb245ba6034be (diff)
downloadchromium_src-dd17e9ebd1f1d5e3c3599edbf33b22efe1346d92.zip
chromium_src-dd17e9ebd1f1d5e3c3599edbf33b22efe1346d92.tar.gz
chromium_src-dd17e9ebd1f1d5e3c3599edbf33b22efe1346d92.tar.bz2
Stats for the renderers are all broken, because of this change:
http://src.chromium.org/viewvc/chrome/trunk/src/chrome/app/chrome_dll_main.cc?r1=6627&r2=6626&pathrev=6627 line 236 We are appending the pid to the name of the shared memory object, which causes each renderer to get its own uninitialized copy of the stats counters, breaking the sharing. So then the about:stats code can't find the counters created and updated by these processes. This includes all the V8 counters and timers. Original issue: http://codereview.chromium.org/40012/show Review URL: http://codereview.chromium.org/42130 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11632 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/app/chrome_dll_main.cc20
1 files changed, 14 insertions, 6 deletions
diff --git a/chrome/app/chrome_dll_main.cc b/chrome/app/chrome_dll_main.cc
index a0e1e8a..e54d207 100644
--- a/chrome/app/chrome_dll_main.cc
+++ b/chrome/app/chrome_dll_main.cc
@@ -259,6 +259,18 @@ int ChromeMain(int argc, const char** argv) {
return 1;
#endif
+ int browser_pid;
+ std::wstring process_type =
+ parsed_command_line.GetSwitchValue(switches::kProcessType);
+ if (process_type.empty()) {
+ browser_pid = base::GetCurrentProcId();
+ } else {
+ std::wstring channel_name =
+ parsed_command_line.GetSwitchValue(switches::kProcessChannelID);
+
+ browser_pid = StringToInt(WideToASCII(channel_name));
+ DCHECK(browser_pid != 0);
+ }
SetupCRT(parsed_command_line);
// Initialize the Chrome path provider.
@@ -271,9 +283,8 @@ 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 = chrome::kStatsFilename;
- std::string pid_string = StringPrintf("-%d", base::GetCurrentProcId());
- statsfile += pid_string;
+ 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);
@@ -288,9 +299,6 @@ int ChromeMain(int argc, const char** argv) {
if (parsed_command_line.HasSwitch(switches::kMessageLoopHistogrammer))
MessageLoop::EnableHistogrammer(true);
- std::wstring process_type =
- parsed_command_line.GetSwitchValue(switches::kProcessType);
-
// Checks if the sandbox is enabled in this process and initializes it if this
// is the case. The crash handler depends on this so it has to be done before
// its initialization.