summaryrefslogtreecommitdiffstats
path: root/chrome/browser/browser_main.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/browser_main.cc')
-rw-r--r--chrome/browser/browser_main.cc21
1 files changed, 17 insertions, 4 deletions
diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc
index d6dd7e2..bb3d1c3 100644
--- a/chrome/browser/browser_main.cc
+++ b/chrome/browser/browser_main.cc
@@ -588,12 +588,23 @@ int BrowserMain(const MainFunctionParams& parameters) {
return FirstRun::ImportNow(profile, parsed_command_line);
// When another process is running, use it instead of starting us.
- if (process_singleton.NotifyOtherProcess()) {
+ switch (process_singleton.NotifyOtherProcess()) {
+ case ProcessSingleton::PROCESS_NONE:
+ // No process already running, fall through to starting a new one.
+ break;
+
+ case ProcessSingleton::PROCESS_NOTIFIED:
#if defined(OS_LINUX)
- printf("%s\n", base::SysWideToNativeMB(
- l10n_util::GetString(IDS_USED_EXISTING_BROWSER)).c_str());
+ printf("%s\n", base::SysWideToNativeMB(
+ l10n_util::GetString(IDS_USED_EXISTING_BROWSER)).c_str());
#endif
- return ResultCodes::NORMAL_EXIT;
+ return ResultCodes::NORMAL_EXIT;
+
+ case ProcessSingleton::PROFILE_IN_USE:
+ return ResultCodes::PROFILE_IN_USE;
+
+ default:
+ NOTREACHED();
}
// Do the tasks if chrome has been upgraded while it was last running.
@@ -806,6 +817,8 @@ int BrowserMain(const MainFunctionParams& parameters) {
}
}
+ process_singleton.Cleanup();
+
Platform::WillTerminate();
if (metrics)