| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // On Linux, when the user tries to launch a second copy of chrome, we check | 5 // On Linux, when the user tries to launch a second copy of chrome, we check |
| 6 // for a socket in the user's profile directory. If the socket file is open we | 6 // for a socket in the user's profile directory. If the socket file is open we |
| 7 // send a message to the first chrome browser process with the current | 7 // send a message to the first chrome browser process with the current |
| 8 // directory and second process command line flags. The second process then | 8 // directory and second process command line flags. The second process then |
| 9 // exits. | 9 // exits. |
| 10 // | 10 // |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 #include "chrome/browser/ui/browser_init.h" | 88 #include "chrome/browser/ui/browser_init.h" |
| 89 #include "chrome/common/chrome_constants.h" | 89 #include "chrome/common/chrome_constants.h" |
| 90 #include "chrome/common/chrome_paths.h" | 90 #include "chrome/common/chrome_paths.h" |
| 91 #include "chrome/common/chrome_switches.h" | 91 #include "chrome/common/chrome_switches.h" |
| 92 #include "content/public/browser/browser_thread.h" | 92 #include "content/public/browser/browser_thread.h" |
| 93 #include "grit/chromium_strings.h" | 93 #include "grit/chromium_strings.h" |
| 94 #include "grit/generated_resources.h" | 94 #include "grit/generated_resources.h" |
| 95 #include "net/base/net_util.h" | 95 #include "net/base/net_util.h" |
| 96 #include "ui/base/l10n/l10n_util.h" | 96 #include "ui/base/l10n/l10n_util.h" |
| 97 | 97 |
| 98 using content::BrowserThread; |
| 99 |
| 98 const int ProcessSingleton::kTimeoutInSeconds; | 100 const int ProcessSingleton::kTimeoutInSeconds; |
| 99 | 101 |
| 100 namespace { | 102 namespace { |
| 101 | 103 |
| 102 const char kStartToken[] = "START"; | 104 const char kStartToken[] = "START"; |
| 103 const char kACKToken[] = "ACK"; | 105 const char kACKToken[] = "ACK"; |
| 104 const char kShutdownToken[] = "SHUTDOWN"; | 106 const char kShutdownToken[] = "SHUTDOWN"; |
| 105 const char kTokenDelimiter = '\0'; | 107 const char kTokenDelimiter = '\0'; |
| 106 const int kMaxMessageLength = 32 * 1024; | 108 const int kMaxMessageLength = 32 * 1024; |
| 107 const int kMaxACKMessageLength = arraysize(kShutdownToken) - 1; | 109 const int kMaxACKMessageLength = arraysize(kShutdownToken) - 1; |
| (...skipping 879 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 987 sock)); | 989 sock)); |
| 988 | 990 |
| 989 return true; | 991 return true; |
| 990 } | 992 } |
| 991 | 993 |
| 992 void ProcessSingleton::Cleanup() { | 994 void ProcessSingleton::Cleanup() { |
| 993 UnlinkPath(socket_path_); | 995 UnlinkPath(socket_path_); |
| 994 UnlinkPath(cookie_path_); | 996 UnlinkPath(cookie_path_); |
| 995 UnlinkPath(lock_path_); | 997 UnlinkPath(lock_path_); |
| 996 } | 998 } |
| OLD | NEW |