summaryrefslogtreecommitdiffstats
path: root/chrome/app/chrome_dll_main.cc
diff options
context:
space:
mode:
authordavemoore@chromium.org <davemoore@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-11 14:54:59 +0000
committerdavemoore@chromium.org <davemoore@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-11 14:54:59 +0000
commit2b96e614bce2dc0a46f32881d2f7584a1cf569e2 (patch)
treec8d888995678351b7f46f0026360c6c8c7c1b7d8 /chrome/app/chrome_dll_main.cc
parent922244b319c4cb9c68b10cc3a206ae1bb1ebbfbd (diff)
downloadchromium_src-2b96e614bce2dc0a46f32881d2f7584a1cf569e2.zip
chromium_src-2b96e614bce2dc0a46f32881d2f7584a1cf569e2.tar.gz
chromium_src-2b96e614bce2dc0a46f32881d2f7584a1cf569e2.tar.bz2
I was a moron and did http://codereview.chromium.org/40012/ against a read only repository.
TBR: jrg Review URL: http://codereview.chromium.org/42071 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11445 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/app/chrome_dll_main.cc')
-rw-r--r--chrome/app/chrome_dll_main.cc17
1 files changed, 13 insertions, 4 deletions
diff --git a/chrome/app/chrome_dll_main.cc b/chrome/app/chrome_dll_main.cc
index a0e1e8a..615507f 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 = _wtoi(channel_name.c_str());
+ DCHECK(browser_pid != 0);
+ }
SetupCRT(parsed_command_line);
// Initialize the Chrome path provider.
@@ -272,7 +284,7 @@ int ChromeMain(int argc, const char** argv) {
// 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);
@@ -288,9 +300,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.