| 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 630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 641 // of chrome do this in the background, we want to avoid spawning extra | 641 // of chrome do this in the background, we want to avoid spawning extra |
| 642 // windows. | 642 // windows. |
| 643 if (parsed_command_line.HasSwitch(switches::kProductVersion)) { | 643 if (parsed_command_line.HasSwitch(switches::kProductVersion)) { |
| 644 DLOG(WARNING) << "Remote process was passed product version flag, " | 644 DLOG(WARNING) << "Remote process was passed product version flag, " |
| 645 << "but ignored it. Doing nothing."; | 645 << "but ignored it. Doing nothing."; |
| 646 } else { | 646 } else { |
| 647 // Run the browser startup sequence again, with the command line of the | 647 // Run the browser startup sequence again, with the command line of the |
| 648 // signalling process. | 648 // signalling process. |
| 649 FilePath current_dir_file_path(current_dir); | 649 FilePath current_dir_file_path(current_dir); |
| 650 BrowserInit::ProcessCommandLine(parsed_command_line, current_dir_file_path, | 650 BrowserInit::ProcessCommandLine(parsed_command_line, current_dir_file_path, |
| 651 false, profile, NULL); | 651 false /* not process startup */, profile, |
| 652 NULL); |
| 652 } | 653 } |
| 653 | 654 |
| 654 // Send back "ACK" message to prevent the client process from starting up. | 655 // Send back "ACK" message to prevent the client process from starting up. |
| 655 reader->FinishWithACK(kACKToken, arraysize(kACKToken) - 1); | 656 reader->FinishWithACK(kACKToken, arraysize(kACKToken) - 1); |
| 656 } | 657 } |
| 657 | 658 |
| 658 void ProcessSingleton::LinuxWatcher::RemoveSocketReader(SocketReader* reader) { | 659 void ProcessSingleton::LinuxWatcher::RemoveSocketReader(SocketReader* reader) { |
| 659 DCHECK(reader); | 660 DCHECK(reader); |
| 660 readers_.erase(reader); | 661 readers_.erase(reader); |
| 661 delete reader; | 662 delete reader; |
| (...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 979 sock)); | 980 sock)); |
| 980 | 981 |
| 981 return true; | 982 return true; |
| 982 } | 983 } |
| 983 | 984 |
| 984 void ProcessSingleton::Cleanup() { | 985 void ProcessSingleton::Cleanup() { |
| 985 UnlinkPath(socket_path_); | 986 UnlinkPath(socket_path_); |
| 986 UnlinkPath(cookie_path_); | 987 UnlinkPath(cookie_path_); |
| 987 UnlinkPath(lock_path_); | 988 UnlinkPath(lock_path_); |
| 988 } | 989 } |
| OLD | NEW |