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

Unified Diff: chrome/app/chrome_dll_main.cc

Issue 40012: Stats for the renderers are all broken, because of this change:... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 10 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/app/chrome_dll_main.cc
===================================================================
--- chrome/app/chrome_dll_main.cc (revision 10695)
+++ chrome/app/chrome_dll_main.cc (working copy)
@@ -266,6 +266,18 @@
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 = _wtoi(channel_name.c_str());
+ DCHECK(browser_pid != 0);
+ }
SetupCRT(parsed_command_line);
// Initialize the Chrome path provider.
@@ -279,7 +291,7 @@
// 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());
+ std::string pid_string = StringPrintf("-%d", browser_pid);
statsfile += pid_string;
StatsTable *stats_table = new StatsTable(statsfile,
chrome::kStatsMaxThreads, chrome::kStatsMaxCounters);
@@ -295,9 +307,6 @@
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.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698