diff options
author | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-15 02:09:33 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-15 02:09:33 +0000 |
commit | a3abd5576efc64d117141bde14f390fd7e6c6e33 (patch) | |
tree | 5f77cfdbafd3f3b310710009d767b956320e987c /chrome/browser/first_run | |
parent | ee1208717f1e931175c81f63a5a8ef6338091dee (diff) | |
download | chromium_src-a3abd5576efc64d117141bde14f390fd7e6c6e33.zip chromium_src-a3abd5576efc64d117141bde14f390fd7e6c6e33.tar.gz chromium_src-a3abd5576efc64d117141bde14f390fd7e6c6e33.tar.bz2 |
first-run: Pull IsBrowserAlreadyRunning() out of upgrade_util_win.h.
This concept is not specific to upgrade path and thus shouldn't belong there.
Move it to a new header file called browser_util_win.h as it's more appropriate.
BUG=79203
TEST=None
R=jhawkins@chromium.org
Review URL: http://codereview.chromium.org/6861001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81691 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/first_run')
-rw-r--r-- | chrome/browser/first_run/upgrade_util_win.cc | 16 | ||||
-rw-r--r-- | chrome/browser/first_run/upgrade_util_win.h | 7 |
2 files changed, 0 insertions, 23 deletions
diff --git a/chrome/browser/first_run/upgrade_util_win.cc b/chrome/browser/first_run/upgrade_util_win.cc index 7789a2e..6b71d8a 100644 --- a/chrome/browser/first_run/upgrade_util_win.cc +++ b/chrome/browser/first_run/upgrade_util_win.cc @@ -59,7 +59,6 @@ bool InvokeGoogleUpdateForRename() { } // namespace - namespace upgrade_util { bool RelaunchChromeBrowser(const CommandLine& command_line) { @@ -76,21 +75,6 @@ bool IsUpdatePendingRestart() { return file_util::PathExists(new_chrome_exe); } -bool IsBrowserAlreadyRunning() { - static HANDLE handle = NULL; - FilePath exe_path; - PathService::Get(base::FILE_EXE, &exe_path); - std::wstring exe = exe_path.value(); - std::replace(exe.begin(), exe.end(), '\\', '!'); - std::transform(exe.begin(), exe.end(), exe.begin(), tolower); - exe = L"Global\\" + exe; - if (handle != NULL) - CloseHandle(handle); - handle = CreateEvent(NULL, TRUE, TRUE, exe.c_str()); - int error = GetLastError(); - return (error == ERROR_ALREADY_EXISTS || error == ERROR_ACCESS_DENIED); -} - bool SwapNewChromeExeIfPresent() { FilePath new_chrome_exe; if (!GetNewerChromeFile(&new_chrome_exe)) diff --git a/chrome/browser/first_run/upgrade_util_win.h b/chrome/browser/first_run/upgrade_util_win.h index da63aaa..3bbbace 100644 --- a/chrome/browser/first_run/upgrade_util_win.h +++ b/chrome/browser/first_run/upgrade_util_win.h @@ -10,13 +10,6 @@ class CommandLine; namespace upgrade_util { -// Check if current chrome.exe is already running as a browser process by -// trying to create a Global event with name same as full path of chrome.exe. -// This method caches the handle to this event so on subsequent calls also -// it can first close the handle and check for any other process holding the -// handle to the event. -bool IsBrowserAlreadyRunning(); - // If the new_chrome.exe exists (placed by the installer then is swapped // to chrome.exe and the old chrome is renamed to old_chrome.exe. If there // is no new_chrome.exe or the swap fails the return is false; |