summaryrefslogtreecommitdiffstats
path: root/chrome/browser/process_singleton_win.cc
diff options
context:
space:
mode:
authorsuzhe@chromium.org <suzhe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-04 05:34:19 +0000
committersuzhe@chromium.org <suzhe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-04 05:34:19 +0000
commit8b08cbd679e2db2799754557842659d9077ca1d4 (patch)
treefdcfccb983425b9e46c457c8db7aa9b3c13ee0d8 /chrome/browser/process_singleton_win.cc
parentfe63292b5ff8a734578877d192c7f89aa3845e87 (diff)
downloadchromium_src-8b08cbd679e2db2799754557842659d9077ca1d4.zip
chromium_src-8b08cbd679e2db2799754557842659d9077ca1d4.tar.gz
chromium_src-8b08cbd679e2db2799754557842659d9077ca1d4.tar.bz2
It's a copy of http://codereview.chromium.org/155772, with the fix for valgrind test failure.
This CL implements the second TODO item of issue 12343: 2) We should send back an ACK to the second process. If the second process doesn't get an ACK in the given timeout, it should kill the first process and go ahead and start. The approach of this CL is to append process id to the singleton's socket filename, such as "SingletonSocket-12345", and creates a symbol link "SingletonSocket" to the real socket file. In ProcessSingleton::NotifyOtherProcess() if it's successfully connected to "SingletonSocket" but no ACK received, then the original process can be killed by its process id retrieved from the symbol link. BUG=12343 ProcessSingleton Linux cleanups TEST=In one terminal, launch chrome and stop the process by pressing ctrl-z, then launch chrome again in another terminal. The second chrome shall be started in 5 seconds, and the first one shall be killed. Review URL: http://codereview.chromium.org/160436 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22365 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/process_singleton_win.cc')
-rw-r--r--chrome/browser/process_singleton_win.cc4
1 files changed, 1 insertions, 3 deletions
diff --git a/chrome/browser/process_singleton_win.cc b/chrome/browser/process_singleton_win.cc
index a02becc..74e1d51 100644
--- a/chrome/browser/process_singleton_win.cc
+++ b/chrome/browser/process_singleton_win.cc
@@ -78,8 +78,6 @@ bool ProcessSingleton::NotifyOtherProcess() {
AllowSetForegroundWindow(process_id);
- // Gives 20 seconds timeout for the current browser process to respond.
- const int kTimeout = 20000;
COPYDATASTRUCT cds;
cds.dwData = 0;
cds.cbData = static_cast<DWORD>((to_send.length() + 1) * sizeof(wchar_t));
@@ -90,7 +88,7 @@ bool ProcessSingleton::NotifyOtherProcess() {
NULL,
reinterpret_cast<LPARAM>(&cds),
SMTO_ABORTIFHUNG,
- kTimeout,
+ kTimeoutInSeconds * 1000,
&result)) {
// It is possible that the process owning this window may have died by now.
if (!result) {